Best option to manually set pelvic tilt

Hi Soren,

Okay, I think I understand now what you suggested to do with the Skript you posted earlier.
I'll use sRel coordinates to calculate my Pevlic Tilt angle. How do i write tan^-1 in Anybody?
Also Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg.RASIS.sRel is a vector. How do I only get the X or Y value?
For example:
AnyVar MyTrigometricCalculation = tan^-1( ASIS.sRel.X - PSIS.sRel.X / ASIS.sRel.Y - PSIS.sRel.Y ) how would I write this in Anybody?

Best regards
Christian

Hi Christian,

If you see the class list visible in the tab placed at right side of the screen, you can see a list of all functions available, "atan" is also there.


AnyVar MyTrigometricCalculation = atan( ASIS.sRel[0] - PSIS.sRel[0] / ASIS.sRel[1] - PSIS.sRel[1] );

Hope it helps

Best regards
Søren

Hi Soren,

Thanks for the help. I can control the Pelvic Tilt now and return its angle.

My question now is, where the best place would be to place the "AnyOperationSetValue ChangePelvicTilt" function.
The way my simulations work, is that first I'm running a static trial and run the RunParameterIdentification. Afterwards I have two activities namely the one leg stance and level walking which will run the RunAnalysis which includes the SubStudy LoadParameter. LoadParameter will load the Parameter which were identified in the static trial. The idea is that the parameter only have to be determined once and stay the same for different trials. I want to run this simulation with a macro for 10 human models and 5 different pelvic tilts.
Where would be the best place to include the "AnyOperationSetValue ChangePelvicTilt"? Could I include it in the RunAnalysis between RunAnalysis.LoadParameter and RunAnalysis.MarkerTracking?

Best regards
Christian

Hi Christian,

Yes i think this will be the right location for it

Best regards
Søren

Hi Soren,

Thank you so far. Your posts have helped me a lot.

I have a different problem now but I will post it in this thread so that you already know the topic I am working on.
The Anybody model works and I can control the pelvic tilt and have implemented the ChangePelvicTilt in the MainAnalysis. Now i want to control the Simulation with a macro in Matlab, so that it will run through my different pelvic tilt values automatically. The parameter Identification works without any problems and in my MainAnalysis simulation all positive pelvic tilt values are working but not my negative pelvic tilt values.
This error occurs when it tries to run a negative Pelvic_Tilt value and happens when it tries to load the model for my dynamic simulation.

I run the Pelvic tilts with a for loop and this following matlab code:
PELVIC_TILT is an array with all the pelvic tilt values I want to analyse.


The last line is line 14 in ChangePelvicTilt:

Thank you in advance

Hi Christian,

I think the problem is the "="

It should be

/def PELVIC_TILT -6

To test i made this very simple model

#define Tilt  -6

Main = {
AnyVar test = atan(Tilt);
};

It works but this will not

#define Tilt  = -6

Main = {
AnyVar test = atan(Tilt);
};

Which makes sense because it is essentially like writing

AnyVar test = atan(=-6);

Best regards
Søren

Hi Soren,

I modified my Matlab code like you suggested. I tried it once with a space in between and once without.
This is without space in between:


So my Macro for Pelvic Tilt looks like this:
Bildschirmfoto 2020-05-25 um 21.50.05

This following errors occurs when I try to run it. It happens during the kinematic analysis.

#### Macro command : mcr(1:1)> classoperation Main.ModelSetup.Views.KinematicView"Set View"
2.0.1.0.0.2) ...Kinematic analysis completed.
2.0.1.0.0.3) ...Dependent variables are fully updated.
2.0.1.0) Kinematic analysis...
Progressing to solve kinematic optimality conditions and hard constraints.
Progressing to solve kinematic optimality conditions and hard constraints.
Progressing to solve kinematic optimality conditions and hard constraints.
Progressing to solve kinematic optimality conditions and hard constraints.
Failed to solve kinematic optimality conditions and hard constraints after 5 fallback attemps.
Constraint violations for study 'Main.Studies.MarkerTracking' : 
Constraint #3 is above tolerance 1e-06, error = 0.000001, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.L5SacrumJnt.Constraints'.
Constraint #4 is above tolerance 1e-06, error = 0.000005, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.L5SacrumJnt.Constraints'.
Constraint #7 is above tolerance 1e-06, error = 0.000002, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.L4L5Jnt.Constraints'.
Constraint #10 is above tolerance 1e-06, error = 0.000003, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.L3L4Jnt.Constraints'.
Constraint #12 is above tolerance 1e-06, error = 0.000002, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.L2L3Jnt.Constraints'.
Constraint #13 is above tolerance 1e-06, error = 0.000004, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.L2L3Jnt.Constraints'.
Constraint #14 is above tolerance 1e-06, error = 0.000002, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.L2L3Jnt.Constraints'.
Constraint #15 is above tolerance 1e-06, error = 0.000003, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.L1L2Jnt.Constraints'.
Constraint #16 is above tolerance 1e-06, error = 0.000004, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.L1L2Jnt.Constraints'.
Constraint #17 is above tolerance 1e-06, error = 0.000003, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.L1L2Jnt.Constraints'.
Constraint #18 is above tolerance 1e-06, error = 0.000004, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.T12L1Jnt.Constraints'.
Constraint #19 is above tolerance 1e-06, error = 0.000005, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.T12L1Jnt.Constraints'.
Constraint #20 is above tolerance 1e-06, error = 0.000004, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.JointsLumbar.T12L1Jnt.Constraints'.
Constraint #39 is above tolerance 1e-06, error = 0.000005, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.T1C7Jnt.Constraints'.
Constraint #40 is above tolerance 1e-06, error = 0.000005, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.T1C7Jnt.Constraints'.
Constraint #41 is above tolerance 1e-06, error = 0.000004, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.T1C7Jnt.Constraints'.
Constraint #42 is above tolerance 1e-06, error = 0.000004, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C7C6Jnt.Constraints'.
Constraint #43 is above tolerance 1e-06, error = 0.000003, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C7C6Jnt.Constraints'.
Constraint #44 is above tolerance 1e-06, error = 0.000004, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C7C6Jnt.Constraints'.
Constraint #45 is above tolerance 1e-06, error = 0.000004, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C6C5Jnt.Constraints'.
Constraint #46 is above tolerance 1e-06, error = 0.000004, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C6C5Jnt.Constraints'.
Constraint #47 is above tolerance 1e-06, error = 0.000005, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C6C5Jnt.Constraints'.
Constraint #48 is above tolerance 1e-06, error = 0.000004, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C5C4Jnt.Constraints'.
Constraint #49 is above tolerance 1e-06, error = 0.000004, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C5C4Jnt.Constraints'.
Constraint #50 is above tolerance 1e-06, error = 0.000005, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C5C4Jnt.Constraints'.
Constraint #51 is above tolerance 1e-06, error = 0.000004, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C4C3Jnt.Constraints'.
Constraint #52 is above tolerance 1e-06, error = 0.000004, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C4C3Jnt.Constraints'.
Constraint #53 is above tolerance 1e-06, error = 0.000005, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C4C3Jnt.Constraints'.
Constraint #54 is above tolerance 1e-06, error = 0.000004, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C3C2Jnt.Constraints'.
Constraint #55 is above tolerance 1e-06, error = 0.000003, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C3C2Jnt.Constraints'.
Constraint #56 is above tolerance 1e-06, error = 0.000005, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C3C2Jnt.Constraints'.
Constraint #62 is above tolerance 1e-06, error = 0.000108, constr. #0 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C1C0Jnt.Constraints'.
Constraint #63 is above tolerance 1e-06, error = 0.000633, constr. #1 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C1C0Jnt.Constraints'.
Constraint #64 is above tolerance 1e-06, error = 0.000071, constr. #2 in 'Main.HumanModel.BodyModel.Trunk.JointsCervicalSpine.C1C0Jnt.Constraints'.
Constraint #84 is above tolerance 1e-06, error = 0.000001, constr. #0 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.Ankle.Constraints'.
Constraint #92 is above tolerance 1e-06, error = 0.000029, constr. #3 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.SubTalar.Constraints'.
Constraint #93 is above tolerance 1e-06, error = 0.000003, constr. #4 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.SubTalar.Constraints'.
Constraint #94 is above tolerance 1e-06, error = 0.000003, constr. #0 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.Knee.Constraints'.
Constraint #95 is above tolerance 1e-06, error = 0.000002, constr. #1 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.Knee.Constraints'.
Constraint #97 is above tolerance 1e-06, error = 0.000020, constr. #3 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.Knee.Constraints'.
Constraint #98 is above tolerance 1e-06, error = 0.000005, constr. #4 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.Knee.Constraints'.
Constraint #99 is above tolerance 1e-06, error = 0.000003, constr. #0 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.PatellaFemur.Constraints'.
Constraint #102 is above tolerance 1e-06, error = 0.000022, constr. #3 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.PatellaFemur.Constraints'.
Constraint #103 is above tolerance 1e-06, error = 0.000003, constr. #4 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.PatellaFemur.Constraints'.
Constraint #105 is above tolerance 1e-06, error = 0.000164, constr. #0 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.Hip.Constraints'.
Constraint #106 is above tolerance 1e-06, error = 0.000038, constr. #1 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.Hip.Constraints'.
Constraint #107 is above tolerance 1e-06, error = 0.000052, constr. #2 in 'Main.HumanModel.BodyModel.Right.Leg.Jnt.Hip.Constraints'.
Constraint #111 is above tolerance 1e-06, error = 0.000002, constr. #3 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.Ankle.Constraints'.
Constraint #116 is above tolerance 1e-06, error = 0.000009, constr. #3 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.SubTalar.Constraints'.
Constraint #117 is above tolerance 1e-06, error = 0.000003, constr. #4 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.SubTalar.Constraints'.
Constraint #118 is above tolerance 1e-06, error = 0.000001, constr. #0 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.Knee.Constraints'.
Constraint #121 is above tolerance 1e-06, error = 0.000006, constr. #3 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.Knee.Constraints'.
Constraint #122 is above tolerance 1e-06, error = 0.000002, constr. #4 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.Knee.Constraints'.
Constraint #126 is above tolerance 1e-06, error = 0.000001, constr. #3 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.PatellaFemur.Constraints'.
Constraint #127 is above tolerance 1e-06, error = 0.000007, constr. #4 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.PatellaFemur.Constraints'.
Constraint #129 is above tolerance 1e-06, error = 0.000161, constr. #0 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.Hip.Constraints'.
Constraint #130 is above tolerance 1e-06, error = 0.000030, constr. #1 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.Hip.Constraints'.
Constraint #131 is above tolerance 1e-06, error = 0.000078, constr. #2 in 'Main.HumanModel.BodyModel.Left.Leg.Jnt.Hip.Constraints'.
Constraint #306 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg'.
Constraint #307 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.SacrumSeg'.
Constraint #308 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.L5Seg'.
Constraint #309 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.L4Seg'.
Constraint #310 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.L3Seg'.
Constraint #311 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.L2Seg'.
Constraint #312 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.L1Seg'.
Constraint #313 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsThorax.SkullSeg'.
Constraint #314 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsThorax.ThoraxSeg'.
Constraint #315 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsCervicalSpine.C1Seg'.
Constraint #316 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsCervicalSpine.C2Seg'.
Constraint #317 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsCervicalSpine.C3Seg'.
Constraint #318 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsCervicalSpine.C4Seg'.
Constraint #319 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsCervicalSpine.C5Seg'.
Constraint #320 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsCervicalSpine.C6Seg'.
Constraint #321 is above tolerance 1e-06, error = 0.000604, segment constr. 'Main.HumanModel.BodyModel.Trunk.SegmentsCervicalSpine.C7Seg'.
Constraint #322 is above tolerance 1e-06, error = 0.000023, segment constr. 'Main.HumanModel.BodyModel.Right.Leg.Seg.Talus'.
Constraint #323 is above tolerance 1e-06, error = 0.000041, segment constr. 'Main.HumanModel.BodyModel.Right.Leg.Seg.Foot'.
Constraint #324 is above tolerance 1e-06, error = 0.000023, segment constr. 'Main.HumanModel.BodyModel.Right.Leg.Seg.Shank'.
Constraint #325 is above tolerance 1e-06, error = 0.000050, segment constr. 'Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh'.
Constraint #326 is above tolerance 1e-06, error = 0.000025, segment constr. 'Main.HumanModel.BodyModel.Right.Leg.Seg.Patella'.
Constraint #327 is above tolerance 1e-06, error = 0.000009, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Talus'.
Constraint #328 is above tolerance 1e-06, error = 0.000012, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Foot'.
Constraint #329 is above tolerance 1e-06, error = 0.000008, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Shank'.
Constraint #330 is above tolerance 1e-06, error = 0.000016, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Thigh'.
Constraint #331 is above tolerance 1e-06, error = 0.000008, segment constr. 'Main.HumanModel.BodyModel.Left.Leg.Seg.Patella'.
ERROR(OBJ.MCH.KIN3) :   D:\Users\christian.ye\ammr\Tools\AnyMocap\AnyMocapModel.any(41)  :   'MarkerTracking.Kinematics'  :  Kinematic analysis failed in time step 57 : Position analysis is not completed


#### Macro command > exit

And this time with space in between just like in your post:

with the following macro:
/def PELVIC_TILT -6

I end up with a similar error like the first try when I put in the equal to sign. As you can see in the macro command: the other parameters work fine with the equal sign just as simulations with positive pelvic tilt variables. It somehow only appears when I use negative pelvic tilt variables. If I directly run the simulations in AnyBody I don't experience any errors with /def PELVIC_TILT -6. I'm not sure yet if this error is due to Matlab or AnyBody.

#### Macro command > load "Subjects\H1L\one_leg_stance\H1L_060511_1_24\H1L_060511_1_24.main.any" /def BM_LEG_MODEL=2 /def SUBJECT_SPECIFIC_ADAPTION=2 /def MARKER_SETUP=2 /def MUSCLE_RECRUITMENT=3 /def BM_LEG_MUSCLES_BOTH=1 /def BM_LEG_STRENGTH_INDEX=1 /def PELVIC_TILT -6  
Loading  Main  :  "D:\Users\christian.ye\AB_OL_HJF_Validation\Subjects\H1L\one_leg_stance\H1L_060511_1_24\H1L_060511_1_24.main.any" 
Scanning... 
Warning : arguments has no effect : 
  -6
  
Parsing... 
ERROR(SCR.PRS11) :   D:\Users\christian.ye\AB_OL_HJF_Validation\Setup\ChangePelvicTilt.any(11)  :   '*' unexpected 
Model loading skipped 
 
#### Macro command > operation Main.RunAnalysis  
Error : Main.RunAnalysis : Unresolved object. 
 
#### Macro command > run  
Error : run : command unexpected while operation is not selected. 
 
#### Macro command > exit

Hi Christian,

Some comments

Idential models running from Matlab or through AMS GUI must give same results/behaviour otherwise it is a sign that the defines are not accounted for in the same way in the two models.

I do not initially understand that the model will load with the statement. "/def PELVIC_TILT-6" but i made this small model to test it

Main ={
  #define pelvictilt1 -6
  AnyVar test1 =atan(pelvictilt1);
  
  #define pelvictilt2-6
  AnyVar test2 =atan(pelvictilt2);

};

it will give same results for test1 and test2 meaning that AnyBody automatically splits with the "-"
so this explains why you get same results with and without space.

The kin error you get is a sign of that the solver can not solve the kinematic problem, and as i said you must see the same in the GUI version.

I would try somehow to check that the def's from Matlab is indeed doing what you think they are, though i am not sure how

Best regards
Søren

Hi Soren,

I bypassed the problem by just adding every angle with 90 degrees and subtracting them later in Anybody.
But I would like to verify the pelvic tilts after the simulation and the following script allows me to check several segment lengths of my model in a .csv data.

Main.Studies.InverseDynamicStudy= {
  // Output *.csv file containing only the variables of interest 
  // as *.h5-files can get very large and most data is not needed anymore.
  // *.csv-file can be opened with text editor or MATLAB.
  AnyOutputFile SaveSegmentLength = {
    
    AnyString FileNameString = 
      "_TLEM" + strval(BM_LEG_MODEL)
	+ "_SSA" + strval(SUBJECT_SPECIFIC_ADAPTION)
    + "_MARKER" + strval(MARKER_SETUP)
    + "_PelvicTilt" + strval(PELVIC_TILT-90);
    
    FileName = "../Output/SegmentLengths/" + Main.ModelSetup.TrialSpecificData.TrialName + FileNameString + ".csv";
    
    NumberFormat.Digits = 10;
    NumberFormat.Style = DecimalNumber;
    
    Header.TitleSectionOnOff = Off;
    Header.ConstSectionOnOff = Off;
    Header.ConstSectionSaveOptionsOnOff = Off;
    // Separation sign for columns and lines   
    SepSign = ";";
    LineSepSign = ";";
        
    // Variables to be saved, one variable in one column, first column is time t:
    AnyFloat CervicalSpineLength = .BodyModel.CervicalSpineLength.Pos;
    AnyFloat ThoracalSpineLength = .BodyModel.ThoracalSpineLength.Pos;
    AnyFloat LumbarSpineLength = .BodyModel.LumbarSpineLength.Pos;
    AnyFloat HipJointWidth = .BodyModel.HipJointWidth.Pos;
    AnyFloat RightThighLength = .BodyModel.RightThighLength.Pos;
    AnyFloat RightShankLength = .BodyModel.RightShankLength.Pos;
    AnyFloat LeftThighLength = .BodyModel.LeftThighLength.Pos;
    AnyFloat LeftShankLength = .BodyModel.LeftShankLength.Pos;
    AnyFloat PelvicTilt = .BodyModel.PelvicTiltVerification.RealPelvicTiltAngle;
 
  };
  
};

//End

I have added the Pelvic tilt angle also. Somehow Pelvic Tilt doesn't appear in my .csv files. But it is visible in model tree though:


My first impression was that the mistake was that my pelvic tilt was not saved as a vector which I changed afterward but I still have the same problem.

Hi Christian,

I think the problem is that the pelvic tilt is considered a constant and then it is not part of the output.

You can trick it to become part of the output e.g. like this

AnyVar PelvicTilt = Main.MyStudy.t*0+ .BodyModel.PelvicTiltVerification.RealPelvicTiltAngle;

Best regards
Søren

Hello Soren,

I have a few more questions. In order for me to set and calculate the pelvic tilt, I need the coordinates of the actual bony landmarks: PSIS, ASIS. For RPSIS for example I took this sRel value:

Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg.Right.PSIS.sRel

and not

Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg.RPSIS.sRel

because I believe the second option skin marker positions. How can I very which markers I am actually using in the model view?
I tried using model view -> this object -> select/show , but couldn't see any changes in the model view.

Hi Christian,

If you try to select the last option "RefFrames " and then select show you should get a blue coordinate system in the node you have selected.

Best regards
Søren

Hi Soren,

Thank you for your post.

I want to know if there is any way to determine the pelvic tilt on the basis of

Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg.Axes

transformed into an Euler matrix and check the pelvic tilt angle this way?
I want to verify my method with the tangents because I am getting strange results and I think my method is erroneous.

Also, I am saving all my the pelvic tilt angle in a .csv files as shown in the images below:



These are the values for my pelvic tilt angle calculated by the tangents function:

AnyVector Bones_RealPelvicTiltAngle_r = {atan((Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg.Right.PSIS.r[2] - Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg.Right.ASIS.r[2])/(Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg.Right.ASIS.r[0] - Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg.Right.PSIS.r[0]))*(180/pi)};

For the very first value -42490118807, for example, the pelvic tilt is -4,2490118807 but it saves it without the decimal point. I have the feeling that it saves all the values below -1 degree with a decimal point but not the other ones. Is there a way to fix this and how come it ends up like this?

Hi Christian,

You can introduce an AnyKinRotational object to measure angles, check ref. manual.

Regarding formatting - most likely the problem is not in writing, but in reading the file by Excel, which chooses to interpret the data this way (there are settings how to read numbers). Try opening the file in NotePad++ or other raw text editor to see what is written originally.
That said you can manipulate number format from AnyBody as well. Press F1 on AnyOutputFile and read about NumberFormat member.

Regards,
Pavel

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.