Announcement

Collapse
No announcement yet.

Code for the CODA pelvis in Vicon BodyBuilder

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Code for the CODA pelvis in Vicon BodyBuilder

    Hi,

    I’m new around here so hope I’m posting this in the correct section.

    I’m using Vicon Bodybuilder to build a model of the lower limbs. I’m trying to write in BodyLanguage code to define the pelvis using the CODA method, which defines the pelvis segment origin as the mid-point between ASIS markers and the hip joint centres as:

    RightHipJC=(0.36*ASIS Distance,-0.19*ASIS Distance,-0.3*ASIS Distance)
    LeftHipJC=(-0.36*ASIS Distance,-0.19*ASIS Distance,-0.3*ASIS Distance)

    My BodyLanguage code so far is:

    Code:
    PelvisOrigin=(RASIS+LASIS)/2
    Sacrum=(RPSIS+LPSIS)/2
    Pelvis=[PelvisOrigin,(RASIS-PelvisOrigin),(Sacrum-PelvisOrigin),xzy]
     
    InterAsisDist=DIST(LASIS,RASIS)
    LHJC=PelvisOrigin+{(0.19*InterAsisDist),(-0.36*InterAsisDist),(-0.3*InterAsisDist)}
    RHJC=PelvisOrigin+{(0.19*InterAsisDist),(0.36*InterAsisDist),(-0.3*InterAsisDist)}
    Output(LHJC,RHJC)
    The issue I’m having is that the vector I’m adding to the pelvis origin (i.e. {(0.19*InterAsisDist),(-0.36*InterAsisDist),(-0.3*InterAsisDist)} ) is relative to the global coordinate system, not the local coordinate system of the pelvis. This is a problem when the pelvis rotates; the hip joint centres do not rotate with it!

    Can anyone help re how to apply the rotation of the pelvis in the above coding, or how to define the hip joint centres relative to the pelvis coordinate frame instead of the global. Any ideas are greatly appreciated!

  • #2
    Re: Code for the CODA pelvis in Vicon BodyBuilder

    Originally posted by Alex Bates View Post
    Hi,

    I’m new around here so hope I’m posting this in the correct section.

    I’m using Vicon Bodybuilder to build a model of the lower limbs. I’m trying to write in BodyLanguage code to define the pelvis using the CODA method, which defines the pelvis segment origin as the mid-point between ASIS markers and the hip joint centres as:

    RightHipJC=(0.36*ASIS Distance,-0.19*ASIS Distance,-0.3*ASIS Distance)
    LeftHipJC=(-0.36*ASIS Distance,-0.19*ASIS Distance,-0.3*ASIS Distance)

    My BodyLanguage code so far is:

    Code:
    PelvisOrigin=(RASIS+LASIS)/2
    Sacrum=(RPSIS+LPSIS)/2
    Pelvis=[PelvisOrigin,(RASIS-PelvisOrigin),(Sacrum-PelvisOrigin),xzy]
     
    InterAsisDist=DIST(LASIS,RASIS)
    LHJC=PelvisOrigin+{(0.19*InterAsisDist),(-0.36*InterAsisDist),(-0.3*InterAsisDist)}
    RHJC=PelvisOrigin+{(0.19*InterAsisDist),(0.36*InterAsisDist),(-0.3*InterAsisDist)}
    Output(LHJC,RHJC)
    The issue I’m having is that the vector I’m adding to the pelvis origin (i.e. {(0.19*InterAsisDist),(-0.36*InterAsisDist),(-0.3*InterAsisDist)} ) is relative to the global coordinate system, not the local coordinate system of the pelvis. This is a problem when the pelvis rotates; the hip joint centres do not rotate with it!

    Can anyone help re how to apply the rotation of the pelvis in the above coding, or how to define the hip joint centres relative to the pelvis coordinate frame instead of the global. Any ideas are greatly appreciated!

    Hi Alex,

    What you need to do is to define your HJCs in the Pelvic coordinate system and then transform them to the global. Luckily, BodyBuilder makes this easy by providing allowing the * and / operators to be used to transform a point from a segment's local coordinates to global, and vice versa. You could modify your code as follows:
    Code:
    LHJC={(0.19*InterAsisDist),(-0.36*InterAsisDist),(-0.3*InterAsisDist)}*Pelvis
    RHJC={(0.19*InterAsisDist),(0.36*InterAsisDist),(-0.3*InterAsisDist)}*Pelvis
    Output(LHJC,RHJC)
    Hope this helps!

    Regards,
    Lasse

    Comment


    • #3
      Re: Code for the CODA pelvis in Vicon BodyBuilder

      Ah perfect! Thank you!

      Comment

      Working...
      X