Skip to content

Bug Report: Attached objects ignore collisions with Normal Objects (FCL primitives) #124

@confucianism72

Description

@confucianism72

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

  1. Create a PlanningWorld and add an articulated robot.
  2. Add a primitive Box as an environment obstacle using set_normal_object.
  3. Attach another Box to the robot's end-effector using update_attached_box.
  4. Position the robot so that the attached box intersects with the environment obstacle.
  5. Call check_for_env_collision(use_attach=True) or planning_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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions