This PR extendes pymoveit2 to allow users to (dis)allow collisions between one object and all other objects. In practice, this is useful because a robot typically consists of many objects/links, so instead of specifying every object ID for a robot part that we want to (dis)allow collisions with, it is easier to just (dis)allow collisions with all objects, which includes the whole robot.
Testing
[x] Launch the simulated panda arm: ros2 launch panda_moveit_config ex_fake_control.launch.py
[x] Add a collision object to the planning scene: ros2 run pymoveit2 ex_collision_primitive.py --ros-args -p shape:="sphere" -p position:="[0.5, 0.0, 0.5]" -p dimensions:="[0.04]"
[x] In RVIZ, move the robot arm to the collision object, and verify that it turns red (indicating a collision). Plan and verify it fails.
[x] Allow collisions with that object: ros2 run pymoveit2 ex_allow_collisions.py --ros-args -p id:="sphere" -p allow:=true
[x] In RVIZ, plan to the same arm configuration and verify it succeeds.
[x] Disallow collisions with that object: ros2 run pymoveit2 ex_allow_collisions.py --ros-args -p id:="sphere" -p allow:=false
[x] In RVIZ, verify that the colliding parts of the robot arm turned red again.
Notes / Future Work
Note that although (dis)allowing collisions is asynchronous, within the call it synchronously waits for the planning scene. This should be improved in the future to make it a fully asynchronous call (maybe pymoveit2 subscribes to the MoveGroup's published planning scene topic so it constantly maintains an upt-to-date planning scene?).
This PR (dis)allows collisions between one object and all other objects, which was sufficient for our use case. Extending this to more granularly (dis)allowing collisions between pairs of objects should be straightforward.
Description
This PR extendes
pymoveit2
to allow users to (dis)allow collisions between one object and all other objects. In practice, this is useful because a robot typically consists of many objects/links, so instead of specifying every object ID for a robot part that we want to (dis)allow collisions with, it is easier to just (dis)allow collisions with all objects, which includes the whole robot.Testing
ros2 launch panda_moveit_config ex_fake_control.launch.py
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_allow_collisions.py --ros-args -p id:="sphere" -p allow:=true
ros2 run pymoveit2 ex_allow_collisions.py --ros-args -p id:="sphere" -p allow:=false
Notes / Future Work
pymoveit2
subscribes to the MoveGroup's published planning scene topic so it constantly maintains an upt-to-date planning scene?).