Ejemplo n.º 1
0
def _create_model():
    joints = [
        Joint('joint_x', 'prismatic', parent='rfl', child='bridge'),
        Joint('joint_y', 'prismatic', parent='bridge', child='vertical'),
        Joint('joint_z', 'prismatic', parent='vertical', child='base_link'),
        Joint('joint_1', 'revolute', parent='base_link', child='link_1'),
        Joint('joint_2', 'revolute', parent='link_1', child='link_2'),
        Joint('joint_3', 'revolute', parent='link_2', child='link_3'),
        Joint('joint_4', 'revolute', parent='link_3', child='link_4'),
        Joint('joint_5', 'revolute', parent='link_4', child='link_5'),
        Joint('joint_6', 'revolute', parent='link_5', child='link_6'),
    ]
    links = [
        Link('rfl'),
        Link('bridge'),
        Link('vertical'),
        Link('base_link'),
        Link('link_1'),
        Link('link_2'),
        Link('link_3'),
        Link('link_4'),
        Link('link_5'),
        Link('link_6'),
    ]
    return joints, links
Ejemplo n.º 2
0
def ur5():
    """Return a UR5 created programatically instead of from a file."""
    return RobotModel('ur5',
                      joints=[
                          Joint('shoulder_pan_joint', 'revolute', 'base_link',
                                'shoulder_link'),
                          Joint('shoulder_lift_joint', 'revolute',
                                'shoulder_link', 'upper_arm_link'),
                          Joint('elbow_joint', 'revolute', 'upper_arm_link',
                                'forearm_link'),
                          Joint('wrist_1_joint', 'revolute', 'forearm_link',
                                'wrist_1_link'),
                          Joint('wrist_2_joint', 'revolute', 'wrist_1_link',
                                'wrist_2_link'),
                          Joint('wrist_3_joint', 'revolute', 'wrist_2_link',
                                'wrist_3_link'),
                      ],
                      links=[
                          Link('base_link'),
                          Link('shoulder_link'),
                          Link('upper_arm_link'),
                          Link('forearm_link'),
                          Link('wrist_1_link'),
                          Link('wrist_2_link'),
                          Link('wrist_3_link'),
                      ])
                             'revolute',
                             parent='shoulder_link',
                             child='upper_arm_link'),
                       Joint('elbow_joint',
                             'revolute',
                             parent='upper_arm_link',
                             child='forearm_link'),
                       Joint('wrist_1_joint',
                             'revolute',
                             parent='forearm_link',
                             child='wrist_1_link'),
                       Joint('wrist_2_joint',
                             'revolute',
                             parent='wrist_1_link',
                             child='wrist_2_link'),
                       Joint('wrist_3_joint',
                             'revolute',
                             parent='wrist_2_link',
                             child='wrist_3_link'),
                   ],
                   links=[
                       Link('base_link'),
                       Link('shoulder_link'),
                       Link('upper_arm_link'),
                       Link('forearm_link'),
                       Link('wrist_1_link'),
                       Link('wrist_2_link'),
                       Link('wrist_3_link'),
                   ])
print(robot)