PlanningScene.attach_collision_mesh_to_robot_end_effector
-
PlanningScene.
attach_collision_mesh_to_robot_end_effector
(collision_mesh, scale=False, group=None)[source] Attaches a collision mesh to the robot’s end-effector.
- Parameters
collision_mesh (
compas_fab.robots.CollisionMesh
) – The collision mesh.scale (bool, optional) – If True, the mesh will be scaled according to the robot’s scale factor.
group (str) – The planning group to which we want to attach the mesh to. Defaults to the robot’s main planning group.
- Returns
None
Examples
>>> scene = PlanningScene(robot) >>> mesh = Mesh.from_stl(compas_fab.get('planning_scene/cone.stl')) >>> cm = CollisionMesh(mesh, 'tip') >>> group = robot.main_group_name >>> scene.attach_collision_mesh_to_robot_end_effector(cm, group=group)
>>> # wait for it to be attached >>> time.sleep(1)
>>> # wait for it to be removed >>> scene.remove_attached_collision_mesh('tip') >>> time.sleep(1)
>>> # check if it's really gone >>> planning_scene = robot.client.get_planning_scene() >>> objects = [c.object['id'] for c in planning_scene.robot_state.attached_collision_objects] >>> 'tip' in objects False