Skip to content

Get Collision Model

SUMMARY

Get Collision Model returns the pinocchio.GeometryModel populated from the URDF's <collision> tags - simplified primitives (boxes, cylinders, capsules, decimated meshes) optimized for fast queries with hpp-fcl. Use it for self-collision checks, environment-collision checks, or to feed a custom motion planner that consumes Pinocchio geometry.

The Skill

python
collision_model = robot.get_collision_model()

The Code

python
"""
Read the Pinocchio collision geometry model.

Supports Universal Robots (UR), Epson, and virtual.

Usage:
    python get_collision_model.py
"""

from loguru import logger

from telekinesis.synapse.robots.manipulators import universal_robots


def main():
    """Read the Pinocchio collision geometry model and log a summary."""

    #===================== Create Robot ==========================================
    robot = universal_robots.UniversalRobotsUR10E(name='UR10e')

    # ==================== Run Skill ============================================
    collision_model = robot.get_collision_model()

    logger.info(f"Number of collision geometries: {len(collision_model.geometryObjects)}")
    logger.info(f"Number of collision pairs: {len(collision_model.collisionPairs)}")


if __name__ == "__main__":
    main()

Parameter Configuration

This skill takes no input parameters.

Returns

TypeDescription
pinocchio.GeometryModelCollision GeometryModel built from the URDF's <collision> declarations. Built lazily on first access and cached on the robot.

Raises

ExceptionCondition
ImportErrorThe pinocchio package is not installed (raised on the first call only; subsequent calls hit the cache)

Where to Use the Skill

  • Self-collision checks - Add collision pairs and run pin.computeCollisions to validate candidate joint configurations.
  • Environment-collision checks - Attach static obstacles to the collision model for whole-scene checks.
  • Motion planning - Feed the collision model into a Pinocchio-aware planner.
  • Companion to Get Model and Get Visual Model when a library expects the full (model, collision_model, visual_model) triple.

When Not to Use the Skill