Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Convert Pose to KuKa Euler Coordinates in C#


We are currently interfacing RoboDK with our SW using the C# Api. In RoboDk we are using the KUKA KR 250 R2700-2.

We are having some issue in performing absolute rotation of the end effector of the robot and we think the issue are the Euler Coordinates that we obtain in the Api.

We collect the pose using Pose(), we create a rotation matrix, we transform the rotation matrix from the reference frame in 0.0.0 to the frame of the robot and we then multiply by the robot pose. we then send this pose to robodk using MoveJ.

As long as the coordinate system is similar to the system of the end effector, it works as expected. If instead they differ (especially in z axis) then the movement is not what we expect.

I think this is because the Pose that we obtain with Pose() is in Mecademic coordinates, while the robot uses KUKA Coordinates. 

Is there a way in C# to obtain and send the coordinate correctly to robodk?

Below an example of what we are doing. We also tryed using RPM instead of Rxyz but it still doesn't work

 Mat robot_pose = _robot.Pose();
var move_xyzrxryrz = new double[6];
move_xyzrxryrz[0] = 0;
move_xyzrxryrz[1] = 0;
move_xyzrxryrz[2] = 0;
move_xyzrxryrz[3] = 0;
move_xyzrxryrz[4] = -45;
move_xyzrxryrz[5] = 0;
var movementPoseRxyz = Mat.FromTxyzRxyz(move_xyzrxryrz);
var transformationAxes = new Mat(robot_pose);
transformationAxes.setPos(0, 0, 0);                 
var movementPoseAlignedRxyz = transformationAxes.inv() * movementPoseRxyz * transformationAxes;
Mat MovRxyz = robot_pose * movementPoseAlignedRxyz;
_robot.MoveJ(MovRxyz, MoveBlocking);

I updated the example and I added some screenshot to clarify the behavior. Please see the coordinates before and after attempting to perform a -45° rotation on the Y axis. I also included the screenshot of the final pose that I was expecting.

Attached Files Thumbnail(s)
var newPose = Mat.MultiplyMatSimple( _robot.Pose(), -Mat.roty(Math.PI/4));

Users browsing this thread:
1 Guest(s)