Quantcast
Channel: Grasshopper Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 3657

Extracting ABC angles from Plane (Yaw Pitch Roll)

$
0
0

@nkal wrote:

Hello,

I am having trouble extracting the yaw pitch and roll from a plane. I have a c# function that does the opposite: takes in abc values and produces a plane out of them:

public Rhino.Geometry.Plane calculatePlaneFromPos(string encodedPosition)
    {

        E6Pos position = new E6Pos(encodedPosition);
        Point3d tempPoint = new Point3d(position.xValue, position.yValue, position.zValue);
        Plane tempPlane = new Plane(tempPoint, new Vector3d(0, 0, 1));
        Transform rotationZ = Transform.Rotation(Rhino.RhinoMath.ToRadians(position.aValue), new Vector3d(0, 0, 1), tempPoint);
        tempPlane.Transform(rotationZ);
        Transform rotationY = Transform.Rotation(Rhino.RhinoMath.ToRadians(position.bValue), tempPlane.YAxis, tempPoint);
        tempPlane.Transform(rotationY);
        Transform rotationX = Transform.Rotation(Rhino.RhinoMath.ToRadians(position.cValue), tempPlane.XAxis, tempPoint);
        tempPlane.Transform(rotationX);
        return tempPlane;
    }

Now I need a function that does the opposite, takes in a plane and spits out XYZ and ABCs.
As background information, I am working on a software that interacts with a KUKA robot, and the datatype used involves having XYZ and ABC to define an endpoint for the robot arm to move to.

“In kuka, rotations are done in order A > B > C where
A is rotation about Z
B is rotation about Y
C is rotation about X”

Something similar has been asked here, but the solution provided does not work for my case.

Any suggestions?

Thanks!

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 3657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>