示例#1
0
 def get_urdf_element(self):
     attributes = {'filename': self.filename}
     # There is no need to record default values.  Usually these
     # coincide with some form of 0 and are filtered out with
     # `attributes = dict(filter(lambda x: x[1], attributes.items()))`,
     # but here we must be explicit.
     if self.scale != [1.0, 1.0, 1.0]:
         attributes['scale'] = "{} {} {}".format(*self.scale)
     return URDFElement('mesh', attributes)
示例#2
0
 def get_urdf_element(self):
     attributes = {'radius': self.radius}
     return URDFElement('sphere', attributes)
示例#3
0
 def get_urdf_element(self):
     attributes = {'radius': self.radius, 'length': self.length}
     return URDFElement('cylinder', attributes)
示例#4
0
 def get_urdf_element(self):
     attributes = self.attr.copy()
     elements = [self.shape]
     return URDFElement('geometry', attributes, elements)
示例#5
0
 def get_urdf_element(self):
     attributes = {'size': '{} {} {}'.format(*self.size)}
     return URDFElement('box', attributes)
示例#6
0
 def get_urdf_element(self):
     attributes = {'name': self.name}
     elements = [self.color, self.texture]
     return URDFElement('material', attributes, elements)
示例#7
0
 def get_urdf_element(self):
     attributes = {'filename': self.filename}
     return URDFElement('texture', attributes)
示例#8
0
 def get_urdf_element(self):
     attributes = {'rgba': "{} {} {} {}".format(*self.rgba)}
     return URDFElement('color', attributes)
示例#9
0
 def get_urdf_element(self):
     attributes = {
         'xyz': "{} {} {}".format(self.point.x, self.point.y, self.point.z),
         'rpy': "{} {} {}".format(*self.euler_angles())
     }
     return URDFElement('origin', attributes)