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)
def get_urdf_element(self): attributes = {'radius': self.radius} return URDFElement('sphere', attributes)
def get_urdf_element(self): attributes = {'radius': self.radius, 'length': self.length} return URDFElement('cylinder', attributes)
def get_urdf_element(self): attributes = self.attr.copy() elements = [self.shape] return URDFElement('geometry', attributes, elements)
def get_urdf_element(self): attributes = {'size': '{} {} {}'.format(*self.size)} return URDFElement('box', attributes)
def get_urdf_element(self): attributes = {'name': self.name} elements = [self.color, self.texture] return URDFElement('material', attributes, elements)
def get_urdf_element(self): attributes = {'filename': self.filename} return URDFElement('texture', attributes)
def get_urdf_element(self): attributes = {'rgba': "{} {} {} {}".format(*self.rgba)} return URDFElement('color', attributes)
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)