Ejemplo n.º 1
0
def planar2r():
    robo = Robot('planar2r', 2, 2, 3, False, tools.SIMPLE)
    # update geometric params
    params = {
        1: {'sigma': 0, 'mu': 1, 'theta': var('th1')},
        2: {'sigma': 0, 'mu': 1, 'alpha': 0, 'd': var('L1'), 'theta': var('th2')},
        3: {'sigma': 2, 'd': var('L2')}
    }
    robo.update_params('geos', params)
    # update dynamic params
    params = {
        1: {'xx': 0, 'xy': 0, 'xz': 0, 'yy': 0, 'yz': 0, 'ia': 0}
    }
    robo.update_params('dyns', params)
    # update joint params
    params = {
        0: {'qdots': 0, 'qddots': 0, 'torques': 0}
    }
    robo.update_params('misc', params)
    # update gravity vector
    params = {
        0: {'gravity': 0},
        1: {'gravity': 0},
        2: {'gravity': var('G3')},
    }
    robo.update_params('misc', params)
    return robo
Ejemplo n.º 2
0
def planar2r_numerical(is_floating=False):
    # numerical values (random in some case)
    L1 = 0.5
    L2 = 0.4
    ZZ1 = 3.7
    ZZ2 = 0.35
    MX2 = 0.4
    MY2 = 0.15
    M1 = 1.2
    M2 = 0.8
    FC1 = 0.3
    FC2 = 0.25
    FV1 = 0.3
    FV2 = 0.18
    IA1 = 0.0
    IA2 = 0.0
    G3 = -9.81
    # create robot
    robo = Robot(
        'planar2r', 2, 2, 3, is_floating,
        tools.SIMPLE, is_symbolic=False
    )
    robo.set_dyns_to_zero()
    # update geometric params
    params = {
        1: {'sigma': 0, 'mu': 1},
        2: {'sigma': 0, 'mu': 1, 'd': L1},
        3: {'sigma': 2, 'd': L2}
    }
    robo.update_params('geos', params)
    # update dynamic params
    params = {
        1: {
            'zz': ZZ1, 'frc': FC1, 'frv': FV1, 'ia': IA1, 'mass': M1
        },
        2: {
            'zz': ZZ2, 'frc': FC2, 'frv': FV2, 'ia': IA2, 'mass': M2,
            'msx': MX2, 'msy': MY2
        }
    }
    robo.update_params('dyns', params)
    # update joint params
    params = {0: {'qdots': 0, 'qddots': 0, 'torques': 0}}
    robo.update_params('misc', params)
    # update gravity vector
    params = {
        0: {'gravity': 0},
        1: {'gravity': 0},
        2: {'gravity': G3},
    }
    robo.update_params('misc', params)
    return robo
Ejemplo n.º 3
0
def planar2r():
    robo = Robot('planar2r', 2, 2, 3, False, tools.SIMPLE)
    # update geometric params
    params = {
        1: {
            'sigma': 0,
            'mu': 1,
            'theta': var('th1')
        },
        2: {
            'sigma': 0,
            'mu': 1,
            'alpha': 0,
            'd': var('L1'),
            'theta': var('th2')
        },
        3: {
            'sigma': 2,
            'd': var('L2')
        }
    }
    robo.update_params('geos', params)
    # update dynamic params
    params = {1: {'xx': 0, 'xy': 0, 'xz': 0, 'yy': 0, 'yz': 0, 'ia': 0}}
    robo.update_params('dyns', params)
    # update joint params
    params = {0: {'qdots': 0, 'qddots': 0, 'torques': 0}}
    robo.update_params('misc', params)
    # update gravity vector
    params = {
        0: {
            'gravity': 0
        },
        1: {
            'gravity': 0
        },
        2: {
            'gravity': var('G3')
        },
    }
    robo.update_params('misc', params)
    return robo
Ejemplo n.º 4
0
def planar2r_numerical(is_floating=False):
    # numerical values (random in some case)
    L1 = 0.5
    L2 = 0.4
    ZZ1 = 3.7
    ZZ2 = 0.35
    MX2 = 0.4
    MY2 = 0.15
    M1 = 1.2
    M2 = 0.8
    FC1 = 0.3
    FC2 = 0.25
    FV1 = 0.3
    FV2 = 0.18
    IA1 = 0.0
    IA2 = 0.0
    G3 = -9.81
    # create robot
    robo = Robot('planar2r',
                 2,
                 2,
                 3,
                 is_floating,
                 tools.SIMPLE,
                 is_symbolic=False)
    robo.set_dyns_to_zero()
    # update geometric params
    params = {
        1: {
            'sigma': 0,
            'mu': 1
        },
        2: {
            'sigma': 0,
            'mu': 1,
            'd': L1
        },
        3: {
            'sigma': 2,
            'd': L2
        }
    }
    robo.update_params('geos', params)
    # update dynamic params
    params = {
        1: {
            'zz': ZZ1,
            'frc': FC1,
            'frv': FV1,
            'ia': IA1,
            'mass': M1
        },
        2: {
            'zz': ZZ2,
            'frc': FC2,
            'frv': FV2,
            'ia': IA2,
            'mass': M2,
            'msx': MX2,
            'msy': MY2
        }
    }
    robo.update_params('dyns', params)
    # update joint params
    params = {0: {'qdots': 0, 'qddots': 0, 'torques': 0}}
    robo.update_params('misc', params)
    # update gravity vector
    params = {
        0: {
            'gravity': 0
        },
        1: {
            'gravity': 0
        },
        2: {
            'gravity': G3
        },
    }
    robo.update_params('misc', params)
    return robo