To change the euler angles order ...

Topic: How can one the euler angles order?

About the euler angles the Manual "AnyBodyRefManual.pdf " says:

AnyKinRotational
Base Class: AnyKinMeasureReal (see p. 147)
Description:
This “kinematic measure” measures 3-D orientation/rotations. It
measures either the rotation of a single reference frame with respect
to the global frame or the relative rotation one frame,
frame ‘1’,with respect to another, frame ‘0’.
Possible rotational quantities are determined by the member Type,
which is an enum of AnyKin-RotationalType. This allows you to chose
the following quantities as output: Cardan angles (Type =
RotAxesAngles): Cardan angles measure a 3-D rotation by three angles
of planar rotation about the reference system’s axes. One should be
aware that the sequence of these rotations is important, and that any
rotation subsequent to the first is a rotation about a local axis
arising from the previous rotation(s). Typical examples of such
coordinates are Euler angles and Bryant angles, which are described
in the literature and both defined by a specific sequence of
rotations. In this class, the members Axis1, Axis2, and Axis3 can be
used to specify any particular sequence of rotations…

We consider that the concept is clear: the transition from one
coordinate system to the other is achieved by a series of two-
dimensional rotations. The rotations are performed about coordinate
system axes generated by the previous rotation step (the step-by-step
procedure). But we have doubts about the AnyBody script syntax about
this topic.

The convention we use below is that, for example, Rot (Z,Y,X), means:
Firstly we rotate RotZ about the Z axis of the initial coordinate
system (global reference system of the PELVIS, Axis XYZ). After,
about the Y’ axis of this newly generated coordinate system, a
rotation by RotY is performed, followed by a rotation by RotX about
the new X’’ axis.

We use the euler angles in the following files:

  • MannequinValuesFromModel.any (see below)
  • JointsAndDrivers.any (see below)
  • Mannequin.any (In this file we introduce the movement) (see below)
  • \BRep\Aalborg\Spine\interface.any
  • \BRep\Aalborg\Arm3D\interface.any
  • \BRep\Aalborg\Leg3D\interface.any

But, what is the file where we can consult or modify the order about
Euler Angles?
We think in “interface.any” file but we don’t sure and we don’t fully
understand the syntax of script. Does the definition of Mannequin.any
file to affect or influence in the Euler angles order?

About PELVIS:
From file: \BRep\Aalborg\Spine\interface.any

AnyKinMeasureOrg PelvisRotX ={
AnyKinRotational rot ={
AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
Type=RotAxesAngles;
};
MeasureOrganizer={2};
};
AnyKinMeasureOrg PelvisRotY ={
AnyKinRotational &ref=.PelvisRotX.rot;
MeasureOrganizer={1};
};
AnyKinMeasureOrg PelvisRotZ ={
AnyKinRotational &ref=.PelvisRotX.rot;
MeasureOrganizer={0};
};

What is its meaning? Rot (Z,Y,X)
1º Rotation: RotZ -> PelvisRotZ (flexion)
2º Rotation: RotY -> PelvisRotY (Rotation)
3º Rotation: RotX -> PelvisRotX (lateral bending)
Is it right?
If we would like to change the order (normally the rotation is the
last).
Is it sufficient to change “MeasureOrganizer” variable? for example:

AnyKinMeasureOrg PelvisRotX ={
AnyKinRotational rot ={
AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
Type=RotAxesAngles;
};
MeasureOrganizer={1};
};
AnyKinMeasureOrg PelvisRotY ={
AnyKinRotational &ref=.PelvisRotX.rot;
MeasureOrganizer={2};
};
AnyKinMeasureOrg PelvisRotZ ={
AnyKinRotational &ref=.PelvisRotX.rot;
MeasureOrganizer={0};
};

Do we have to change anything in other file?

My files are the following:

>>>>>>>>>> MannequinValuesFromModel.any

AnyFolder MannequinValuesFromModel = {

AnyFolder &FolderRef=Main.Model.HumanModel.Interface;
AnyFolder AnyFolder_Posture = {
//This controls the position of the pelvi wrt. to the global
reference frame
AnyVar AnyVar_PelvisPosX=.FolderRef.Trunk.PelvisPosX.Pos[0];
AnyVar AnyVar_PelvisPosY=.FolderRef.Trunk.PelvisPosY.Pos[0];
AnyVar AnyVar_PelvisPosZ=.FolderRef.Trunk.PelvisPosZ.Pos[0];

 //This controls the rotation of the pelvis wrt. to the global

reference frame
AnyVar AnyVar_PelvisRotX=.FolderRef.Trunk.PelvisRotX.Pos[0]
*180/pi;
AnyVar AnyVar_PelvisRotY=.FolderRef.Trunk.PelvisRotY.Pos[0]
*180/pi;
AnyVar AnyVar_PelvisRotZ=.FolderRef.Trunk.PelvisRotZ.Pos[0]
*180/pi;
…

>>>>>>>>>>>> JointsAndDrivers.any

// ************************************
// Drivers for attaching the pelvis to the global reference system
// ************************************

AnyKinEqInterPolDriver PelvisGroundDriver ={
AnyKinLinear lin ={
AnyFixedRefFrame &ref1 =…EnvironmentModel.GlobalRef;
AnySeg &ref2 =…HumanModel.Trunk.SegmentsLumbar.PelvisSeg;
};
AnyKinRotational rot ={
AnyFixedRefFrame &ref1 =…EnvironmentModel.GlobalRef;
AnySeg &ref2 =…HumanModel.Trunk.SegmentsLumbar.PelvisSeg;
Type=RotAxesAngles;
};
Data={
.JntPos.PelvisPosX,
.JntPos.PelvisPosY,
.JntPos.PelvisPosZ,
pi/180*.JntPos.PelvisRotZ,
pi/180*.JntPos.PelvisRotY,
pi/180*.JntPos.PelvisRotX
};
T=.JntPos.PelvisPosTime;

 Type=Bspline;
 BsplineOrder = 8;  // This provides smooth accelerations
 //Type=PiecewiseLinear;

 Reaction.Type={On,On,On,On,On,On};

};

>>>>>>>>>>>>>>>>>> Mannequin.any

AnyFolder Mannequin ={
AnyFolder Posture ={
AnyVector PelvisPosTime = {3.16, 3.36, 3.56, 3.76, 3.96, 4.16, 4.36,
4.56, 4.76, 4.96};
AnyVector PelvisPosX = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0};
AnyVector PelvisPosY = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0};
AnyVector PelvisPosZ = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0};
AnyVector PelvisRotTime = {3.16, 3.36, 3.56, 3.76, 3.96, 4.16, 4.36,
4.56, 4.76, 4.96};
AnyVector PelvisRotZ = {-40.37, -55.99, -69.65, -78.86, -82.19, -
82.19, -82.19, -82.19, -82.19, -82.19};
AnyVector PelvisRotX = {41.45, 53.78, 63.93, 70.34, 72.55, 72.55,
72.55, 72.55, 72.55, 72.55};
AnyVector PelvisRotY = {-35.96, -38.42, -38.33, -37.2, -36.58, -
36.58, -36.58, -36.58, -36.58, -36.58};

Thank you very much in advance.

Javier Marin.

Hi Javier,

It seems you understand well the system of the rotation sequence. Now
if you change to change this sequence for the pelvis this must be
done in the file \BRep\Aalborg\Spine\interface.any, I saw you already
located the code:

AnyKinMeasureOrg PelvisRotX ={
AnyKinRotational rot ={
AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
Type=RotAxesAngles;
};
MeasureOrganizer={2};
};
AnyKinMeasureOrg PelvisRotY ={
AnyKinRotational &ref=.PelvisRotX.rot;
MeasureOrganizer={1};
};
AnyKinMeasureOrg PelvisRotZ ={
AnyKinRotational &ref=.PelvisRotX.rot;
MeasureOrganizer={0};
};

By default the rotation sequence of Type=RotAxesAngles; is Z, Y and
X. You can change it (in X, Y, Z for example) by adding those lines
in AnyKinRotational:

AnyKinMeasureOrg PelvisRotX ={
AnyKinRotational rot ={
AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
Type=RotAxesAngles;
Axis1= x;
Axis2= y;
Axis3= z;
};
MeasureOrganizer={0};
};
AnyKinMeasureOrg PelvisRotY ={
AnyKinRotational &ref=.PelvisRotX.rot;
MeasureOrganizer={1};
};
AnyKinMeasureOrg PelvisRotZ ={
AnyKinRotational &ref=.PelvisRotX.rot;
MeasureOrganizer={2};
};

By setting Axis1, Axis2 and Axis3 you can choose the rotation
sequence you want. Notice that you have to modify MeasureOrganizer
according to your sequence. You also have to change the sequence in
JointsAndDrivers.any where you drive the pelvis to the ground with
AnyKinEqInterPolDriver PelvisGroundDriver, this way:

Data={
.JntPos.PelvisPosX,
.JntPos.PelvisPosY,
.JntPos.PelvisPosZ,
pi/180*.JntPos.PelvisRotX,
pi/180*.JntPos.PelvisRotY,
pi/180*.JntPos.PelvisRotZ
};

What is its meaning? Rot (Z,Y,X)
1º Rotation: RotZ -> PelvisRotZ (flexion)
2º Rotation: RotY -> PelvisRotY (Rotation)
3º Rotation: RotX -> PelvisRotX (lateral bending)
Is it right?

Yes it’s right.

Best regards,
Sylvain, AnyBody Support.

— In anyscript@yahoogroups.com, “jjmarinz” <jjmarin@…> wrote:
>
> Topic: How can one the euler angles order?
>
> About the euler angles the Manual "AnyBodyRefManual.pdf " says:
>
> AnyKinRotational
> Base Class: AnyKinMeasureReal (see p. 147)
> Description:
> This “kinematic measure” measures 3-D orientation/rotations. It
> measures either the rotation of a single reference frame with
respect
> to the global frame or the relative rotation one frame,
> frame ‘1’,with respect to another, frame ‘0’.
> Possible rotational quantities are determined by the member Type,
> which is an enum of AnyKin-RotationalType. This allows you to chose
> the following quantities as output: Cardan angles (Type =
> RotAxesAngles): Cardan angles measure a 3-D rotation by three
angles
> of planar rotation about the reference system’s axes. One should be
> aware that the sequence of these rotations is important, and that
any
> rotation subsequent to the first is a rotation about a local axis
> arising from the previous rotation(s). Typical examples of such
> coordinates are Euler angles and Bryant angles, which are described
> in the literature and both defined by a specific sequence of
> rotations. In this class, the members Axis1, Axis2, and Axis3 can
be
> used to specify any particular sequence of rotations…
>
> We consider that the concept is clear: the transition from one
> coordinate system to the other is achieved by a series of two-
> dimensional rotations. The rotations are performed about coordinate
> system axes generated by the previous rotation step (the step-by-
step
> procedure). But we have doubts about the AnyBody script syntax
about
> this topic.
>
> The convention we use below is that, for example, Rot (Z,Y,X),
means:
> Firstly we rotate RotZ about the Z axis of the initial coordinate
> system (global reference system of the PELVIS, Axis XYZ). After,
> about the Y’ axis of this newly generated coordinate system, a
> rotation by RotY is performed, followed by a rotation by RotX about
> the new X’’ axis.
>
> We use the euler angles in the following files:
>
> - MannequinValuesFromModel.any (see below)
> - JointsAndDrivers.any (see below)
> - Mannequin.any (In this file we introduce the movement) (see below)
> - \BRep\Aalborg\Spine\interface.any
> - \BRep\Aalborg\Arm3D\interface.any
> - \BRep\Aalborg\Leg3D\interface.any
>
> But, what is the file where we can consult or modify the order
about
> Euler Angles?
> We think in “interface.any” file but we don’t sure and we don’t
fully
> understand the syntax of script. Does the definition of
Mannequin.any
> file to affect or influence in the Euler angles order?
>
> About PELVIS:
> From file: \BRep\Aalborg\Spine\interface.any
>
> AnyKinMeasureOrg PelvisRotX ={
> AnyKinRotational rot ={
> AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
> Type=RotAxesAngles;
> };
> MeasureOrganizer={2};
> };
> AnyKinMeasureOrg PelvisRotY ={
> AnyKinRotational &ref=.PelvisRotX.rot;
> MeasureOrganizer={1};
> };
> AnyKinMeasureOrg PelvisRotZ ={
> AnyKinRotational &ref=.PelvisRotX.rot;
> MeasureOrganizer={0};
> };
>
> What is its meaning? Rot (Z,Y,X)
> 1º Rotation: RotZ -> PelvisRotZ (flexion)
> 2º Rotation: RotY -> PelvisRotY (Rotation)
> 3º Rotation: RotX -> PelvisRotX (lateral bending)
> Is it right?
> If we would like to change the order (normally the rotation is the
> last).
> Is it sufficient to change “MeasureOrganizer” variable? for example:
>
> AnyKinMeasureOrg PelvisRotX ={
> AnyKinRotational rot ={
> AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
> Type=RotAxesAngles;
> };
> MeasureOrganizer={1};
> };
> AnyKinMeasureOrg PelvisRotY ={
> AnyKinRotational &ref=.PelvisRotX.rot;
> MeasureOrganizer={2};
> };
> AnyKinMeasureOrg PelvisRotZ ={
> AnyKinRotational &ref=.PelvisRotX.rot;
> MeasureOrganizer={0};
> };
> …
>
> Do we have to change anything in other file?
>
>
> My files are the following:
>
> >>>>>>>>>> MannequinValuesFromModel.any
>
> AnyFolder MannequinValuesFromModel = {
>
> AnyFolder &FolderRef=Main.Model.HumanModel.Interface;
> AnyFolder AnyFolder_Posture = {
> //This controls the position of the pelvi wrt. to the global
> reference frame
> AnyVar AnyVar_PelvisPosX=.FolderRef.Trunk.PelvisPosX.Pos[0];
> AnyVar AnyVar_PelvisPosY=.FolderRef.Trunk.PelvisPosY.Pos[0];
> AnyVar AnyVar_PelvisPosZ=.FolderRef.Trunk.PelvisPosZ.Pos[0];
>
> //This controls the rotation of the pelvis wrt. to the global
> reference frame
> AnyVar AnyVar_PelvisRotX=.FolderRef.Trunk.PelvisRotX.Pos[0]
> 180/pi;
> AnyVar AnyVar_PelvisRotY=.FolderRef.Trunk.PelvisRotY.Pos[0]
> 180/pi;
> AnyVar AnyVar_PelvisRotZ=.FolderRef.Trunk.PelvisRotZ.Pos[0]
> 180/pi;
> …
>
>
> >>>>>>>>>>>> JointsAndDrivers.any
>
> // ************************************
> // Drivers for attaching the pelvis to the global reference system
> // ************************************
>
> AnyKinEqInterPolDriver PelvisGroundDriver ={
> AnyKinLinear lin ={
> AnyFixedRefFrame &ref1 =…EnvironmentModel.GlobalRef;
> AnySeg &ref2 =…HumanModel.Trunk.SegmentsLumbar.PelvisSeg;
> };
> AnyKinRotational rot ={
> AnyFixedRefFrame &ref1 =…EnvironmentModel.GlobalRef;
> AnySeg &ref2 =…HumanModel.Trunk.SegmentsLumbar.PelvisSeg;
> Type=RotAxesAngles;
> };
> Data={
> .JntPos.PelvisPosX,
> .JntPos.PelvisPosY,
> .JntPos.PelvisPosZ,
> pi/180
.JntPos.PelvisRotZ,
> pi/180
.JntPos.PelvisRotY,
> pi/180
.JntPos.PelvisRotX
> };
> T=.JntPos.PelvisPosTime;
>
> Type=Bspline;
> BsplineOrder = 8; // This provides smooth accelerations
> //Type=PiecewiseLinear;
>
> Reaction.Type={On,On,On,On,On,On};
> };
> …
>
>
> >>>>>>>>>>>>>>>>>> Mannequin.any
>
> AnyFolder Mannequin ={
> AnyFolder Posture ={
> AnyVector PelvisPosTime = {3.16, 3.36, 3.56, 3.76, 3.96, 4.16,
4.36,
> 4.56, 4.76, 4.96};
> AnyVector PelvisPosX = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0,
> 0.0};
> AnyVector PelvisPosY = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0,
> 0.0};
> AnyVector PelvisPosZ = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0,
> 0.0};
> AnyVector PelvisRotTime = {3.16, 3.36, 3.56, 3.76, 3.96, 4.16,
4.36,
> 4.56, 4.76, 4.96};
> AnyVector PelvisRotZ = {-40.37, -55.99, -69.65, -78.86, -82.19, -
> 82.19, -82.19, -82.19, -82.19, -82.19};
> AnyVector PelvisRotX = {41.45, 53.78, 63.93, 70.34, 72.55, 72.55,
> 72.55, 72.55, 72.55, 72.55};
> AnyVector PelvisRotY = {-35.96, -38.42, -38.33, -37.2, -36.58, -
> 36.58, -36.58, -36.58, -36.58, -36.58};
> …
>
> Thank you very much in advance.
>
> Javier Marin.
>

Hi Sylvain,
Thank you for your explication about Euler angles …
We have changed the files but we don’t get the result expected.
I’ll try to send you a folder compressed in zip with a simple example
where we only move the pelvis.
We would like:
Firstly rotation in Z (Rz), after rotation in X (Rx) and finally
rotation in Y (Ry).

In the file: euler.jpg there is a picture that show our idea about it.

We think that Ry is the rotation of the body on its own axis (Y
rotated) and not on the Y initial vertical axis. Is it right?

Many thanks in advance.

— In anyscript@yahoogroups.com, “AnyBody Support” <support@…>
wrote:
>
> Hi Javier,
>
> It seems you understand well the system of the rotation sequence.
Now
> if you change to change this sequence for the pelvis this must be
> done in the file \BRep\Aalborg\Spine\interface.any, I saw you
already
> located the code:
>
> AnyKinMeasureOrg PelvisRotX ={
> AnyKinRotational rot ={
> AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
> Type=RotAxesAngles;
> };
> MeasureOrganizer={2};
> };
> AnyKinMeasureOrg PelvisRotY ={
> AnyKinRotational &ref=.PelvisRotX.rot;
> MeasureOrganizer={1};
> };
> AnyKinMeasureOrg PelvisRotZ ={
> AnyKinRotational &ref=.PelvisRotX.rot;
> MeasureOrganizer={0};
> };
>
> By default the rotation sequence of Type=RotAxesAngles; is Z, Y and
> X. You can change it (in X, Y, Z for example) by adding those lines
> in AnyKinRotational:
>
> AnyKinMeasureOrg PelvisRotX ={
> AnyKinRotational rot ={
> AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
> Type=RotAxesAngles;
> Axis1= x;
> Axis2= y;
> Axis3= z;
> };
> MeasureOrganizer={0};
> };
> AnyKinMeasureOrg PelvisRotY ={
> AnyKinRotational &ref=.PelvisRotX.rot;
> MeasureOrganizer={1};
> };
> AnyKinMeasureOrg PelvisRotZ ={
> AnyKinRotational &ref=.PelvisRotX.rot;
> MeasureOrganizer={2};
> };
>
> By setting Axis1, Axis2 and Axis3 you can choose the rotation
> sequence you want. Notice that you have to modify MeasureOrganizer
> according to your sequence. You also have to change the sequence in
> JointsAndDrivers.any where you drive the pelvis to the ground with
> AnyKinEqInterPolDriver PelvisGroundDriver, this way:
>
> Data={
> .JntPos.PelvisPosX,
> .JntPos.PelvisPosY,
> .JntPos.PelvisPosZ,
> pi/180*.JntPos.PelvisRotX,
> pi/180*.JntPos.PelvisRotY,
> pi/180*.JntPos.PelvisRotZ
> };
>
>
>
> What is its meaning? Rot (Z,Y,X)
> 1º Rotation: RotZ -> PelvisRotZ (flexion)
> 2º Rotation: RotY -> PelvisRotY (Rotation)
> 3º Rotation: RotX -> PelvisRotX (lateral bending)
> Is it right?
>
> Yes it’s right.
>
> Best regards,
> Sylvain, AnyBody Support.
>
>
>
>
> — In anyscript@yahoogroups.com, “jjmarinz” <jjmarin@> wrote:
> >
> > Topic: How can one the euler angles order?
> >
> > About the euler angles the Manual "AnyBodyRefManual.pdf " says:
> >
> > AnyKinRotational
> > Base Class: AnyKinMeasureReal (see p. 147)
> > Description:
> > This “kinematic measure” measures 3-D orientation/rotations. It
> > measures either the rotation of a single reference frame with
> respect
> > to the global frame or the relative rotation one frame,
> > frame ‘1’,with respect to another, frame ‘0’.
> > Possible rotational quantities are determined by the member Type,
> > which is an enum of AnyKin-RotationalType. This allows you to
chose
> > the following quantities as output: Cardan angles (Type =
> > RotAxesAngles): Cardan angles measure a 3-D rotation by three
> angles
> > of planar rotation about the reference system’s axes. One should
be
> > aware that the sequence of these rotations is important, and that
> any
> > rotation subsequent to the first is a rotation about a local axis
> > arising from the previous rotation(s). Typical examples of such
> > coordinates are Euler angles and Bryant angles, which are
described
> > in the literature and both defined by a specific sequence of
> > rotations. In this class, the members Axis1, Axis2, and Axis3 can
> be
> > used to specify any particular sequence of rotations…
> >
> > We consider that the concept is clear: the transition from one
> > coordinate system to the other is achieved by a series of two-
> > dimensional rotations. The rotations are performed about
coordinate
> > system axes generated by the previous rotation step (the step-by-
> step
> > procedure). But we have doubts about the AnyBody script syntax
> about
> > this topic.
> >
> > The convention we use below is that, for example, Rot (Z,Y,X),
> means:
> > Firstly we rotate RotZ about the Z axis of the initial coordinate
> > system (global reference system of the PELVIS, Axis XYZ). After,
> > about the Y’ axis of this newly generated coordinate system, a
> > rotation by RotY is performed, followed by a rotation by RotX
about
> > the new X’’ axis.
> >
> > We use the euler angles in the following files:
> >
> > - MannequinValuesFromModel.any (see below)
> > - JointsAndDrivers.any (see below)
> > - Mannequin.any (In this file we introduce the movement) (see
below)
> > - \BRep\Aalborg\Spine\interface.any
> > - \BRep\Aalborg\Arm3D\interface.any
> > - \BRep\Aalborg\Leg3D\interface.any
> >
> > But, what is the file where we can consult or modify the order
> about
> > Euler Angles?
> > We think in “interface.any” file but we don’t sure and we don’t
> fully
> > understand the syntax of script. Does the definition of
> Mannequin.any
> > file to affect or influence in the Euler angles order?
> >
> > About PELVIS:
> > From file: \BRep\Aalborg\Spine\interface.any
> >
> > AnyKinMeasureOrg PelvisRotX ={
> > AnyKinRotational rot ={
> > AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
> > Type=RotAxesAngles;
> > };
> > MeasureOrganizer={2};
> > };
> > AnyKinMeasureOrg PelvisRotY ={
> > AnyKinRotational &ref=.PelvisRotX.rot;
> > MeasureOrganizer={1};
> > };
> > AnyKinMeasureOrg PelvisRotZ ={
> > AnyKinRotational &ref=.PelvisRotX.rot;
> > MeasureOrganizer={0};
> > };
> >
> > What is its meaning? Rot (Z,Y,X)
> > 1º Rotation: RotZ -> PelvisRotZ (flexion)
> > 2º Rotation: RotY -> PelvisRotY (Rotation)
> > 3º Rotation: RotX -> PelvisRotX (lateral bending)
> > Is it right?
> > If we would like to change the order (normally the rotation is
the
> > last).
> > Is it sufficient to change “MeasureOrganizer” variable? for
example:
> >
> > AnyKinMeasureOrg PelvisRotX ={
> > AnyKinRotational rot ={
> > AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
> > Type=RotAxesAngles;
> > };
> > MeasureOrganizer={1};
> > };
> > AnyKinMeasureOrg PelvisRotY ={
> > AnyKinRotational &ref=.PelvisRotX.rot;
> > MeasureOrganizer={2};
> > };
> > AnyKinMeasureOrg PelvisRotZ ={
> > AnyKinRotational &ref=.PelvisRotX.rot;
> > MeasureOrganizer={0};
> > };
> > …
> >
> > Do we have to change anything in other file?
> >
> >
> > My files are the following:
> >
> > >>>>>>>>>> MannequinValuesFromModel.any
> >
> > AnyFolder MannequinValuesFromModel = {
> >
> > AnyFolder &FolderRef=Main.Model.HumanModel.Interface;
> > AnyFolder AnyFolder_Posture = {
> > //This controls the position of the pelvi wrt. to the global
> > reference frame
> > AnyVar AnyVar_PelvisPosX=.FolderRef.Trunk.PelvisPosX.Pos[0];
> > AnyVar AnyVar_PelvisPosY=.FolderRef.Trunk.PelvisPosY.Pos[0];
> > AnyVar AnyVar_PelvisPosZ=.FolderRef.Trunk.PelvisPosZ.Pos[0];
> >
> > //This controls the rotation of the pelvis wrt. to the global
> > reference frame
> > AnyVar AnyVar_PelvisRotX=.FolderRef.Trunk.PelvisRotX.Pos[0]
> > 180/pi;
> > AnyVar AnyVar_PelvisRotY=.FolderRef.Trunk.PelvisRotY.Pos[0]
> > 180/pi;
> > AnyVar AnyVar_PelvisRotZ=.FolderRef.Trunk.PelvisRotZ.Pos[0]
> > 180/pi;
> > …
> >
> >
> > >>>>>>>>>>>> JointsAndDrivers.any
> >
> > // ************************************
> > // Drivers for attaching the pelvis to the global reference
system
> > // ************************************
> >
> > AnyKinEqInterPolDriver PelvisGroundDriver ={
> > AnyKinLinear lin ={
> > AnyFixedRefFrame &ref1 =…EnvironmentModel.GlobalRef;
> > AnySeg &ref2 =…HumanModel.Trunk.SegmentsLumbar.PelvisSeg;
> > };
> > AnyKinRotational rot ={
> > AnyFixedRefFrame &ref1 =…EnvironmentModel.GlobalRef;
> > AnySeg &ref2 =…HumanModel.Trunk.SegmentsLumbar.PelvisSeg;
> > Type=RotAxesAngles;
> > };
> > Data={
> > .JntPos.PelvisPosX,
> > .JntPos.PelvisPosY,
> > .JntPos.PelvisPosZ,
> > pi/180
.JntPos.PelvisRotZ,
> > pi/180
.JntPos.PelvisRotY,
> > pi/180
.JntPos.PelvisRotX
> > };
> > T=.JntPos.PelvisPosTime;
> >
> > Type=Bspline;
> > BsplineOrder = 8; // This provides smooth accelerations
> > //Type=PiecewiseLinear;
> >
> > Reaction.Type={On,On,On,On,On,On};
> > };
> > …
> >
> >
> > >>>>>>>>>>>>>>>>>> Mannequin.any
> >
> > AnyFolder Mannequin ={
> > AnyFolder Posture ={
> > AnyVector PelvisPosTime = {3.16, 3.36, 3.56, 3.76, 3.96, 4.16,
> 4.36,
> > 4.56, 4.76, 4.96};
> > AnyVector PelvisPosX = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
> 0.0,
> > 0.0};
> > AnyVector PelvisPosY = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
> 0.0,
> > 0.0};
> > AnyVector PelvisPosZ = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
> 0.0,
> > 0.0};
> > AnyVector PelvisRotTime = {3.16, 3.36, 3.56, 3.76, 3.96, 4.16,
> 4.36,
> > 4.56, 4.76, 4.96};
> > AnyVector PelvisRotZ = {-40.37, -55.99, -69.65, -78.86, -82.19, -
> > 82.19, -82.19, -82.19, -82.19, -82.19};
> > AnyVector PelvisRotX = {41.45, 53.78, 63.93, 70.34, 72.55, 72.55,
> > 72.55, 72.55, 72.55, 72.55};
> > AnyVector PelvisRotY = {-35.96, -38.42, -38.33, -37.2, -36.58, -
> > 36.58, -36.58, -36.58, -36.58, -36.58};
> > …
> >
> > Thank you very much in advance.
> >
> > Javier Marin.
> >
>

Hi,

Actually it was necesary to change the sequence in some more files
there are the following:

  • in InitialPositions.any, change the sequence in AnyVector
    PelvisGround. This file controls the initial position at load time
    before running SetInitialConditions.

  • In InterpolationFunctions.any, also change the sequence in
    PelvisGroundFunction.

  • In JointsAndDrivers.any, in the AnyKinRotational of
    

PelvisGroundDriver you must specify again the sequence of the axis by
writing
Axis1=z;
Axis2=x;
Axis3=y;

And you are right, each rotation is about the local rotated frame, so
the Y rotation is about the already rotated Y axis.

Best regards,
Sylvain, AnyBody Support.

— In anyscript@yahoogroups.com, “jjmarinz” <jjmarin@…> wrote:
>
> Hi Sylvain,
> Thank you for your explication about Euler angles …
> We have changed the files but we don’t get the result expected.
> I’ll try to send you a folder compressed in zip with a simple
example
> where we only move the pelvis.
> We would like:
> Firstly rotation in Z (Rz), after rotation in X (Rx) and finally
> rotation in Y (Ry).
>
> In the file: euler.jpg there is a picture that show our idea about
it.
>
> We think that Ry is the rotation of the body on its own axis (Y
> rotated) and not on the Y initial vertical axis. Is it right?
>
> Many thanks in advance.
>
> — In anyscript@yahoogroups.com, “AnyBody Support” <support@>
> wrote:
> >
> > Hi Javier,
> >
> > It seems you understand well the system of the rotation sequence.
> Now
> > if you change to change this sequence for the pelvis this must be
> > done in the file \BRep\Aalborg\Spine\interface.any, I saw you
> already
> > located the code:
> >
> > AnyKinMeasureOrg PelvisRotX ={
> > AnyKinRotational rot ={
> > AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
> > Type=RotAxesAngles;
> > };
> > MeasureOrganizer={2};
> > };
> > AnyKinMeasureOrg PelvisRotY ={
> > AnyKinRotational &ref=.PelvisRotX.rot;
> > MeasureOrganizer={1};
> > };
> > AnyKinMeasureOrg PelvisRotZ ={
> > AnyKinRotational &ref=.PelvisRotX.rot;
> > MeasureOrganizer={0};
> > };
> >
> > By default the rotation sequence of Type=RotAxesAngles; is Z, Y
and
> > X. You can change it (in X, Y, Z for example) by adding those
lines
> > in AnyKinRotational:
> >
> > AnyKinMeasureOrg PelvisRotX ={
> > AnyKinRotational rot ={
> > AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
> > Type=RotAxesAngles;
> > Axis1= x;
> > Axis2= y;
> > Axis3= z;
> > };
> > MeasureOrganizer={0};
> > };
> > AnyKinMeasureOrg PelvisRotY ={
> > AnyKinRotational &ref=.PelvisRotX.rot;
> > MeasureOrganizer={1};
> > };
> > AnyKinMeasureOrg PelvisRotZ ={
> > AnyKinRotational &ref=.PelvisRotX.rot;
> > MeasureOrganizer={2};
> > };
> >
> > By setting Axis1, Axis2 and Axis3 you can choose the rotation
> > sequence you want. Notice that you have to modify
MeasureOrganizer
> > according to your sequence. You also have to change the sequence
in
> > JointsAndDrivers.any where you drive the pelvis to the ground
with
> > AnyKinEqInterPolDriver PelvisGroundDriver, this way:
> >
> > Data={
> > .JntPos.PelvisPosX,
> > .JntPos.PelvisPosY,
> > .JntPos.PelvisPosZ,
> > pi/180*.JntPos.PelvisRotX,
> > pi/180*.JntPos.PelvisRotY,
> > pi/180*.JntPos.PelvisRotZ
> > };
> >
> >
> >
> > What is its meaning? Rot (Z,Y,X)
> > 1º Rotation: RotZ -> PelvisRotZ (flexion)
> > 2º Rotation: RotY -> PelvisRotY (Rotation)
> > 3º Rotation: RotX -> PelvisRotX (lateral bending)
> > Is it right?
> >
> > Yes it’s right.
> >
> > Best regards,
> > Sylvain, AnyBody Support.
> >
> >
> >
> >
> > — In anyscript@yahoogroups.com, “jjmarinz” <jjmarin@> wrote:
> > >
> > > Topic: How can one the euler angles order?
> > >
> > > About the euler angles the Manual "AnyBodyRefManual.pdf " says:
> > >
> > > AnyKinRotational
> > > Base Class: AnyKinMeasureReal (see p. 147)
> > > Description:
> > > This “kinematic measure” measures 3-D orientation/rotations. It
> > > measures either the rotation of a single reference frame with
> > respect
> > > to the global frame or the relative rotation one frame,
> > > frame ‘1’,with respect to another, frame ‘0’.
> > > Possible rotational quantities are determined by the member
Type,
> > > which is an enum of AnyKin-RotationalType. This allows you to
> chose
> > > the following quantities as output: Cardan angles (Type =
> > > RotAxesAngles): Cardan angles measure a 3-D rotation by three
> > angles
> > > of planar rotation about the reference system’s axes. One
should
> be
> > > aware that the sequence of these rotations is important, and
that
> > any
> > > rotation subsequent to the first is a rotation about a local
axis
> > > arising from the previous rotation(s). Typical examples of such
> > > coordinates are Euler angles and Bryant angles, which are
> described
> > > in the literature and both defined by a specific sequence of
> > > rotations. In this class, the members Axis1, Axis2, and Axis3
can
> > be
> > > used to specify any particular sequence of rotations…
> > >
> > > We consider that the concept is clear: the transition from one
> > > coordinate system to the other is achieved by a series of two-
> > > dimensional rotations. The rotations are performed about
> coordinate
> > > system axes generated by the previous rotation step (the step-
by-
> > step
> > > procedure). But we have doubts about the AnyBody script syntax
> > about
> > > this topic.
> > >
> > > The convention we use below is that, for example, Rot (Z,Y,X),
> > means:
> > > Firstly we rotate RotZ about the Z axis of the initial
coordinate
> > > system (global reference system of the PELVIS, Axis XYZ).
After,
> > > about the Y’ axis of this newly generated coordinate system, a
> > > rotation by RotY is performed, followed by a rotation by RotX
> about
> > > the new X’’ axis.
> > >
> > > We use the euler angles in the following files:
> > >
> > > - MannequinValuesFromModel.any (see below)
> > > - JointsAndDrivers.any (see below)
> > > - Mannequin.any (In this file we introduce the movement) (see
> below)
> > > - \BRep\Aalborg\Spine\interface.any
> > > - \BRep\Aalborg\Arm3D\interface.any
> > > - \BRep\Aalborg\Leg3D\interface.any
> > >
> > > But, what is the file where we can consult or modify the order
> > about
> > > Euler Angles?
> > > We think in “interface.any” file but we don’t sure and we don’t
> > fully
> > > understand the syntax of script. Does the definition of
> > Mannequin.any
> > > file to affect or influence in the Euler angles order?
> > >
> > > About PELVIS:
> > > From file: \BRep\Aalborg\Spine\interface.any
> > >
> > > AnyKinMeasureOrg PelvisRotX ={
> > > AnyKinRotational rot ={
> > > AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
> > > Type=RotAxesAngles;
> > > };
> > > MeasureOrganizer={2};
> > > };
> > > AnyKinMeasureOrg PelvisRotY ={
> > > AnyKinRotational &ref=.PelvisRotX.rot;
> > > MeasureOrganizer={1};
> > > };
> > > AnyKinMeasureOrg PelvisRotZ ={
> > > AnyKinRotational &ref=.PelvisRotX.rot;
> > > MeasureOrganizer={0};
> > > };
> > >
> > > What is its meaning? Rot (Z,Y,X)
> > > 1º Rotation: RotZ -> PelvisRotZ (flexion)
> > > 2º Rotation: RotY -> PelvisRotY (Rotation)
> > > 3º Rotation: RotX -> PelvisRotX (lateral bending)
> > > Is it right?
> > > If we would like to change the order (normally the rotation is
> the
> > > last).
> > > Is it sufficient to change “MeasureOrganizer” variable? for
> example:
> > >
> > > AnyKinMeasureOrg PelvisRotX ={
> > > AnyKinRotational rot ={
> > > AnySeg &ref2 =…Trunk.SegmentsLumbar.PelvisSeg;
> > > Type=RotAxesAngles;
> > > };
> > > MeasureOrganizer={1};
> > > };
> > > AnyKinMeasureOrg PelvisRotY ={
> > > AnyKinRotational &ref=.PelvisRotX.rot;
> > > MeasureOrganizer={2};
> > > };
> > > AnyKinMeasureOrg PelvisRotZ ={
> > > AnyKinRotational &ref=.PelvisRotX.rot;
> > > MeasureOrganizer={0};
> > > };
> > > …
> > >
> > > Do we have to change anything in other file?
> > >
> > >
> > > My files are the following:
> > >
> > > >>>>>>>>>> MannequinValuesFromModel.any
> > >
> > > AnyFolder MannequinValuesFromModel = {
> > >
> > > AnyFolder &FolderRef=Main.Model.HumanModel.Interface;
> > > AnyFolder AnyFolder_Posture = {
> > > //This controls the position of the pelvi wrt. to the
global
> > > reference frame
> > > AnyVar AnyVar_PelvisPosX=.FolderRef.Trunk.PelvisPosX.Pos[0];
> > > AnyVar AnyVar_PelvisPosY=.FolderRef.Trunk.PelvisPosY.Pos[0];
> > > AnyVar AnyVar_PelvisPosZ=.FolderRef.Trunk.PelvisPosZ.Pos[0];
> > >
> > > //This controls the rotation of the pelvis wrt. to the
global
> > > reference frame
> > > AnyVar AnyVar_PelvisRotX=.FolderRef.Trunk.PelvisRotX.Pos[0]
> > > 180/pi;
> > > AnyVar AnyVar_PelvisRotY=.FolderRef.Trunk.PelvisRotY.Pos[0]
> > > 180/pi;
> > > AnyVar AnyVar_PelvisRotZ=.FolderRef.Trunk.PelvisRotZ.Pos[0]
> > > 180/pi;
> > > …
> > >
> > >
> > > >>>>>>>>>>>> JointsAndDrivers.any
> > >
> > > // ************************************
> > > // Drivers for attaching the pelvis to the global reference
> system
> > > // ************************************
> > >
> > > AnyKinEqInterPolDriver PelvisGroundDriver ={
> > > AnyKinLinear lin ={
> > > AnyFixedRefFrame &ref1 =…EnvironmentModel.GlobalRef;
> > > AnySeg &ref2
=…HumanModel.Trunk.SegmentsLumbar.PelvisSeg;
> > > };
> > > AnyKinRotational rot ={
> > > AnyFixedRefFrame &ref1 =…EnvironmentModel.GlobalRef;
> > > AnySeg &ref2
=…HumanModel.Trunk.SegmentsLumbar.PelvisSeg;
> > > Type=RotAxesAngles;
> > > };
> > > Data={
> > > .JntPos.PelvisPosX,
> > > .JntPos.PelvisPosY,
> > > .JntPos.PelvisPosZ,
> > > pi/180
.JntPos.PelvisRotZ,
> > > pi/180
.JntPos.PelvisRotY,
> > > pi/180
.JntPos.PelvisRotX
> > > };
> > > T=.JntPos.PelvisPosTime;
> > >
> > > Type=Bspline;
> > > BsplineOrder = 8; // This provides smooth accelerations
> > > //Type=PiecewiseLinear;
> > >
> > > Reaction.Type={On,On,On,On,On,On};
> > > };
> > > …
> > >
> > >
> > > >>>>>>>>>>>>>>>>>> Mannequin.any
> > >
> > > AnyFolder Mannequin ={
> > > AnyFolder Posture ={
> > > AnyVector PelvisPosTime = {3.16, 3.36, 3.56, 3.76, 3.96, 4.16,
> > 4.36,
> > > 4.56, 4.76, 4.96};
> > > AnyVector PelvisPosX = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
> > 0.0,
> > > 0.0};
> > > AnyVector PelvisPosY = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
> > 0.0,
> > > 0.0};
> > > AnyVector PelvisPosZ = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
> > 0.0,
> > > 0.0};
> > > AnyVector PelvisRotTime = {3.16, 3.36, 3.56, 3.76, 3.96, 4.16,
> > 4.36,
> > > 4.56, 4.76, 4.96};
> > > AnyVector PelvisRotZ = {-40.37, -55.99, -69.65, -78.86, -
82.19, -
> > > 82.19, -82.19, -82.19, -82.19, -82.19};
> > > AnyVector PelvisRotX = {41.45, 53.78, 63.93, 70.34, 72.55,
72.55,
> > > 72.55, 72.55, 72.55, 72.55};
> > > AnyVector PelvisRotY = {-35.96, -38.42, -38.33, -37.2, -36.58, -
> > > 36.58, -36.58, -36.58, -36.58, -36.58};
> > > …
> > >
> > > Thank you very much in advance.
> > >
> > > Javier Marin.
> > >
> >
>