Page 1 of 1

Using getDirectionCosines

Posted: Fri Apr 30, 2010 11:24 am
by moecurtin
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!

RE: Using getDirectionCosines

Posted: Mon May 03, 2010 10:15 am
by aymanh
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

RE: Using getDirectionCosines

Posted: Tue May 11, 2010 9:10 am
by moecurtin
Thanks Ayman, that worked great!