Ignore yaw of object for pick and place
I am working on a pick and place application where I have to pick a dodecahedron with a vacuum gripper. The camera gives the object pose with respect to the bin it is in. I want to avoid rotating the 6th joint while grasping the object. As long as the object's top is flat, I can ignore the z-rotation. But this is not always the case, since there's a pile of objects.
I have few ideas how to do this:
- Plan only for 5 joints for the 6-axis robot. In this case, the last joint would be excluded from the plan. But I am not sure if this can be done in the code. The only way I know is to specify the kinematic chain group in SRDF. But I do not want this. Is there any way the tool tip can be specified in the code?
- A hack would be that after moveit plans the trajectory, I loop through the trajectory and replace the 6th joint values with its current value. But I would like to avoid this, since it doesn't seem to be the best way.
- Probably I can give constraints for the 6th joint with a very low tolerance. But Python (I need to use SMACH, hence python) doesn't have the function to set joint constraints in its interface.
- Nullify the z-axis rotation from the quaternion. Quaternions being so complicated, I can't wrap my head around how to do this. As long as the object lies flat, I can convert the quaternion to eulers, set yaw=0 and convert it back to quaternion. This doesn't work well when the object's top surface is inclined though. Just to mention it again, the object's pose is in the bin's frame.
Any more ideas or a way to do one of the above are welcome. Thanks!
To my knowledge, http://wiki.ros.org/descartes implements something very similar to what you are describing (planning for a target pose while ignoring rotation around a certain axis). There are discussions about including this in MoveIt: https://github.com/ros-planning/movei...
Doesn't Descartes define a new data structure for representing this rotation invariance? Maybe it is an overkill for my application.