Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow clearing all collision objects #69

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
2 checks passed
@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