Although users can theoretically remove all collision obejcts by removing them one-at-a-time with remove_collision_object, that process has two downsides: (a) it is slow; and (b) collision object updates that are sent via topic publication are not always processed by MoveIt, particularly if multiple are sent in quick succession.
Thus, this PR adds the ability for users to clear all collision objects in the planning scene via service call.
Testing
[x] Launch the simulated panda arm: ros2 launch panda_moveit_config ex_fake_control.launch.py
[x] Clear the planning scene, verify it succeeds: ros2 run pymoveit2 ex_clear_planning_scene.py
[x] Re-add the above two collision objects.
[x] Clear the planning scene and then immediately cancel: ros2 run pymoveit2 ex_clear_planning_scene.py --ros-args -p cancel_after:=0.0. Verify that the code succesfully runs. (Note: although the function call will attempt to cancel the service, there is no guarentees that the service will actually be canceled. This is mainly beneficial in case the service is running too long or blocking.)
Note
I'm okay with either merging it to master or devel. Since it strictly adds functionality, perhaps it only needs to be a minor release?
Description
Although users can theoretically remove all collision obejcts by removing them one-at-a-time with
remove_collision_object
, that process has two downsides: (a) it is slow; and (b) collision object updates that are sent via topic publication are not always processed by MoveIt, particularly if multiple are sent in quick succession.Thus, this PR adds the ability for users to clear all collision objects in the planning scene via service call.
Testing
ros2 launch panda_moveit_config ex_fake_control.launch.py
ros2 run pymoveit2 ex_collision_mesh.py --ros-args -p position:="[0.5, 0.0, 0.0]" -p quat_xyzw:="[0.0, 0.0, -0.7071, 0.7071]"
ros2 run pymoveit2 ex_collision_primitive.py --ros-args -p shape:="sphere" -p position:="[0.5, 0.0, 0.5]" -p dimensions:="[0.04]"
ros2 run pymoveit2 ex_clear_planning_scene.py
ros2 run pymoveit2 ex_clear_planning_scene.py --ros-args -p cancel_after:=0.0
. Verify that the code succesfully runs. (Note: although the function call will attempt to cancel the service, there is no guarentees that the service will actually be canceled. This is mainly beneficial in case the service is running too long or blocking.)Note
I'm okay with either merging it to
master
ordevel
. Since it strictly adds functionality, perhaps it only needs to be a minor release?