Using getDirectionCosines

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Moe Curtin
Posts: 43
Joined: Fri Oct 02, 2009 5:40 am

Using getDirectionCosines

Post by Moe Curtin » Fri Apr 30, 2010 11:24 am

Could anyone please tell me in what order the values are returned when using getDirectionCosines and what they correspond to. I'm having trouble trying to figure it out, thanks!

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

RE: Using getDirectionCosines

Post by Ayman Habib » Mon May 03, 2010 10:15 am

Moe,

SimbodyEngine::getDirectionCosines(state,B,mtx)
Extracts from the state cache the spatial orientation R_GB of body B's body frame x, y, and z axes expressed in the Ground frame, as the Rotation matrix R_GB returned in mtx[3][3].

The sense of this rotation matrix is such that if you have a vector v fixed on body B, represented by the vector v_B expressed in the B frame, then v_G=R_GB*v_B where v_G is the same vector but re-expressed in the Ground frame.

This matrix can be later converted to BodyFixedXYZ Euler angles using the call to SimbodyEngine::convertDirectionCosinesToAngles

Hope this helps,
-Ayman

User avatar
Moe Curtin
Posts: 43
Joined: Fri Oct 02, 2009 5:40 am

RE: Using getDirectionCosines

Post by Moe Curtin » Tue May 11, 2010 9:10 am

Thanks Ayman, that worked great!

POST REPLY