Get Collision Geometries and Transforms
SUMMARY
Get Collision Geometries and Transforms returns the robot's collision geometries and their world-frame transforms for a given joint configuration.
UNITS
joint_positions are in degrees.
The Skill
python
geometries, transforms = robot.get_collision_geometries_and_transforms(joint_positions)The Code
python
"""
Place the robot's collision geometries in the world frame for a joint configuration.
Supports Universal Robots (UR), Epson, and virtual.
Usage:
python get_collision_geometries_and_transforms.py
"""
from loguru import logger
from telekinesis.synapse.robots.manipulators import universal_robots
def main():
"""Log each collision geometry of the robot and its world-frame transform."""
#===================== Create Robot ==========================================
robot = universal_robots.UniversalRobotsUR10E(name='UR10e')
# ==================== Run Skill ============================================
q = [0, -90, 90, 0, 90, 0]
geometries, transforms = robot.get_collision_geometries_and_transforms(joint_positions=q)
logger.info(f"Collision geometries: {len(geometries)}")
for geometry, transform in zip(geometries, transforms):
logger.info(f"{geometry}:\n{transform}")
robot.shutdown()
if __name__ == "__main__":
main()Running the Example
bash
python get_collision_geometries_and_transforms.pyFor all options:
bash
python get_collision_geometries_and_transforms.py --helpParameter Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
joint_positions | list[float] | np.ndarray | required | Joint configuration to place the collision geometries at, in degrees. |
Returns
| Type | Description |
|---|---|
tuple[list, list[np.ndarray]] | Collision geometries, and a matching list of 4x4 world-frame transforms. Attached collision objects belong to the planning scene and are not included. |
How to Tune the Parameters
Pass the configuration you want to inspect, for example robot.get_joint_positions() for the current pose or a planned waypoint. Attached tools and scene objects are not part of this result.
Where to Use the Skill
- Collision checking - Feed robot geometry into your own collision checks.
- Visualization - Draw the collision shapes at a planned waypoint.
When Not to Use the Skill
- You need visual meshes - use Get Visual Meshes Data.
- You need link frames - use Get Link Transforms.