Problem with Kinematics Transformation

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Luca Tagliapietra
Posts: 2
Joined: Fri Sep 21, 2012 4:09 am

Problem with Kinematics Transformation

Post by Luca Tagliapietra » Mon Feb 04, 2013 9:53 am

Hi guys,
I'm quite new in using OpenSim and I have a problem with the point kinematics tool.
- The goal:
My main goal is to validate a new approach in the estimation of joints' angles. 

- The procedure:
To validate my approach I need to:
a. apply the angles computed with my approach to the OpenSim model
b. at each time step, store the absolute position of virtual markers 
c. compare the positions of virtual markers from point b. to the positions of real markers recorded in our motion lab.

- The problem:
I've tried to collect this information using OpenSim APIs either using the point kinematics tool or writing some C++ code. 
Both ways I got data that are quite different from the positions in the real markers data file (.c3d or .trc). 

To my knowledge, I should have recorded the markers positions with respected to the ground system of reference. But as they are different something must be wrong.
 
- The questions:
a. Is there a hidden transformation between the ground and the motion lab system of reference that I'm not aware of? I'm asking because if I add a new virtual marker using the position of a real marker the GUI shows it in a wrong position.
b. If this transformation exists, how can I get its parameters?
c. If I'm totally wrong about the hidden transformation, any suggestions on how to have meaningful values for virtual markers' positions?

Thank you in advance for your help,
Luca

P.S.: In the following the lines of code I'm using:

Code: Select all

myModelNew.getMultibodySystem().realize(myState, SimTK::Stage::Position);

for(unsigned int i=0; i<modelMarkerSet.getSize();i
  index = modelMarkerSet.getIndex(names[i],index); 
  if (index >=0){ 
    OpenSim::Marker& marker = modelMarkerSet[index]; 
    const SimTK::MobilizedBody& mobod =myModelNew.getMatterSubsystem()
			.getMobilizedBody(marker.getBody().getIndex()); 
    const SimTK::Transform& X_GB = mobod.getBodyTransform(myState); 
    std::cout << X_GB*marker.getOffset()<<"  "<<names[i] << std::endl; 
  } 
}

User avatar
Ayman Habib
Posts: 2252
Joined: Fri Apr 01, 2005 12:24 pm

Re: Problem with Kinematics Transformation

Post by Ayman Habib » Mon Feb 04, 2013 11:10 am

Hi Luca,

If I understand you correctly what you're trying to do is solve Inverse-Kinematics using your own algorithm.

There are no hidden transformations between the model and ground, however there's a free-joint that allows the model to move with respect to ground. The names of the coordinates for this free joint differ from one model to another so take a look at the provided gait model (gait2354_simbody, coordinates pelvis_*) and the sample data/IK-solution provided with the distribution for an example and let me know if you continue to have questions.

Best regards,
-Ayman

POST REPLY