PlanningScene.append_collision_mesh

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

Append a collision mesh to the planning scene.

Appends a CollisionMesh to the PlanningScene using id as an identifier of a group or cluster of collision meshes. If the group does not exist, it will be created implicitly; if it does exist, the meshes will be appended to it instead.

Grouping meshes under a common identifier allows to remove them all in one operation, using the remove_collision_mesh() with the group identifier.

Parameters:
collision_meshCollisionMesh

The collision mesh we want to append to the PlanningScene.

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.append_collision_mesh(cm)