Questions about inverse dynamics and joint frames

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Mohsen Alizadeh Noghani
Posts: 5
Joined: Mon Sep 19, 2022 10:09 am

Questions about inverse dynamics and joint frames

Post by Mohsen Alizadeh Noghani » Fri Jan 24, 2025 6:32 pm

Hi. I have two questions.

1- Which frame are the moments obtained from the inverse dynamics solution expressed in?

Currently, I believe it is the joint's child frame. For instance, in Rajagopal's 2016 model, the ankle_r moment is expressed in its child frame, talus_r_offset. Is this correct?


2- Given a model and name of the joint (e.g., 'ankle_r') the code snippet below correct for obtaining the transformation between the ground frame and a joint's child frame (using the MATLAB API)?

Thanks!

Code: Select all

        
        
        R = NaN(3,3);
        T = NaN(3,1);

        joint = model.getJointSet().get(joint_name);

        % Per OpenSim convention, I believe joint momemnets are described in
        % the child frame. E.g., talus_r_offset for ankle_r.

        childFrame = joint.getChildFrame;
        % Equivalently, childFrame = joint.get_frames(1);

        jointTransform = childFrame.getTransformInGround(state);
        jointRotationMatrix = jointTransform.R();
        jointTranslationVec = jointTransform.T();

        for i=1:3
            for j=1:3

                R(i,j) = jointRotationMatrix.get(i-1,j-1);

            end

            T(i) = jointTranslationVec.get(i-1);
            
	end


Tags:

User avatar
Nicholas Bianco
Posts: 1073
Joined: Thu Oct 04, 2012 8:09 pm

Re: Questions about inverse dynamics and joint frames

Post by Nicholas Bianco » Mon Feb 03, 2025 7:14 pm

Hi Mohsen,

Inverse dynamics moments are not expressed in any frame, they are "generalized" (or "mobility") forces. Only spatial forces (e.g., three torques and three forces) can be expressed in a frame.

You can use Joint::calcEquivalentSpatialForce() to convert mobility forces to spatial body forces.

Best,
Nick

POST REPLY