Plugin Gait Axis and joint angle calculations

538 views
Skip to first unread message

연승은

unread,
Jan 28, 2014, 8:26:40 AM1/28/14
to btk-...@googlegroups.com
Hello, I'm a undergraduate student of robotics laboratory in snu.  Your program looks very interesting and I hope you can help me.  I tried looking at the experimental models cpp file for plugingait but my c++ knowledge is limited and it was overwhelming to try and understand my general questions.

I noticed in another forum you said you can mimic the output of nexus from plugin gait joint angles to a very high degree, under 0.0001.  In my work I need to get joint axis and then manipulate them, so I would like to calculate plugin gait myself.  I have done a good amount of work, but I am off by between 0.1 to 5 degrees.  When I test a sit to stand motion is when I have the biggest difference in angles.

I am wondering if you have any advice where you had followed the plugin gait documentation and then realized some other methods were missing.  For example, is the angle calculation YXZ, which I think is :
 """
    This function find the angle of rotation matrix. 
    and I calculated rotation matrix by multiply two matrix that we will compare. 
    if A is before rotate matrix and B is after rotate matrix, then rotation matrix = A * inv(B)
    The function only follow the YXZ rotate(euler Rotation).
    
   >>> INPUT: rotation matrix = rotmat = [[a,b,c],
                                                            [d,e,f],
                                                            [g,h,i]] 
   >>> OUTPUT:   beta angle is rotated angle with y-axis
                          gamma angle is rotated angle with x-axis
                         alpha angle is rotated angle with z-axis
 
                 gamma = atan2((-rotmat[2,1]),sqrt((rotmat[0,1])**2.0 + (rotmat[1,1])**2.0))
                 beta = atan2((rotmat[2,0]/cos(gamma)),(rotmat[2,2]/cos(gamma)))  
                 alpha = atan2((rotmat[0,1]/cos(gamma)),(rotmat[1,1]/cos(gamma))) 
    
                 angle = [180.0 * beta/ pi, 180.0 * gamma / pi, 180.0 * alpha / pi]

Or is it the calculation from the paper from Kadaba:

 They caclutated angle from the axis directly.
>>>INPUT : axis1 = [[a,b,c],
                               [d,e,f],
                               [g,h,i]]  
                  axis2 = [[j,k,l],
                              [m,n,o],
                              [p,q,r]]

 >>>OUTPUT :   beta = arcsin(((-axis1[2][0])*axis2y[0])+((-axis1[2][1])*axis2y[1])+((-axis1[2][2])*axis2y[2]))
                         gamma = arcsin((axis1[2][0] * axis2x[0])+(axis1[2][1] * axis2x[1])+(axis1[2][2] * axis2x[2])/cos(beta))
                        alpha = arcsin((axis1[0][0] * axis2y[0])+(axis1[0][1] * axis2y[1])+(axis1[0][2] * axis2y[2])/cos(beta))
   
        angle = [180.0 * gamma/ pi, 180.0 * beta / pi, 180.0 * alpha / pi]

I see that Mokka imports the c3d file.  I was hoping to do all of my calculations by just the ASCII file output from nexus that includes marker locations. Then manually type in the user inputs like leg length.  Do you see anything wrong with this? 

My last question is if static calibration only applies to the foot (for lower body) or does the hip and/or knee axis also go through this calibration.  

Thank you for all help you can give.

Arnaud Barré

unread,
Feb 2, 2014, 9:59:13 AM2/2/14
to btk-...@googlegroups.com
Hi,

The Euler sequence used for the joints angle is most of the time YXZ. I found only one case for the joint shoulders where the sequence is XYZ. However, PluginGait does also another thing when it computes the joint angles. It transforms some of them to be "physiological" and be able for example to compare joint angles on the left and right side.

Regarding, the relative transformation matrix, your formula might be good or not depending what is A and B and how the anatomical frame are expressed.

You can use the ASCII output from Nexus if you prefer, but there is no way after to import the results within Mokka afterwards.

The static calibration is important at different levels because it sets :
- the head angle offset
- the hip joint centres
- the foot angles offset

Last point where we still have to do some work with PiG in BTK is about the global angle. Right now, the formulas work only if the Z axis is the vertical axis. We need to improve the code when another axis is the vertical axis.

Arnaud
> --
> You received this message because you are subscribed to the Google Groups "BTK Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btk-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

연승은

unread,
Feb 2, 2014, 8:24:19 PM2/2/14
to btk-...@googlegroups.com
Hello Arnaud,

Thank you for the response.  When you say 'physiological' do you mean that the sign changes so that flexion is positive, or there is something more being changed?

Does mokka use the static calibration from nexus or can it calculate the static itself.  I ask since the other post you mentioned btk can be free from mocap systems and that your plugin gait is very accurate, so is that from btk calculating the static offsets or using the ones defined in vsk? 

I never saw in the plugin gait documentation that hip joint center was calculated in static, do you have the reference to it for me? It seems like if the person is moving the hip joint center must be moving, or are you saying it is an angle offset that is calculated similar to foot?

Thank you,

Seung-eun


2014년 2월 2일 일요일 오후 11시 59분 13초 UTC+9, Arnaud BARRE 님의 말:

Arnaud Barré

unread,
Feb 2, 2014, 10:42:00 PM2/2/14
to btk-...@googlegroups.com
Maybe my guesses are wrong (I never used the documentation of Vicon as it is copyrighted), but some angles like for the shoulders or the ankles are reordered to start with the flexion, then abduction and internal rotation.

Mokka does not yet support the computation of biomechanical models.What we have done (and still working on it) is to create the module "Models" for BTKCore. However, there is no plan to integrate it into Mokka. Regarding the offsets, they are computed by our code. We never use the VSK file for that.

The computation of the hip joint centre in the PluginGait model is based on the paper "A gait analysis data collection and reduction technique" by Davis et al, 1991 (Human Movement Sciences, 575-587).

연승은

unread,
Feb 2, 2014, 11:43:48 PM2/2/14
to btk-...@googlegroups.com
Thank you for the fast response.  I am a little confused what mokka is doing, since i can open c3d file of someone walking, and then load a model of the vsk, mokka outputs almost exactly the same angles as nexus.  But if you are not using the vsk offsets, how can you calculate them with no static pose?

If the Models for BTKCore is not integrated into Mokka, what do I see when I load my vsk and c3d file and get the model outputs of joint angles?

Thank you :)

2014년 2월 3일 월요일 오후 12시 42분 0초 UTC+9, Arnaud BARRE 님의 말:

Patrick Salvia

unread,
Feb 3, 2014, 2:29:05 AM2/3/14
to btk-...@googlegroups.com
Hi Arnaud and All,

For the Shoulder, movements may be viewed as Bone or Joint rotations as explained by Frans Van der Helm in the draft of the ISB Shoulder Group. The Static is not need to compute angles( offsets). All segments (coordinate systems) are expressed in the thorax and after we can applied Joint angle computation using Euler or other parameterizations. ISB convention propose some sequences but you can used other as ZXY for humero thoracic (Bone rotation ) or glenohumeral joint( Joint rotation). Trunk is computed relative to the global or the pelvis. I can try to use P&G for shoulder on my data. I send als a file (C3D) exemple produced by our like CAST approach. You can see the results in Mokka with the mvc configuration file. In the file , some landmarks are real markers . Other are virtually registered on local technical frames. Markers obtained by a double calibration of the scapula are shown (LSIA90).

Hope this may help you!


Have a good day or night,

Patrick

Envoyé : lundi 3 février 2014 04:42
À : btk-...@googlegroups.com
Objet : Re: [btk-users] Plugin Gait Axis and joint angle calculations
LR_SHOULDER_STATIC2_BOTH_Shoulder_Model_S12_SMTH_Session12.C3D
LR_SHOULDER_ABD_BEST_BOTH_Shoulder_Model_S12_SMTH_Session12.C3D
ShoulderTOT.mvc

연승은

unread,
Feb 3, 2014, 2:40:10 AM2/3/14
to btk-...@googlegroups.com
Hi Patrick and Arnaud,

Thank you for the information.  Unfortunately I am still stuck on understanding the pelvis.  I have read the article R.B.Davis et al. and just went through it again.  It states that the pelvic coordinate system is constructed from the three-dimensional location vectors of teh three pelvic markers.  Later is says the hip center location relative to the origin of the pelvic embedded coordinate system.  I do not see anywhere about an offset being applied.  I also do not understand how the offset would be calculated since the pelvis is always defined by the pelvic markers, and the hip is based off of the pelvis.  Do you have any insight to this?

Thank you

2014년 2월 3일 월요일 오후 4시 29분 5초 UTC+9, Patrick SALVIA 님의 말:

Patrick Salvia

unread,
Feb 3, 2014, 3:00:34 AM2/3/14
to btk-...@googlegroups.com

Hi Seung-eun,

Davis use regression equations  to define the hip joint center based on morphometry of the pelvis. Several methods may be used to compute this center (regression or functional) .

 

Best regards

 

Patrick

 

De : btk-...@googlegroups.com [mailto:btk-...@googlegroups.com] De la part de ???
Envoyé : lundi 3 février 2014 08:40

연승은

unread,
Feb 3, 2014, 3:41:46 AM2/3/14
to btk-...@googlegroups.com
Hi Patrick,

Are you talking about the page in which Davis describes the value of C to be 0.115Lleg - 0.0153 and C is the leg length over time of the static frames?  Then C would be a static value in calculating Xh Yh and Zh and not an angle offset as in the foot?  If not, could you point me in the direction you found the regression information as I can not find it :(

Thank you
Reply all
Reply to author
Forward
0 new messages