MoveIt End effector moves correctly but reports back different orientation
I've got a simulation setup of the Kuka KR6 Agilus running in Gazebo using MoveIt for movement.
In order to move the robot I'm calling MoveGroupInterface::setPoseTarget and MoveGroupInterface::asyncMove(), and to get the current pose I'm calling MoveGroupInterface::getCurrentPose.
There is an inconsistency between the pose that is set and the pose that is reported from MoveIt. The image below shows the pose I'm requesting and the pose I'm getting after the robot has reached its pose.
I guess the pose is correct, but why the difference in the quaternions representing orientation? I don't specify the end_effector_link in any calls to setPoseTarget() or getCurrentPose().
Without any changes it now reports the following orientation (0.0, 0.7071, 0.0, 0.7071) with the same desired position and desired orientation. Reported position is still correct.
The problem is with the last joint. When joint values are calculated it is set to arbitrary positions as it doesn't influence the actual pose of the robot per se, as it has no attachments to it, but is somehow included in the calculation when asking for current pose. Should this be reported?
Did you manage to fix this?
Not really a fix, but orientations became accurate when a tool was included in the kinematic chain. From what I can recall about the problem, it would seem that the joint position of the last joint didn't matter as the end-point was located in the center of that joint. However, from what I can understand, it should matter. Seemingly it did for FK but not IK. This problem no longer occurred when I added a tool to the kinematic chain.
If you can make an answer of this and mark it solved, that would be great.
Should this not be reported on the MoveIt issue tracker? I agree with @Borkr: whether or not a chain ends with the last joint (or
link
, really) should not matter for correct FK/IK.If it's a reproducible bug then yes, if it's a vague memory of what might solved a problem related to this issue and robot, then it seems better stored as an answer here.
Sorry for the late reply, added the answer but I'm unable to accept my own answer due to limited points.