-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Description
In mplib's PlanningWorld, objects attached to the robot (via update_attached_box or attach_object) correctly trigger collisions with Point Clouds, but are completely ignored when checking against Normal Objects (FCL primitives added via set_normal_object).
Steps to Reproduce
- Create a
PlanningWorldand add an articulated robot. - Add a primitive Box as an environment obstacle using
set_normal_object. - Attach another Box to the robot's end-effector using
update_attached_box. - Position the robot so that the attached box intersects with the environment obstacle.
- Call
check_for_env_collision(use_attach=True)orplanning_world.collide_with_others().
Observed Behavior
The collision check returns False (no collision), even if the attached object is significantly larger than the obstacle.
However, if the same obstacle is added as a Point Cloud instead of a Normal Object, the collision is detected correctly with the trace: attached_tool collides with point_cloud.
Expected Behavior
Attached objects should be included in the collision check against Normal Objects when use_attach is enabled.
Minimal Code Example
import numpy as np
from mplib import Planner
from mplib.pymp.collision_detection import fcl
# ... Setup planner and world ...
# 1. Add environment obstacle
obs_geom = fcl.Box([0.1, 0.1, 0.1])
obs_obj = fcl.CollisionObject(obs_geom, [0.4, 0.0, 0.05], [1, 0, 0, 0])
planner.set_normal_object("obstacle", obs_obj)
# 2. Attach a monster box to the end-effector (2m large)
planner.update_attached_box([2.0, 2.0, 2.0], [0, 0, 0, 1, 0, 0, 0])
# 3. Check collision
# Actual: returns [], Expected: should detect collision with "obstacle"
results = planner.check_for_env_collision(use_attach=True)
print(f"Collision detected: {len(results) > 0}")Environment
- OS: Linux
- Python version: 3.10
- mplib version: latest
Additional Context
It seems the collision matrix in PlanningWorld might be missing the Attached Body vs Normal Object interaction layer, while the Attached Body vs Point Cloud layer works as intended.