assert len(self.joints) > 0, "no joint defined" assert len(self.actuators) > 0, "no actuator defined" xmlr.reflect(Transmission, tag='new_transmission', params=[ name_attribute, xmlr.Element('type', str), xmlr.AggregateElement('joint', TransmissionJoint), xmlr.AggregateElement('actuator', Actuator) ]) xmlr.add_type( 'transmission', xmlr.DuckTypedFactory('transmission', [Transmission, PR2Transmission])) class Robot(xmlr.Object): def __init__(self, name=None): self.aggregate_init() self.name = name self.joints = [] self.links = [] self.materials = [] self.gazebos = [] self.transmissions = [] self.joint_map = {} self.link_map = {}
name_attribute, xmlr.Attribute('type', str), xmlr.Element('actuator', 'element_name'), xmlr.Element('gap_joint', PR2GapJoint), xmlr.Element('use_simulated_gripper_joint', 'element_name'), xmlr.AggregateElement('passive_joint', 'element_name', 'passive_joint'), xmlr.Element('simulated_actuated_joint', PR2SimulatedActuatedJoint), ]) #xmlr.add_type('transmission', xmlr.DuckTypedFactory('transmission', [Transmission, PR2WristTransmission, PR2GripperTransmission])) xmlr.add_type( 'transmission', xmlr.DuckTypedFactory('transmission', [ Transmission, PR2Transmission, PR2WristTransmission, PR2GripperTransmission ])) class Robot(xmlr.Object): def __init__(self, name=None): self.aggregate_init() self.name = name self.joints = [] self.links = [] self.materials = [] self.gazebos = [] self.transmissions = [] self.joint_map = {}