Do we need to remove collision object before applyAttachedCollisionObject?
Currently, when I want to attach an object to the robot, I am just doing:
applyCollisionObject()
to add multiple objects in the planning scene- [some robot operations]
applyAttachedCollisionObject()
to attach the given object to the robot end-effector using the object current pose
When looking at the tutorial, it is written:
Attaching an object requires two operations
Removing the original object from the environment Attaching the object to the robot
The tutorial uses planning_scene_diff_publisher
publish call while I would like to hold to the planning_scene_interface
and have synchronous update.
This looks counterintuitive for me and I want to be sure that the object must be removed beforehand, using for instance applyCollisionObject()
with REMOVE
.
Not removing the object from the planning scene seems to work in my case (visually in RViz). But maybe this is not the correct approach and collision issue can occur later with object present both in the world and attached to the robot maybe?
For instance, move_group.attachObject()
does not remove the collision object beforehand, see the code.