Skip to content

Computing Jacobian of the Center on Mass of the Robot #365

@dhruvthanki

Description

@dhruvthanki

Hi,

I'm trying to calculate the jacobian of the COM of the robot. Is this the right way to do it?

def jacpCOM(model, data):
    total_mass = mujoco.mj_getTotalmass(model)
    jacp_i = np.zeros((3,model.nv))
    jacp_COM = np.zeros((3,model.nv))
    for i in range(model.nbody):
        mi = model.body_mass[i]/total_mass
        mujoco.mj_jacBodyCom(model, data, jacp_i, None, i)
        jacp_COM += mi*jacp_i
    return jacp_COM

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionRequest for help or information

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions