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: 4
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:

POST REPLY