Using something like
from moveit.planning import MoveItPy
robot = MoveItPy(node_name="moveit_py")
psm = robot.get_planning_scene_monitor()
psm.start_scene_monitor("/planning_scene")
psm.start_state_monitor("/joint_states", "/attached_collision_object")
with psm.read_write() as planning_scene:
planning_scene.apply_collision_object(collision_object, color)
I do not see any changes to what is shown in RViz.
Is the issue that I also need to call startPublishingPlanningScene
so that my collision objects are actually published? Do I understand correctly that there is no Python API for that? Anything else I should or could do? Perhaps manually publish to /attached_collision_object
or some other relevant topic?
For moveit 1, there seems to be https://github.com/moveit/moveit/blob/master/moveit_commander/src/moveit_commander/planning_scene_interface.py, but nothing similar for MoveIt2?