Capturing pose with a button, questions and troubles

Hi there!

I’ve found out createJointPositions acquires well the joint angles you pass, at least in the range -2Pi to +2PI.

jointPositions[0] = valueFactoryProvider.getJointPositionFactory().createJointPositions(tcp_jointPositions[0], tcp_jointPositions[1], tcp_jointPositions[2], tcp_jointPositions[3], tcp_jointPositions[4], tcp_jointPositions[5], Angle.Unit.RAD);

But when you read back the angles from it, if they where negative, you get them with 2PI added. So it only gives you back angles in the range 0 to +2PI, which can lead (and leads) to errors.

It gives the same result no matter if you use these two ways to get the angles back.

jointPositionsArray1[i] = jointPosition[i].getAngle(Angle.Unit.RAD);
jointPositionsArray2[i] = jointPositions[0].getAllJointPositions()[i].getAngle(Angle.Unit.RAD);

I think of this as a bug, can you confirm that or put some light in the matter, UR team?

1 Like