Hi all,
I have been using the FreePostureMove model in Repository 7 and have
noticed that when I load the model, the global pelvis orientation is
not correct (or rather does not match what I enter in the
mannequin.any file). When I Run setInitialConditions or an analysis,
the model becomes aligned with the values I entered into the
mannequin.any file. This also happens with the Neck Extension angle
as well.
The reason I think is due to the InitialPositionsValue.any file. In
the code:
//I have commented out the original lines and replaced them with
values that I think are correct
AnyFolder InitialPositionValues={
AnyFolder Posture ={
AnyVector PelvisPos= …JointPos.PelvisGroundFunction
(Main.Study.tStart);
AnyVar PelvisPosX=PelvisPos[0];
AnyVar PelvisPosY=PelvisPos[1];
AnyVar PelvisPosZ=PelvisPos[2];
//AnyVar PelvisRotX=PelvisPos[3];
//AnyVar PelvisRotY=PelvisPos[4];
//AnyVar PelvisRotZ=PelvisPos[5];
AnyVar PelvisRotX=(180/pi)*PelvisPos[5];//3 (original)
AnyVar PelvisRotY=(180/pi)*PelvisPos[4];//4 (original)
AnyVar PelvisRotZ=(180/pi)*PelvisPos[3];//5 (original)
In the original version, the pelvisRot values were not multiplied by
180/pi to get those values back into degrees. In my code, the
PelvisRotX values are then used in the Body model code
(Trunk.InitialPositionPelvis.any), which is:
SegmentsLumbar.PelvisSeg.r0 =
{JointPos.PelvisPosX,JointPos.PelvisPosY,JointPos.PelvisPosZ};
SegmentsLumbar.PelvisSeg.Axes0=
RotMat((pi/180)JointPos.PelvisRotZ ,z)
RotMat((pi/180)JointPos.PelvisRotY ,y)
RotMat((pi/180)*JointPos.PelvisRotX ,x);
Which suggests that the PelvisRot values have to be in degrees. But
they aren’t because in the PelvisGroundFunction, they are conveted
back into radians.
Also I believe the order used in assigning the PelvisRot values from
the JointPos.PelvisGroundFunction was incorrect (since the rotations
are z,y,x).
Let me know if I am missing something and/or if you are not able to
replicate the issue.
Best,
David