PlanningScene.add_collision_mesh

PlanningScene.add_collision_mesh(collision_mesh, scale=False)[source]

Add a collision mesh to the planning scene.

If there is already a CollisionMesh in the PlanningScene with the same id it will be replaced.

Parameters:
collision_meshCollisionMesh

The collision mesh we want to add.

scalebool, optional

If True, the mesh will be copied and scaled according to the robot’s scale factor.

Returns:
None

Examples

>>> with RosClient() as client:
...     robot = client.load_robot()
...     scene = PlanningScene(robot)
...     mesh = Mesh.from_stl(compas_fab.get('planning_scene/floor.stl'))
...     cm = CollisionMesh(mesh, 'floor')
...     scene.add_collision_mesh(cm)