Skip to content

Allow clearing all collision objects#69

Merged
AndrejOrsula merged 2 commits intoAndrejOrsula:masterfrom
personalrobotics:amaln/clear_all_collision_objects
May 19, 2024
Merged

Allow clearing all collision objects#69
AndrejOrsula merged 2 commits intoAndrejOrsula:masterfrom
personalrobotics:amaln/clear_all_collision_objects

Conversation

@amalnanavati
Copy link
Contributor

@amalnanavati amalnanavati commented May 15, 2024

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

  • Launch the simulated panda arm: ros2 launch panda_moveit_config ex_fake_control.launch.py
  • Add two collision objects, e.g.,:
    • 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]"
  • Clear the planning scene, verify it succeeds: ros2 run pymoveit2 ex_clear_planning_scene.py
  • Re-add the above two collision objects.
  • 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?

Copy link
Owner

@AndrejOrsula AndrejOrsula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @amalnanavati! Looks good and thanks also for updating the code for scaling the model.

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?

Yeah, using the default branch is fine

@AndrejOrsula AndrejOrsula merged commit d38a653 into AndrejOrsula:master May 19, 2024
@amalnanavati amalnanavati deleted the amaln/clear_all_collision_objects branch November 27, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants