Allow clearing all collision objects #69
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?