コード例 #1
0
 def remove_collision_mesh_async(self, callback, errback, id):
     co = CollisionObject()
     co.id = id
     co.operation = CollisionObject.REMOVE
     world = PlanningSceneWorld(collision_objects=[co])
     scene = PlanningScene(world=world, is_diff=True)
     request = scene.to_request(self.ros_client.ros_distro)
     self.APPLY_PLANNING_SCENE(self.ros_client, request, callback, errback)
コード例 #2
0
 def add_collision_mesh_async(self, callback, errback, collision_mesh):
     co = CollisionObject.from_collision_mesh(collision_mesh)
     co.operation = CollisionObject.ADD
     world = PlanningSceneWorld(collision_objects=[co])
     scene = PlanningScene(world=world, is_diff=True)
     request = scene.to_request(self.ros_client.ros_distro)
     self.APPLY_PLANNING_SCENE(self.ros_client, request, callback, errback)
コード例 #3
0
    def build_collision_object(self, frame_id, id_name, compas_mesh,
                               operation):
        co = CollisionObject(header=Header(frame_id=frame_id), id=id_name)

        if compas_mesh:
            # ROS mesh message requires triangles
            mesh_quads_to_triangles(compas_mesh)
            mesh = Mesh.from_mesh(compas_mesh)
            co.meshes = [mesh]
            co.mesh_poses = [Pose()]

        if operation == 0:
            co.operation = CollisionObject.ADD
        elif operation == 1:
            co.operation = CollisionObject.REMOVE
        elif operation == 2:
            co.operation = CollisionObject.APPEND
        else:
            raise ValueError("Operation unknown")

        return co
コード例 #4
0
 def append_collision_mesh(self, collision_mesh):
     """Append a collision mesh to the planning scene."""
     co = CollisionObject.from_collision_mesh(collision_mesh)
     self._collision_object(co, CollisionObject.APPEND)
コード例 #5
0
 def remove_collision_mesh(self, id):
     """Remove a collision mesh from the planning scene."""
     co = CollisionObject()
     co.id = id
     self._collision_object(co, CollisionObject.REMOVE)
コード例 #6
0
 def add_collision_mesh(self, collision_mesh):
     """Add a collision mesh to the planning scene."""
     co = CollisionObject.from_collision_mesh(collision_mesh)
     self._collision_object(co, CollisionObject.ADD)