def make_box(name, pose, size):
     """
     Creates a box collision object.
     :param name: name of the box
     :type: str
     :param pose: position of the box
     :type: PoseStamped
     :param size: box size
     :type: [float(x), float(y), float(z)]
     :return: box collision object
     :type: CollisionObject
     """
     co = CollisionObject()
     co.operation = CollisionObject.ADD
     co.id = name
     co.header = pose.header
     box = SolidPrimitive()
     box.type = SolidPrimitive.BOX
     box.dimensions = list(size)
     co.primitives = [box]
     co.primitive_poses = [pose.pose]
     return co
Exemple #2
0
 def make_cylinder(name, pose, size):
     """
     Creates a cylinder collision object.
     :param name: name of the cylinder
     :type: str
     :param pose: position of the cylinder
     :type: PoseStamped
     :param size: cylinder size
     :type: [float(height), float(radius)]
     :return: cylinder collisionobject
     :type: CollisionObject
     """
     co = CollisionObject()
     co.operation = CollisionObject.ADD
     co.id = name
     co.header = pose.header
     cylinder = SolidPrimitive()
     cylinder.type = SolidPrimitive.CYLINDER
     cylinder.dimensions = list(size)
     co.primitives = [cylinder]
     co.primitive_poses = [pose.pose]
     return co
 def make_cylinder(name, pose, size):
     """
     Creates a cylinder collision object.
     :param name: name of the cylinder
     :type: str
     :param pose: position of the cylinder
     :type: PoseStamped
     :param size: cylinder size
     :type: [float(height), float(radius)]
     :return: cylinder collisionobject
     :type: CollisionObject
     """
     co = CollisionObject()
     co.operation = CollisionObject.ADD
     co.id = name
     co.header = pose.header
     cylinder = SolidPrimitive()
     cylinder.type = SolidPrimitive.CYLINDER
     cylinder.dimensions = list(size)
     co.primitives = [cylinder]
     co.primitive_poses = [pose.pose]
     return co
Exemple #4
0
 def make_box(name, pose, size):
     """
     Creates a box collision object.
     :param name: name of the box
     :type: str
     :param pose: position of the box
     :type: PoseStamped
     :param size: box size
     :type: [float(x), float(y), float(z)]
     :return: box collision object
     :type: CollisionObject
     """
     co = CollisionObject()
     co.operation = CollisionObject.ADD
     co.id = name
     co.header = pose.header
     box = SolidPrimitive()
     box.type = SolidPrimitive.BOX
     box.dimensions = list(size)
     co.primitives = [box]
     co.primitive_poses = [pose.pose]
     return co