EulerParam vs. RotVector

Hello all,

I am trying to drive a segment’s orientation using the euler param method. I
use a data file which contains quaternion orientation of my segment. The
model loads fine but when I try to run it (set initial considitons), I get
that it’s over-constrained.

What am I doing wrong (see below)?

// ---------------------

// DOESN’T WORK (over-constrained, 1 unsolvable)

AnyKinRotational RotMeasure = {

AnyRefFrame &Global = Main.Model.GlobalRef;

AnyRefFrame &Seg = .Seg;

Type = EulerParam;

Ref = 0;

}; // RotMeasure

AnyKinEqInterPolDriver RotDriver = {

AnyKinRotational &Rot = .RotMeasure;

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

Type = Bspline;

BsplineOrder = 8;

FileName = .DataFile;

}; // RotDriver

// ---------------------

// ---------------------

// WORKS

AnyKinRotational RotMeasure = {

AnyRefFrame &Global = Main.Model.GlobalRef;

AnyRefFrame &Seg = .Seg;

Type = RotVector;

Ref = 0;

}; // RotMeasure

AnyKinEqSimpleDriver RotDriver = {

AnyKinRotational &Rot = .RotMeasure;

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

DriverPos = {0,0,0};

DriverVel = {0,0,0};

}; // RotDriver

// ---------------------

Thanks!

Jean-Olivier Racine

[Non-text portions of this message have been removed]

Hi Jean-Olivier

In principle it is possible to drive the model using the rotational
measures with the type set to EulerParam, but it can cause problems
as you have seen. This measure is really intended for measuring not
for driving. When trying to drive this measure you will need to
ensure that you fulfill the interal constraint in the measure saying
that length of the vector should be one.

In your case driving the measure with numeric values using an
interpolation driver, will make this impossible just due to the
interpolations.

I hope this answers your questions, otherwise please wrtie again

Best regards
Søren, AnyBody Support

— In anyscript@yahoogroups.com, Jean-Olivier Racine <jean-
olivier.racine.1@…> wrote:
>
> Hello all,
>
>
>
> I am trying to drive a segment’s orientation using the euler param
method. I
> use a data file which contains quaternion orientation of my
segment. The
> model loads fine but when I try to run it (set initial
considitons), I get
> that it’s over-constrained.
>
>
>
> What am I doing wrong (see below)?
>
>
>
> // ---------------------
>
> // DOESN’T WORK (over-constrained, 1 unsolvable)
>
> AnyKinRotational RotMeasure = {
>
> AnyRefFrame &Global = Main.Model.GlobalRef;
>
> AnyRefFrame &Seg = .Seg;
>
> Type = EulerParam;
>
> Ref = 0;
>
> }; // RotMeasure
>
>
>
> AnyKinEqInterPolDriver RotDriver = {
>
> AnyKinRotational &Rot = .RotMeasure;
>
> Reaction.Type = {On,On,On,On};
>
> Type = Bspline;
>
> BsplineOrder = 8;
>
> FileName = .DataFile;
>
> }; // RotDriver
>
> // ---------------------
>
>
>
>
>
> // ---------------------
>
> // WORKS
>
> AnyKinRotational RotMeasure = {
>
> AnyRefFrame &Global = Main.Model.GlobalRef;
>
> AnyRefFrame &Seg = .Seg;
>
> Type = RotVector;
>
> Ref = 0;
>
> }; // RotMeasure
>
>
>
> AnyKinEqSimpleDriver RotDriver = {
>
> AnyKinRotational &Rot = .RotMeasure;
>
> Reaction.Type = {On,On,On};
>
> DriverPos = {0,0,0};
>
> DriverVel = {0,0,0};
>
> }; // RotDriver
>
> // ---------------------
>
>
>
> Thanks!
>
> Jean-Olivier Racine
>
>
>
> [Non-text portions of this message have been removed]
>

Hello Søren,

I must admit I am rather surprised by this. The AnyKinEqInterPolDriver seems
to be the only driver which allow using a data file for driving. Also,
although I use the AnyKinEqInterPolDriver, I have the same number of data
points as there are steps in the study. Since Bsplines always passed through
the given points, I figured that the values used would always have a norm of
1 no interpolation is really done (and since my data respects this
constraint). Why is it not the case?

What work around would you suggest?

Jean-Olivier

From: anyscript@yahoogroups.com [mailto:anyscript@yahoogroups.com] On Behalf
Of AnyBody Support
Sent: Monday, August 06, 2007 8:22 AM
To: anyscript@yahoogroups.com
Subject: [AnyScript] Re: EulerParam vs. RotVector
Importance: High

Hi Jean-Olivier

In principle it is possible to drive the model using the rotational
measures with the type set to EulerParam, but it can cause problems
as you have seen. This measure is really intended for measuring not
for driving. When trying to drive this measure you will need to
ensure that you fulfill the interal constraint in the measure saying
that length of the vector should be one.

In your case driving the measure with numeric values using an
interpolation driver, will make this impossible just due to the
interpolations.

I hope this answers your questions, otherwise please wrtie again

Best regards
Søren, AnyBody Support

— In anyscript@yahoogroups.com <mailto:anyscript%40yahoogroups.com> ,
Jean-Olivier Racine <jean-
olivier.racine.1@…> wrote:
>
> Hello all,
>
>
>
> I am trying to drive a segment’s orientation using the euler param
method. I
> use a data file which contains quaternion orientation of my
segment. The
> model loads fine but when I try to run it (set initial
considitons), I get
> that it’s over-constrained.
>
>
>
> What am I doing wrong (see below)?
>
>
>
> // ---------------------
>
> // DOESN’T WORK (over-constrained, 1 unsolvable)
>
> AnyKinRotational RotMeasure = {
>
> AnyRefFrame &Global = Main.Model.GlobalRef;
>
> AnyRefFrame &Seg = .Seg;
>
> Type = EulerParam;
>
> Ref = 0;
>
> }; // RotMeasure
>
>
>
> AnyKinEqInterPolDriver RotDriver = {
>
> AnyKinRotational &Rot = .RotMeasure;
>
> Reaction.Type = {On,On,On,On};
>
> Type = Bspline;
>
> BsplineOrder = 8;
>
> FileName = .DataFile;
>
> }; // RotDriver
>
> // ---------------------
>
>
>
>
>
> // ---------------------
>
> // WORKS
>
> AnyKinRotational RotMeasure = {
>
> AnyRefFrame &Global = Main.Model.GlobalRef;
>
> AnyRefFrame &Seg = .Seg;
>
> Type = RotVector;
>
> Ref = 0;
>
> }; // RotMeasure
>
>
>
> AnyKinEqSimpleDriver RotDriver = {
>
> AnyKinRotational &Rot = .RotMeasure;
>
> Reaction.Type = {On,On,On};
>
> DriverPos = {0,0,0};
>
> DriverVel = {0,0,0};
>
> }; // RotDriver
>
> // ---------------------
>
>
>
> Thanks!
>
> Jean-Olivier Racine
>
>
>
> [Non-text portions of this message have been removed]
>

[Non-text portions of this message have been removed]

Hi Olivier

Using a BSpline will not constrain the curve to go through the
datapoints. The only way to ensure this is to use a PiecewiseLinear
type, the BSpline or Bezier do not ensure this. The Piecewise type
has the drawback of introducing discontinuities in the control
points, in terms of accelerations.

So you can try to swicth to a PiecewiseLinear type, but there are
still a redundant contraint in the equation system that may cause
problems in some cases.

Best regards
Søren

— In anyscript@yahoogroups.com, Jean-Olivier Racine <jean-
olivier.racine.1@…> wrote:
>
> Hello Søren,
>
>
>
> I must admit I am rather surprised by this. The
AnyKinEqInterPolDriver seems
> to be the only driver which allow using a data file for driving.
Also,
> although I use the AnyKinEqInterPolDriver, I have the same number
of data
> points as there are steps in the study. Since Bsplines always
passed through
> the given points, I figured that the values used would always have
a norm of
> 1 no interpolation is really done (and since my data respects this
> constraint). Why is it not the case?
>
>
>
> What work around would you suggest?
>
>
>
> Jean-Olivier
>
>
>
> From: anyscript@yahoogroups.com [mailto:anyscript@yahoogroups.com]
On Behalf
> Of AnyBody Support
> Sent: Monday, August 06, 2007 8:22 AM
> To: anyscript@yahoogroups.com
> Subject: [AnyScript] Re: EulerParam vs. RotVector
> Importance: High
>
>
>
> Hi Jean-Olivier
>
> In principle it is possible to drive the model using the
rotational
> measures with the type set to EulerParam, but it can cause
problems
> as you have seen. This measure is really intended for measuring
not
> for driving. When trying to drive this measure you will need to
> ensure that you fulfill the interal constraint in the measure
saying
> that length of the vector should be one.
>
> In your case driving the measure with numeric values using an
> interpolation driver, will make this impossible just due to the
> interpolations.
>
> I hope this answers your questions, otherwise please wrtie again
>
> Best regards
> Søren, AnyBody Support
>
> — In anyscript@yahoogroups.com <mailto:anyscript%
40yahoogroups.com> ,
> Jean-Olivier Racine <jean-
> olivier.racine.1@> wrote:
> >
> > Hello all,
> >
> >
> >
> > I am trying to drive a segment’s orientation using the euler
param
> method. I
> > use a data file which contains quaternion orientation of my
> segment. The
> > model loads fine but when I try to run it (set initial
> considitons), I get
> > that it’s over-constrained.
> >
> >
> >
> > What am I doing wrong (see below)?
> >
> >
> >
> > // ---------------------
> >
> > // DOESN’T WORK (over-constrained, 1 unsolvable)
> >
> > AnyKinRotational RotMeasure = {
> >
> > AnyRefFrame &Global = Main.Model.GlobalRef;
> >
> > AnyRefFrame &Seg = .Seg;
> >
> > Type = EulerParam;
> >
> > Ref = 0;
> >
> > }; // RotMeasure
> >
> >
> >
> > AnyKinEqInterPolDriver RotDriver = {
> >
> > AnyKinRotational &Rot = .RotMeasure;
> >
> > Reaction.Type = {On,On,On,On};
> >
> > Type = Bspline;
> >
> > BsplineOrder = 8;
> >
> > FileName = .DataFile;
> >
> > }; // RotDriver
> >
> > // ---------------------
> >
> >
> >
> >
> >
> > // ---------------------
> >
> > // WORKS
> >
> > AnyKinRotational RotMeasure = {
> >
> > AnyRefFrame &Global = Main.Model.GlobalRef;
> >
> > AnyRefFrame &Seg = .Seg;
> >
> > Type = RotVector;
> >
> > Ref = 0;
> >
> > }; // RotMeasure
> >
> >
> >
> > AnyKinEqSimpleDriver RotDriver = {
> >
> > AnyKinRotational &Rot = .RotMeasure;
> >
> > Reaction.Type = {On,On,On};
> >
> > DriverPos = {0,0,0};
> >
> > DriverVel = {0,0,0};
> >
> > }; // RotDriver
> >
> > // ---------------------
> >
> >
> >
> > Thanks!
> >
> > Jean-Olivier Racine
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

Hello Søren,

I must admit I am rather disappointed by this. This constitutes an important
limitation. I believe this limitation should be explicitly stated in the
documentation. I think the mention “This constraints can make it difficult
to use for driving angular motion generally using the Euler parameters
setting.” (p. 129) seems to be an understatement.

Now, my options are to drive using Cardan angles or Cartesian rotation
vectors. Cardan are not an option because of the singularities. So I’m left
with the rotation vectors. Unfortunately, I am not familiar with this
rotation calculation method. Before I use such a method, is there anything I
should know? And do you have a reference I could use to get me started?

Thanks,

Jean-Olivier

From: anyscript@yahoogroups.com [mailto:anyscript@yahoogroups.com] On Behalf
Of AnyBody Support
Sent: Monday, August 13, 2007 4:06 AM
To: anyscript@yahoogroups.com
Subject: [AnyScript] Re: EulerParam vs. RotVector
Importance: High

Hi Olivier

Using a BSpline will not constrain the curve to go through the
datapoints. The only way to ensure this is to use a PiecewiseLinear
type, the BSpline or Bezier do not ensure this. The Piecewise type
has the drawback of introducing discontinuities in the control
points, in terms of accelerations.

So you can try to swicth to a PiecewiseLinear type, but there are
still a redundant contraint in the equation system that may cause
problems in some cases.

Best regards
Søren

— In anyscript@yahoogroups.com <mailto:anyscript%40yahoogroups.com> ,
Jean-Olivier Racine <jean-
olivier.racine.1@…> wrote:
>
> Hello Søren,
>
>
>
> I must admit I am rather surprised by this. The
AnyKinEqInterPolDriver seems
> to be the only driver which allow using a data file for driving.
Also,
> although I use the AnyKinEqInterPolDriver, I have the same number
of data
> points as there are steps in the study. Since Bsplines always
passed through
> the given points, I figured that the values used would always have
a norm of
> 1 no interpolation is really done (and since my data respects this
> constraint). Why is it not the case?
>
>
>
> What work around would you suggest?
>
>
>
> Jean-Olivier
>
>
>
> From: anyscript@yahoogroups.com <mailto:anyscript%40yahoogroups.com>
[mailto:anyscript@yahoogroups.com <mailto:anyscript%40yahoogroups.com> ]
On Behalf
> Of AnyBody Support
> Sent: Monday, August 06, 2007 8:22 AM
> To: anyscript@yahoogroups.com <mailto:anyscript%40yahoogroups.com>
> Subject: [AnyScript] Re: EulerParam vs. RotVector
> Importance: High
>
>
>
> Hi Jean-Olivier
>
> In principle it is possible to drive the model using the
rotational
> measures with the type set to EulerParam, but it can cause
problems
> as you have seen. This measure is really intended for measuring
not
> for driving. When trying to drive this measure you will need to
> ensure that you fulfill the interal constraint in the measure
saying
> that length of the vector should be one.
>
> In your case driving the measure with numeric values using an
> interpolation driver, will make this impossible just due to the
> interpolations.
>
> I hope this answers your questions, otherwise please wrtie again
>
> Best regards
> Søren, AnyBody Support
>
> — In anyscript@yahoogroups.com <mailto:anyscript%40yahoogroups.com>
<mailto:anyscript%
40yahoogroups.com> ,
> Jean-Olivier Racine <jean-
> olivier.racine.1@> wrote:
> >
> > Hello all,
> >
> >
> >
> > I am trying to drive a segment’s orientation using the euler
param
> method. I
> > use a data file which contains quaternion orientation of my
> segment. The
> > model loads fine but when I try to run it (set initial
> considitons), I get
> > that it’s over-constrained.
> >
> >
> >
> > What am I doing wrong (see below)?
> >
> >
> >
> > // ---------------------
> >
> > // DOESN’T WORK (over-constrained, 1 unsolvable)
> >
> > AnyKinRotational RotMeasure = {
> >
> > AnyRefFrame &Global = Main.Model.GlobalRef;
> >
> > AnyRefFrame &Seg = .Seg;
> >
> > Type = EulerParam;
> >
> > Ref = 0;
> >
> > }; // RotMeasure
> >
> >
> >
> > AnyKinEqInterPolDriver RotDriver = {
> >
> > AnyKinRotational &Rot = .RotMeasure;
> >
> > Reaction.Type = {On,On,On,On};
> >
> > Type = Bspline;
> >
> > BsplineOrder = 8;
> >
> > FileName = .DataFile;
> >
> > }; // RotDriver
> >
> > // ---------------------
> >
> >
> >
> >
> >
> > // ---------------------
> >
> > // WORKS
> >
> > AnyKinRotational RotMeasure = {
> >
> > AnyRefFrame &Global = Main.Model.GlobalRef;
> >
> > AnyRefFrame &Seg = .Seg;
> >
> > Type = RotVector;
> >
> > Ref = 0;
> >
> > }; // RotMeasure
> >
> >
> >
> > AnyKinEqSimpleDriver RotDriver = {
> >
> > AnyKinRotational &Rot = .RotMeasure;
> >
> > Reaction.Type = {On,On,On};
> >
> > DriverPos = {0,0,0};
> >
> > DriverVel = {0,0,0};
> >
> > }; // RotDriver
> >
> > // ---------------------
> >
> >
> >
> > Thanks!
> >
> > Jean-Olivier Racine
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

[Non-text portions of this message have been removed]

Hello Jean-Olivier,

It’s Michael. Let me kick in a comment, since I guess I am more responsible
for this poor documentation than Søren is.

I am sorry for the confusion this has caused. I am sure you have spent a
good deal of time fighting this issue before asking.

About the documentation, I believe it was more correct in early versions of
AnyBody. The kinematic solver was less strict then, so it was so to speak
better at allowing with redundant constraints, but also more prone to
failure. Over the year we have tighten up this for it to be more
user-friendly under normal circumstances. I think it was better at handling
the Euler parameter constraints back then.

Because of the very little real usage of this feature (in fact I think you
are the first one to use Euler parameters this way), we have never
discovered the inadequacies in documentation – sorry it had to come down on
you.

About the Rotation Vector:

The definition of this is fairly easy. It is a vector pointing in the
direction of the rotation axis and the length of the vector is the angle of
rotation in radians. In math it can be written

RotVector = phi * u

where the Euler parameters are given by

p = [ cos(phi/2) sin(phi/2)*u]

u is the unit vector in the direction of the axis of rotation.

I am not sure whether to recommend you to use it or not. It is
mathematically a nice definition I think, but like Cardan angles, it has
drawbacks. Firstly, there are multiple rotation vectors that correspond to
the same orientation. AnyBody tries to take one so it is always a continuous
function, but this could cause problems with external data, I guess.

Secondly, the mathematics contains a singularity around zero. We have tried
to handle it by special treatment of this orientation though and so far it
seems to be fine. It is use internally in some of the standard joints such
as the revolute joint, I believe.

I am not sure what to say. I understand your wish for a general rotation
driver, but I am really not sure what the best way to do it is.

Be sure that I will be considering it further, also for options for a added
features of course.

We are very open for ideas you (or others) might be able to supply.

I hope you find an acceptable way through and of course I will be of
assistance if I can.

Best regards,

Michael


Michael Damsgaard, AnyBody Support

<http://www.anybodytech.com> www.anybodytech.com


From: anyscript@yahoogroups.com [mailto:anyscript@yahoogroups.com] On Behalf
Of Jean-Olivier Racine
Sent: Monday, August 20, 2007 16:11
To: anyscript@yahoogroups.com
Subject: RE: [AnyScript] Re: EulerParam vs. RotVector

Hello Søren,

I must admit I am rather disappointed by this. This constitutes an important
limitation. I believe this limitation should be explicitly stated in the
documentation. I think the mention “This constraints can make it difficult
to use for driving angular motion generally using the Euler parameters
setting.” (p. 129) seems to be an understatement.

Now, my options are to drive using Cardan angles or Cartesian rotation
vectors. Cardan are not an option because of the singularities. So I’m left
with the rotation vectors. Unfortunately, I am not familiar with this
rotation calculation method. Before I use such a method, is there anything I
should know? And do you have a reference I could use to get me started?

Thanks,

Jean-Olivier

From: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
[mailto:anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com] On
Behalf
Of AnyBody Support
Sent: Monday, August 13, 2007 4:06 AM
To: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
Subject: [AnyScript] Re: EulerParam vs. RotVector
Importance: High

Hi Olivier

Using a BSpline will not constrain the curve to go through the
datapoints. The only way to ensure this is to use a PiecewiseLinear
type, the BSpline or Bezier do not ensure this. The Piecewise type
has the drawback of introducing discontinuities in the control
points, in terms of accelerations.

So you can try to swicth to a PiecewiseLinear type, but there are
still a redundant contraint in the equation system that may cause
problems in some cases.

Best regards
Søren

— In anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com> ,
Jean-Olivier Racine <jean-
olivier.racine.1@…> wrote:
>
> Hello Søren,
>
>
>
> I must admit I am rather surprised by this. The
AnyKinEqInterPolDriver seems
> to be the only driver which allow using a data file for driving.
Also,
> although I use the AnyKinEqInterPolDriver, I have the same number
of data
> points as there are steps in the study. Since Bsplines always
passed through
> the given points, I figured that the values used would always have
a norm of
> 1 no interpolation is really done (and since my data respects this
> constraint). Why is it not the case?
>
>
>
> What work around would you suggest?
>
>
>
> Jean-Olivier
>
>
>
> From: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
[mailto:anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com> ]
On Behalf
> Of AnyBody Support
> Sent: Monday, August 06, 2007 8:22 AM
> To: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
> Subject: [AnyScript] Re: EulerParam vs. RotVector
> Importance: High
>
>
>
> Hi Jean-Olivier
>
> In principle it is possible to drive the model using the
rotational
> measures with the type set to EulerParam, but it can cause
problems
> as you have seen. This measure is really intended for measuring
not
> for driving. When trying to drive this measure you will need to
> ensure that you fulfill the interal constraint in the measure
saying
> that length of the vector should be one.
>
> In your case driving the measure with numeric values using an
> interpolation driver, will make this impossible just due to the
> interpolations.
>
> I hope this answers your questions, otherwise please wrtie again
>
> Best regards
> Søren, AnyBody Support
>
> — In anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
<mailto:anyscript%
40yahoogroups.com> ,
> Jean-Olivier Racine <jean-
> olivier.racine.1@> wrote:
> >
> > Hello all,
> >
> >
> >
> > I am trying to drive a segment’s orientation using the euler
param
> method. I
> > use a data file which contains quaternion orientation of my
> segment. The
> > model loads fine but when I try to run it (set initial
> considitons), I get
> > that it’s over-constrained.
> >
> >
> >
> > What am I doing wrong (see below)?
> >
> >
> >
> > // ---------------------
> >
> > // DOESN’T WORK (over-constrained, 1 unsolvable)
> >
> > AnyKinRotational RotMeasure = {
> >
> > AnyRefFrame &Global = Main.Model.GlobalRef;
> >
> > AnyRefFrame &Seg = .Seg;
> >
> > Type = EulerParam;
> >
> > Ref = 0;
> >
> > }; // RotMeasure
> >
> >
> >
> > AnyKinEqInterPolDriver RotDriver = {
> >
> > AnyKinRotational &Rot = .RotMeasure;
> >
> > Reaction.Type = {On,On,On,On};
> >
> > Type = Bspline;
> >
> > BsplineOrder = 8;
> >
> > FileName = .DataFile;
> >
> > }; // RotDriver
> >
> > // ---------------------
> >
> >
> >
> >
> >
> > // ---------------------
> >
> > // WORKS
> >
> > AnyKinRotational RotMeasure = {
> >
> > AnyRefFrame &Global = Main.Model.GlobalRef;
> >
> > AnyRefFrame &Seg = .Seg;
> >
> > Type = RotVector;
> >
> > Ref = 0;
> >
> > }; // RotMeasure
> >
> >
> >
> > AnyKinEqSimpleDriver RotDriver = {
> >
> > AnyKinRotational &Rot = .RotMeasure;
> >
> > Reaction.Type = {On,On,On};
> >
> > DriverPos = {0,0,0};
> >
> > DriverVel = {0,0,0};
> >
> > }; // RotDriver
> >
> > // ---------------------
> >
> >
> >
> > Thanks!
> >
> > Jean-Olivier Racine
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

Hello Michael,

Thanks for your answer, I truly appreciate your interest in making things
work for us.

Regarding the rotation vector, I must admit I don’t have choise. EulerParam
had the advantage or insuring that there was no singularities. My goal is to
drive the model through segment orientations whether than joint angles.
Cardan angles will certainly become a problem as the segment approaches the
orientation of the global reference system. So I have to use the RotVector.

SUGGESTIONS

  1.   As of the EulerParam, wouldn’t be possible to internally enforce
    

that the vector is a unit vector? Resizing the vector to a norm vector is a
simple operation. I suppose that the drawback would be to include
noise/errors in the data, but this noise would probably be easily filtered
afterward (those errors would, I believe, be of high frequency). Or maybe I
am missing something? The comment in documentation would go from “impossible
to do” to “will add noise to the results”, which is more interesting, no?

  1.   I suppose that the reason interpolation is always required is
    

because you use intermediate points (interpolated points) to calculate the
different derivation? Because another option would be to allow including
more data than the number of steps and then allowing enforcing the use of
real data (no interpolation of any kind). For example, if we could include
twice the number of frame, you could calculate the velocity without
interpolating. Do I make sense?

QUESTION

Søren pointed out that the B-splines do not go through the specified data
points. I was pretty sure it did so I must be missing something here. And
isn’t a piecewise linear interpolation just a linear B-spline? I though
Bezier and B-spline were different things, is that true in Anybody? I think
I am mixing up all these guys. Could I have more information on your
interpolation functions implementations so I can clear my ideas? Thanks.

Anyhow, we’ll see what happens with RotVector, see if I get a derivable
function from my data…

Thanks to both of you,

Jean-Olivier

From: anyscript@yahoogroups.com [mailto:anyscript@yahoogroups.com] On Behalf
Of AnyBody Support
Sent: Tuesday, August 21, 2007 7:51 AM
To: anyscript@yahoogroups.com
Subject: RE: [AnyScript] Re: EulerParam vs. RotVector
Importance: High

Hello Jean-Olivier,

It’s Michael. Let me kick in a comment, since I guess I am more responsible
for this poor documentation than Søren is.

I am sorry for the confusion this has caused. I am sure you have spent a
good deal of time fighting this issue before asking.

About the documentation, I believe it was more correct in early versions of
AnyBody. The kinematic solver was less strict then, so it was so to speak
better at allowing with redundant constraints, but also more prone to
failure. Over the year we have tighten up this for it to be more
user-friendly under normal circumstances. I think it was better at handling
the Euler parameter constraints back then.

Because of the very little real usage of this feature (in fact I think you
are the first one to use Euler parameters this way), we have never
discovered the inadequacies in documentation – sorry it had to come down on
you.

About the Rotation Vector:

The definition of this is fairly easy. It is a vector pointing in the
direction of the rotation axis and the length of the vector is the angle of
rotation in radians. In math it can be written

RotVector = phi * u

where the Euler parameters are given by

p = [ cos(phi/2) sin(phi/2)*u]

u is the unit vector in the direction of the axis of rotation.

I am not sure whether to recommend you to use it or not. It is
mathematically a nice definition I think, but like Cardan angles, it has
drawbacks. Firstly, there are multiple rotation vectors that correspond to
the same orientation. AnyBody tries to take one so it is always a continuous
function, but this could cause problems with external data, I guess.

Secondly, the mathematics contains a singularity around zero. We have tried
to handle it by special treatment of this orientation though and so far it
seems to be fine. It is use internally in some of the standard joints such
as the revolute joint, I believe.

I am not sure what to say. I understand your wish for a general rotation
driver, but I am really not sure what the best way to do it is.

Be sure that I will be considering it further, also for options for a added
features of course.

We are very open for ideas you (or others) might be able to supply.

I hope you find an acceptable way through and of course I will be of
assistance if I can.

Best regards,

Michael


Michael Damsgaard, AnyBody Support

<http://www.anybodytech.com> www.anybodytech.com


From: anyscript@yahoogroups.com <mailto:anyscript%40yahoogroups.com>
[mailto:anyscript@yahoogroups.com <mailto:anyscript%40yahoogroups.com> ] On
Behalf
Of Jean-Olivier Racine
Sent: Monday, August 20, 2007 16:11
To: anyscript@yahoogroups.com <mailto:anyscript%40yahoogroups.com>
Subject: RE: [AnyScript] Re: EulerParam vs. RotVector

Hello Søren,

I must admit I am rather disappointed by this. This constitutes an important
limitation. I believe this limitation should be explicitly stated in the
documentation. I think the mention “This constraints can make it difficult
to use for driving angular motion generally using the Euler parameters
setting.” (p. 129) seems to be an understatement.

Now, my options are to drive using Cardan angles or Cartesian rotation
vectors. Cardan are not an option because of the singularities. So I’m left
with the rotation vectors. Unfortunately, I am not familiar with this
rotation calculation method. Before I use such a method, is there anything I
should know? And do you have a reference I could use to get me started?

Thanks,

Jean-Olivier

From: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
[mailto:anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com] On
Behalf
Of AnyBody Support
Sent: Monday, August 13, 2007 4:06 AM
To: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
Subject: [AnyScript] Re: EulerParam vs. RotVector
Importance: High

Hi Olivier

Using a BSpline will not constrain the curve to go through the
datapoints. The only way to ensure this is to use a PiecewiseLinear
type, the BSpline or Bezier do not ensure this. The Piecewise type
has the drawback of introducing discontinuities in the control
points, in terms of accelerations.

So you can try to swicth to a PiecewiseLinear type, but there are
still a redundant contraint in the equation system that may cause
problems in some cases.

Best regards
Søren

— In anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com> ,
Jean-Olivier Racine <jean-
olivier.racine.1@…> wrote:
>
> Hello Søren,
>
>
>
> I must admit I am rather surprised by this. The
AnyKinEqInterPolDriver seems
> to be the only driver which allow using a data file for driving.
Also,
> although I use the AnyKinEqInterPolDriver, I have the same number
of data
> points as there are steps in the study. Since Bsplines always
passed through
> the given points, I figured that the values used would always have
a norm of
> 1 no interpolation is really done (and since my data respects this
> constraint). Why is it not the case?
>
>
>
> What work around would you suggest?
>
>
>
> Jean-Olivier
>
>
>
> From: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
[mailto:anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com> ]
On Behalf
> Of AnyBody Support
> Sent: Monday, August 06, 2007 8:22 AM
> To: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
> Subject: [AnyScript] Re: EulerParam vs. RotVector
> Importance: High
>
>
>
> Hi Jean-Olivier
>
> In principle it is possible to drive the model using the
rotational
> measures with the type set to EulerParam, but it can cause
problems
> as you have seen. This measure is really intended for measuring
not
> for driving. When trying to drive this measure you will need to
> ensure that you fulfill the interal constraint in the measure
saying
> that length of the vector should be one.
>
> In your case driving the measure with numeric values using an
> interpolation driver, will make this impossible just due to the
> interpolations.
>
> I hope this answers your questions, otherwise please wrtie again
>
> Best regards
> Søren, AnyBody Support
>
> — In anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
<mailto:anyscript%
40yahoogroups.com> ,
> Jean-Olivier Racine <jean-
> olivier.racine.1@> wrote:
> >
> > Hello all,
> >
> >
> >
> > I am trying to drive a segment’s orientation using the euler
param
> method. I
> > use a data file which contains quaternion orientation of my
> segment. The
> > model loads fine but when I try to run it (set initial
> considitons), I get
> > that it’s over-constrained.
> >
> >
> >
> > What am I doing wrong (see below)?
> >
> >
> >
> > // ---------------------
> >
> > // DOESN’T WORK (over-constrained, 1 unsolvable)
> >
> > AnyKinRotational RotMeasure = {
> >
> > AnyRefFrame &Global = Main.Model.GlobalRef;
> >
> > AnyRefFrame &Seg = .Seg;
> >
> > Type = EulerParam;
> >
> > Ref = 0;
> >
> > }; // RotMeasure
> >
> >
> >
> > AnyKinEqInterPolDriver RotDriver = {
> >
> > AnyKinRotational &Rot = .RotMeasure;
> >
> > Reaction.Type = {On,On,On,On};
> >
> > Type = Bspline;
> >
> > BsplineOrder = 8;
> >
> > FileName = .DataFile;
> >
> > }; // RotDriver
> >
> > // ---------------------
> >
> >
> >
> >
> >
> > // ---------------------
> >
> > // WORKS
> >
> > AnyKinRotational RotMeasure = {
> >
> > AnyRefFrame &Global = Main.Model.GlobalRef;
> >
> > AnyRefFrame &Seg = .Seg;
> >
> > Type = RotVector;
> >
> > Ref = 0;
> >
> > }; // RotMeasure
> >
> >
> >
> > AnyKinEqSimpleDriver RotDriver = {
> >
> > AnyKinRotational &Rot = .RotMeasure;
> >
> > Reaction.Type = {On,On,On};
> >
> > DriverPos = {0,0,0};
> >
> > DriverVel = {0,0,0};
> >
> > }; // RotDriver
> >
> > // ---------------------
> >
> >
> >
> > Thanks!
> >
> > Jean-Olivier Racine
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

Hello Jean-Olivier,

Sorry I didn’t answer you faster. Actually, I did write a short response on
Monday, but I send it from the wrong account and it was rejected by the
group.

Anyway, it was just saying that I couldn’t answer with details until today,
so you wouldn’t have been happier, I guess. (But I may have looked slightly
more polite)

I had one small question for you so here it comes (I may have missed the
answer in earlier correspondence, since I didn’t follow the discussion
closely from the beginning):

Are you only trying to drive segments with the Euler parameters, or is it
more general usage of the AnyKinRotational, such as driving relative
rotations between segments.

I am not completely sure whether it could open new options for doing it now,
but for sure it opens options for implementing new facilities in AnyBody.

I completely understand your frustration. I hope you have some time to
experiment with the rotation vector and that it works out reasonably ok.

Anyway, here are some other comments. 1 and 2 are related to your item 1 and
2, and 3 is an answer to your QUESTION:

  1. Normalizing the imported Euler parameters.

This is one idea, which we have also discussed and it sounds easy (it would
be mostly the AnyScript interface). However, I do not like the idea too much
in relation with constraints on the AnyKinRotational (Type=EulerPar) because
it would still leave the redundant constraints in the system. It would be
asking for troubles in the long run, I think (at least with the current
rather strict kinematic solver, see further comments below).

If we took another approach, namely to create a driven reference frame
(segment), I think it would be no problem to normalize, because we could
easily eliminate these constraints out of the system to be solved
numerically. This is partially why I asked the small question above.

  1. Yes indeed. We have been discussing this too, and one of my colleagues
    asked the same question as you do now. So I guess you have a point;-)

We talked about making “an interpolation function that cannot interpolate”,
which would simply imply that it would return an error when you ask it for
values between the data points.

This error would enforce you to set up your analysis so that it follows the
data point exactly, without changing the basic concept of the computation in
AnyBodyStudy.

How do you like this idea?

  1. Your question about the splines:

Once again it seems like I have to admit that the documentation could be
clearer. I don’t recall the Spline theory exactly, but I think it is like
this:

The BSpline and Bezier are using the data points directly as control points
(this I know for a fact) and this is why the curve does not pass through the
data points exactly. I believe the Bezier is in principle a BSpline of
infinite order, so in that sense they are alike.

I guess one could define other control points and use those to fit the
spline through the data points, but this is not how it is working in the
interpolations function and driver today.

As far as I remember, this fitting procedure will imply to solve a (large)
system of equations where the control points are the unknowns and the data
points as equations.

Moreover, I think that fitting splines through data points can cause them to
behave rather violent. There are other splines than Bspline that pass
through the data point, but they also have this fitting procedure.

We have never deemed this additional step to be needed, but maybe there are
applications where it would be nice to know that you have exact match. My
colleague (the guy mentioned before) also wanted derivatives that matched
what you would compute by standard finite difference techniques on the
sampled data. I think this could make sense together with “the interpolation
function that cannot interpolate”.

We have considered different other solutions (adding features to AnyBody)

  1. A PhD at Aalborg University, Michael Skipper Andersen, is working with
    methods that handle solve over-determined kinematics. This is aimed at
    importing MOCAP data into the kinematics, but I believe it could handle this
    Euler parameters issue too. But it kind of “shooting sparrows with canons”
    (This is a saying in Danish, but I am not sure whether it translates
    directly;-)

Moreover, it might be troubles if one use this feature for both fitting
MOCAP and Euler parameter data at the same time.

  1. It would be nicer to handle it in a separate object that can supply 3
    constraints to the solver. But I am still not sure how to do this or if it
    can be done easily.

I consider formulating it as an optimization problem, but it is a bit tricky
(and I am bit rusty on this topic too). This formulation could in principle
be very powerful for other issues too, for instance a driver the prescribe
minimum potential energy of an elastic system.

Well - most of this is talk about what could be. I am so sorry that we have
not been able to solve your problem nicely with what is available.

Let me know how it goes with the rotation vector.

Best regards,

Michael


Michael Damsgaard, AnyBody Support

<http://www.anybodytech.com> www.anybodytech.com


From: anyscript@yahoogroups.com [mailto:anyscript@yahoogroups.com] On Behalf
Of Jean-Olivier Racine
Sent: Friday, August 24, 2007 16:06
To: anyscript@yahoogroups.com
Cc: Rachid.Aissaoui@etsmtl.ca
Subject: RE: [AnyScript] Re: EulerParam vs. RotVector

Hello Michael,

Thanks for your answer, I truly appreciate your interest in making things
work for us.

Regarding the rotation vector, I must admit I don’t have choise. EulerParam
had the advantage or insuring that there was no singularities. My goal is to
drive the model through segment orientations whether than joint angles.
Cardan angles will certainly become a problem as the segment approaches the
orientation of the global reference system. So I have to use the RotVector.

SUGGESTIONS

  1. As of the EulerParam, wouldn’t be possible to internally enforce
    that the vector is a unit vector? Resizing the vector to a norm vector is a
    simple operation. I suppose that the drawback would be to include
    noise/errors in the data, but this noise would probably be easily filtered
    afterward (those errors would, I believe, be of high frequency). Or maybe I
    am missing something? The comment in documentation would go from “impossible
    to do” to “will add noise to the results”, which is more interesting, no?

  2. I suppose that the reason interpolation is always required is
    because you use intermediate points (interpolated points) to calculate the
    different derivation? Because another option would be to allow including
    more data than the number of steps and then allowing enforcing the use of
    real data (no interpolation of any kind). For example, if we could include
    twice the number of frame, you could calculate the velocity without
    interpolating. Do I make sense?

QUESTION

Søren pointed out that the B-splines do not go through the specified data
points. I was pretty sure it did so I must be missing something here. And
isn’t a piecewise linear interpolation just a linear B-spline? I though
Bezier and B-spline were different things, is that true in Anybody? I think
I am mixing up all these guys. Could I have more information on your
interpolation functions implementations so I can clear my ideas? Thanks.

Anyhow, we’ll see what happens with RotVector, see if I get a derivable
function from my data…

Thanks to both of you,

Jean-Olivier

From: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
[mailto:anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com] On
Behalf
Of AnyBody Support
Sent: Tuesday, August 21, 2007 7:51 AM
To: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
Subject: RE: [AnyScript] Re: EulerParam vs. RotVector
Importance: High

Hello Jean-Olivier,

It’s Michael. Let me kick in a comment, since I guess I am more responsible
for this poor documentation than Søren is.

I am sorry for the confusion this has caused. I am sure you have spent a
good deal of time fighting this issue before asking.

About the documentation, I believe it was more correct in early versions of
AnyBody. The kinematic solver was less strict then, so it was so to speak
better at allowing with redundant constraints, but also more prone to
failure. Over the year we have tighten up this for it to be more
user-friendly under normal circumstances. I think it was better at handling
the Euler parameter constraints back then.

Because of the very little real usage of this feature (in fact I think you
are the first one to use Euler parameters this way), we have never
discovered the inadequacies in documentation – sorry it had to come down on
you.

About the Rotation Vector:

The definition of this is fairly easy. It is a vector pointing in the
direction of the rotation axis and the length of the vector is the angle of
rotation in radians. In math it can be written

RotVector = phi * u

where the Euler parameters are given by

p = [ cos(phi/2) sin(phi/2)*u]

u is the unit vector in the direction of the axis of rotation.

I am not sure whether to recommend you to use it or not. It is
mathematically a nice definition I think, but like Cardan angles, it has
drawbacks. Firstly, there are multiple rotation vectors that correspond to
the same orientation. AnyBody tries to take one so it is always a continuous
function, but this could cause problems with external data, I guess.

Secondly, the mathematics contains a singularity around zero. We have tried
to handle it by special treatment of this orientation though and so far it
seems to be fine. It is use internally in some of the standard joints such
as the revolute joint, I believe.

I am not sure what to say. I understand your wish for a general rotation
driver, but I am really not sure what the best way to do it is.

Be sure that I will be considering it further, also for options for a added
features of course.

We are very open for ideas you (or others) might be able to supply.

I hope you find an acceptable way through and of course I will be of
assistance if I can.

Best regards,

Michael


Michael Damsgaard, AnyBody Support

<http://www.anybodyt <http://www.anybodytech.com> ech.com>
www.anybodytech.com


From: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
[mailto:anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com> ] On
Behalf
Of Jean-Olivier Racine
Sent: Monday, August 20, 2007 16:11
To: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
Subject: RE: [AnyScript] Re: EulerParam vs. RotVector

Hello Søren,

I must admit I am rather disappointed by this. This constitutes an important
limitation. I believe this limitation should be explicitly stated in the
documentation. I think the mention “This constraints can make it difficult
to use for driving angular motion generally using the Euler parameters
setting.” (p. 129) seems to be an understatement.

Now, my options are to drive using Cardan angles or Cartesian rotation
vectors. Cardan are not an option because of the singularities. So I’m left
with the rotation vectors. Unfortunately, I am not familiar with this
rotation calculation method. Before I use such a method, is there anything I
should know? And do you have a reference I could use to get me started?

Thanks,

Jean-Olivier

From: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
[mailto:anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com] On
Behalf
Of AnyBody Support
Sent: Monday, August 13, 2007 4:06 AM
To: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
Subject: [AnyScript] Re: EulerParam vs. RotVector
Importance: High

Hi Olivier

Using a BSpline will not constrain the curve to go through the
datapoints. The only way to ensure this is to use a PiecewiseLinear
type, the BSpline or Bezier do not ensure this. The Piecewise type
has the drawback of introducing discontinuities in the control
points, in terms of accelerations.

So you can try to swicth to a PiecewiseLinear type, but there are
still a redundant contraint in the equation system that may cause
problems in some cases.

Best regards
Søren

— In anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com> ,
Jean-Olivier Racine <jean-
olivier.racine.1@…> wrote:
>
> Hello Søren,
>
>
>
> I must admit I am rather surprised by this. The
AnyKinEqInterPolDriver seems
> to be the only driver which allow using a data file for driving.
Also,
> although I use the AnyKinEqInterPolDriver, I have the same number
of data
> points as there are steps in the study. Since Bsplines always
passed through
> the given points, I figured that the values used would always have
a norm of
> 1 no interpolation is really done (and since my data respects this
> constraint). Why is it not the case?
>
>
>
> What work around would you suggest?
>
>
>
> Jean-Olivier
>
>
>
> From: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
[mailto:anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com> ]
On Behalf
> Of AnyBody Support
> Sent: Monday, August 06, 2007 8:22 AM
> To: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
> Subject: [AnyScript] Re: EulerParam vs. RotVector
> Importance: High
>
>
>
> Hi Jean-Olivier
>
> In principle it is possible to drive the model using the
rotational
> measures with the type set to EulerParam, but it can cause
problems
> as you have seen. This measure is really intended for measuring
not
> for driving. When trying to drive this measure you will need to
> ensure that you fulfill the interal constraint in the measure
saying
> that length of the vector should be one.
>
> In your case driving the measure with numeric values using an
> interpolation driver, will make this impossible just due to the
> interpolations.
>
> I hope this answers your questions, otherwise please wrtie again
>
> Best regards
> Søren, AnyBody Support
>
> — In anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
<mailto:anyscript%
40yahoogroups.com> ,
> Jean-Olivier Racine <jean-
> olivier.racine.1@> wrote:
> >
> > Hello all,
> >
> >
> >
> > I am trying to drive a segment’s orientation using the euler
param
> method. I
> > use a data file which contains quaternion orientation of my
> segment. The
> > model loads fine but when I try to run it (set initial
> considitons), I get
> > that it’s over-constrained.
> >
> >
> >
> > What am I doing wrong (see below)?
> >
> >
> >
> > // ---------------------
> >
> > // DOESN’T WORK (over-constrained, 1 unsolvable)
> >
> > AnyKinRotational RotMeasure = {
> >
> > AnyRefFrame &Global = Main.Model.GlobalRef;
> >
> > AnyRefFrame &Seg = .Seg;
> >
> > Type = EulerParam;
> >
> > Ref = 0;
> >
> > }; // RotMeasure
> >
> >
> >
> > AnyKinEqInterPolDriver RotDriver = {
> >
> > AnyKinRotational &Rot = .RotMeasure;
> >
> > Reaction.Type = {On,On,On,On};
> >
> > Type = Bspline;
> >
> > BsplineOrder = 8;
> >
> > FileName = .DataFile;
> >
> > }; // RotDriver
> >
> > // ---------------------
> >
> >
> >
> >
> >
> > // ---------------------
> >
> > // WORKS
> >
> > AnyKinRotational RotMeasure = {
> >
> > AnyRefFrame &Global = Main.Model.GlobalRef;
> >
> > AnyRefFrame &Seg = .Seg;
> >
> > Type = RotVector;
> >
> > Ref = 0;
> >
> > }; // RotMeasure
> >
> >
> >
> > AnyKinEqSimpleDriver RotDriver = {
> >
> > AnyKinRotational &Rot = .RotMeasure;
> >
> > Reaction.Type = {On,On,On};
> >
> > DriverPos = {0,0,0};
> >
> > DriverVel = {0,0,0};
> >
> > }; // RotDriver
> >
> > // ---------------------
> >
> >
> >
> > Thanks!
> >
> > Jean-Olivier Racine
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

Good day Michael,

No problem for the delay, not to mention that I get rejected for using the
wrong e-mail all the time ;p

Yes, I am trying to drive segment orientation using euler parameters. It’s
an uncommon approach but it is, I believe, a very natural way of driving a
model. For example, one could define all joints to be ball and sockets and
drive segment orientations. It has interesting uses for ligament modeling,
complex movement and generalization of models.

For the rotation vector, I have some questions but I will put them in a new
post, to make things easier for referencing it later on.

Answers to the answers to my QUESTIONS: :wink:

  1.   As I said above, yes, my goal is to drive the segment orientations.
    

Maybe could it be put as a new parameter for the AnyKinRotational (i.e. Type
= EulerParam; ForceUnitVector = {On})?

  1.   I love this idea. Because this is what I thought I was doing ;) In
    

any case, I can certainly see this as being useful to others, eventually. If
you get measurements, it’s logical that you want to simulate using the exact
data. Not to mention that nowadays, frame rates are becoming increasingly
high, allowing to have enough data without using interpolation. And I
suspect this would be fairly easy to implement for you.

a. This brings me to a small comment on the structure of the driver
class structure. Currently, you have AnyKinEqInterPolDriver and
AnyFunInterpol as two different classes. But I believe it would be more
expandable to have a AnyKinEqDataDriver, to which you always supply the
exact amount of data, and then you could either include raw data, or use
AnyFunInterpol to generate the data points, of have new functions, such as
AnyFunSin, anyFunCos, AnyFunNoise, AnyFunStep, etc. This would, I believe,
be a lot more flexible. In any case, I am conscious you cannot remove
AnyKinEqInterPolDriver for backward compatibility, but you could still add
the AnyKinEqDataDriver.

  1.   I’ve just read from Mathworld that "A cubic spline is a spline
    

constructed of piecewise third-order polynomials which pass through a set of
m control points." So if data points are used as control points, then
shouldn’t they pass by it? Anyhow, let’s skip this question, I feel like I’m
arguing about something I don’t know, not to mention that it’s kind of a
detail to the whole problem…

  1.   That solution scares me more than it reassures me… (for the poor
    

sparrows I mean!) :wink: I’m sure it will be a very interesting feature, but
slightly overkill for my needs ;p

  1.   I very much like the idea of having an object for it. But even with
    

optimization, I have a hard time seeing how it would be interfaced.
Although, it could be done with something like 2.a (AnyFunQuaternion).

Thanks Michael!

Jean-Olivier

From: anyscript@yahoogroups.com [mailto:anyscript@yahoogroups.com] On Behalf
Of AnyBody Support
Sent: Wednesday, August 29, 2007 7:44 AM
To: anyscript@yahoogroups.com
Subject: RE: [AnyScript] Re: EulerParam vs. RotVector
Importance: High

Hello Jean-Olivier,

Sorry I didn’t answer you faster. Actually, I did write a short response on
Monday, but I send it from the wrong account and it was rejected by the
group.

Anyway, it was just saying that I couldn’t answer with details until today,
so you wouldn’t have been happier, I guess. (But I may have looked slightly
more polite)

I had one small question for you so here it comes (I may have missed the
answer in earlier correspondence, since I didn’t follow the discussion
closely from the beginning):

Are you only trying to drive segments with the Euler parameters, or is it
more general usage of the AnyKinRotational, such as driving relative
rotations between segments.

I am not completely sure whether it could open new options for doing it now,
but for sure it opens options for implementing new facilities in AnyBody.

I completely understand your frustration. I hope you have some time to
experiment with the rotation vector and that it works out reasonably ok.

Anyway, here are some other comments. 1 and 2 are related to your item 1 and
2, and 3 is an answer to your QUESTION:

  1. Normalizing the imported Euler parameters.

This is one idea, which we have also discussed and it sounds easy (it would
be mostly the AnyScript interface). However, I do not like the idea too much
in relation with constraints on the AnyKinRotational (Type=EulerPar) because
it would still leave the redundant constraints in the system. It would be
asking for troubles in the long run, I think (at least with the current
rather strict kinematic solver, see further comments below).

If we took another approach, namely to create a driven reference frame
(segment), I think it would be no problem to normalize, because we could
easily eliminate these constraints out of the system to be solved
numerically. This is partially why I asked the small question above.

  1. Yes indeed. We have been discussing this too, and one of my colleagues
    asked the same question as you do now. So I guess you have a point;-)

We talked about making “an interpolation function that cannot interpolate”,
which would simply imply that it would return an error when you ask it for
values between the data points.

This error would enforce you to set up your analysis so that it follows the
data point exactly, without changing the basic concept of the computation in
AnyBodyStudy.

How do you like this idea?

  1. Your question about the splines:

Once again it seems like I have to admit that the documentation could be
clearer. I don’t recall the Spline theory exactly, but I think it is like
this:

The BSpline and Bezier are using the data points directly as control points
(this I know for a fact) and this is why the curve does not pass through the
data points exactly. I believe the Bezier is in principle a BSpline of
infinite order, so in that sense they are alike.

I guess one could define other control points and use those to fit the
spline through the data points, but this is not how it is working in the
interpolations function and driver today.

As far as I remember, this fitting procedure will imply to solve a (large)
system of equations where the control points are the unknowns and the data
points as equations.

Moreover, I think that fitting splines through data points can cause them to
behave rather violent. There are other splines than Bspline that pass
through the data point, but they also have this fitting procedure.

We have never deemed this additional step to be needed, but maybe there are
applications where it would be nice to know that you have exact match. My
colleague (the guy mentioned before) also wanted derivatives that matched
what you would compute by standard finite difference techniques on the
sampled data. I think this could make sense together with “the interpolation
function that cannot interpolate”.

We have considered different other solutions (adding features to AnyBody)

  1. A PhD at Aalborg University, Michael Skipper Andersen, is working with
    methods that handle solve over-determined kinematics. This is aimed at
    importing MOCAP data into the kinematics, but I believe it could handle this
    Euler parameters issue too. But it kind of “shooting sparrows with canons”
    (This is a saying in Danish, but I am not sure whether it translates
    directly;-)

Moreover, it might be troubles if one use this feature for both fitting
MOCAP and Euler parameter data at the same time.

  1. It would be nicer to handle it in a separate object that can supply 3
    constraints to the solver. But I am still not sure how to do this or if it
    can be done easily.

I consider formulating it as an optimization problem, but it is a bit tricky
(and I am bit rusty on this topic too). This formulation could in principle
be very powerful for other issues too, for instance a driver the prescribe
minimum potential energy of an elastic system.

Well - most of this is talk about what could be. I am so sorry that we have
not been able to solve your problem nicely with what is available.

Let me know how it goes with the rotation vector.

Best regards,

Michael


Michael Damsgaard, AnyBody Support

<http://www.anybodytech.com> www.anybodytech.com


From: anyscript@yahoogroups.com <mailto:anyscript%40yahoogroups.com>
[mailto:anyscript@yahoogroups.com <mailto:anyscript%40yahoogroups.com> ] On
Behalf
Of Jean-Olivier Racine
Sent: Friday, August 24, 2007 16:06
To: anyscript@yahoogroups.com <mailto:anyscript%40yahoogroups.com>
Cc: Rachid.Aissaoui@etsmtl.ca <mailto:Rachid.Aissaoui%40etsmtl.ca>
Subject: RE: [AnyScript] Re: EulerParam vs. RotVector

Hello Michael,

Thanks for your answer, I truly appreciate your interest in making things
work for us.

Regarding the rotation vector, I must admit I don’t have choise. EulerParam
had the advantage or insuring that there was no singularities. My goal is to
drive the model through segment orientations whether than joint angles.
Cardan angles will certainly become a problem as the segment approaches the
orientation of the global reference system. So I have to use the RotVector.

SUGGESTIONS

  1. As of the EulerParam, wouldn’t be possible to internally enforce
    that the vector is a unit vector? Resizing the vector to a norm vector is a
    simple operation. I suppose that the drawback would be to include
    noise/errors in the data, but this noise would probably be easily filtered
    afterward (those errors would, I believe, be of high frequency). Or maybe I
    am missing something? The comment in documentation would go from “impossible
    to do” to “will add noise to the results”, which is more interesting, no?

  2. I suppose that the reason interpolation is always required is
    because you use intermediate points (interpolated points) to calculate the
    different derivation? Because another option would be to allow including
    more data than the number of steps and then allowing enforcing the use of
    real data (no interpolation of any kind). For example, if we could include
    twice the number of frame, you could calculate the velocity without
    interpolating. Do I make sense?

QUESTION

Søren pointed out that the B-splines do not go through the specified data
points. I was pretty sure it did so I must be missing something here. And
isn’t a piecewise linear interpolation just a linear B-spline? I though
Bezier and B-spline were different things, is that true in Anybody? I think
I am mixing up all these guys. Could I have more information on your
interpolation functions implementations so I can clear my ideas? Thanks.

Anyhow, we’ll see what happens with RotVector, see if I get a derivable
function from my data…

Thanks to both of you,

Jean-Olivier

From: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
[mailto:anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com] On
Behalf
Of AnyBody Support
Sent: Tuesday, August 21, 2007 7:51 AM
To: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
Subject: RE: [AnyScript] Re: EulerParam vs. RotVector
Importance: High

Hello Jean-Olivier,

It’s Michael. Let me kick in a comment, since I guess I am more responsible
for this poor documentation than Søren is.

I am sorry for the confusion this has caused. I am sure you have spent a
good deal of time fighting this issue before asking.

About the documentation, I believe it was more correct in early versions of
AnyBody. The kinematic solver was less strict then, so it was so to speak
better at allowing with redundant constraints, but also more prone to
failure. Over the year we have tighten up this for it to be more
user-friendly under normal circumstances. I think it was better at handling
the Euler parameter constraints back then.

Because of the very little real usage of this feature (in fact I think you
are the first one to use Euler parameters this way), we have never
discovered the inadequacies in documentation – sorry it had to come down on
you.

About the Rotation Vector:

The definition of this is fairly easy. It is a vector pointing in the
direction of the rotation axis and the length of the vector is the angle of
rotation in radians. In math it can be written

RotVector = phi * u

where the Euler parameters are given by

p = [ cos(phi/2) sin(phi/2)*u]

u is the unit vector in the direction of the axis of rotation.

I am not sure whether to recommend you to use it or not. It is
mathematically a nice definition I think, but like Cardan angles, it has
drawbacks. Firstly, there are multiple rotation vectors that correspond to
the same orientation. AnyBody tries to take one so it is always a continuous
function, but this could cause problems with external data, I guess.

Secondly, the mathematics contains a singularity around zero. We have tried
to handle it by special treatment of this orientation though and so far it
seems to be fine. It is use internally in some of the standard joints such
as the revolute joint, I believe.

I am not sure what to say. I understand your wish for a general rotation
driver, but I am really not sure what the best way to do it is.

Be sure that I will be considering it further, also for options for a added
features of course.

We are very open for ideas you (or others) might be able to supply.

I hope you find an acceptable way through and of course I will be of
assistance if I can.

Best regards,

Michael


Michael Damsgaard, AnyBody Support

<http://www.anybodyt <http://www.anybodytech.com> ech.com>
www.anybodytech.com


From: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
[mailto:anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com> ] On
Behalf
Of Jean-Olivier Racine
Sent: Monday, August 20, 2007 16:11
To: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
Subject: RE: [AnyScript] Re: EulerParam vs. RotVector

Hello Søren,

I must admit I am rather disappointed by this. This constitutes an important
limitation. I believe this limitation should be explicitly stated in the
documentation. I think the mention “This constraints can make it difficult
to use for driving angular motion generally using the Euler parameters
setting.” (p. 129) seems to be an understatement.

Now, my options are to drive using Cardan angles or Cartesian rotation
vectors. Cardan are not an option because of the singularities. So I’m left
with the rotation vectors. Unfortunately, I am not familiar with this
rotation calculation method. Before I use such a method, is there anything I
should know? And do you have a reference I could use to get me started?

Thanks,

Jean-Olivier

From: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
[mailto:anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com] On
Behalf
Of AnyBody Support
Sent: Monday, August 13, 2007 4:06 AM
To: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
Subject: [AnyScript] Re: EulerParam vs. RotVector
Importance: High

Hi Olivier

Using a BSpline will not constrain the curve to go through the
datapoints. The only way to ensure this is to use a PiecewiseLinear
type, the BSpline or Bezier do not ensure this. The Piecewise type
has the drawback of introducing discontinuities in the control
points, in terms of accelerations.

So you can try to swicth to a PiecewiseLinear type, but there are
still a redundant contraint in the equation system that may cause
problems in some cases.

Best regards
Søren

— In anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com> ,
Jean-Olivier Racine <jean-
olivier.racine.1@…> wrote:
>
> Hello Søren,
>
>
>
> I must admit I am rather surprised by this. The
AnyKinEqInterPolDriver seems
> to be the only driver which allow using a data file for driving.
Also,
> although I use the AnyKinEqInterPolDriver, I have the same number
of data
> points as there are steps in the study. Since Bsplines always
passed through
> the given points, I figured that the values used would always have
a norm of
> 1 no interpolation is really done (and since my data respects this
> constraint). Why is it not the case?
>
>
>
> What work around would you suggest?
>
>
>
> Jean-Olivier
>
>
>
> From: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
[mailto:anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com> ]
On Behalf
> Of AnyBody Support
> Sent: Monday, August 06, 2007 8:22 AM
> To: anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
> Subject: [AnyScript] Re: EulerParam vs. RotVector
> Importance: High
>
>
>
> Hi Jean-Olivier
>
> In principle it is possible to drive the model using the
rotational
> measures with the type set to EulerParam, but it can cause
problems
> as you have seen. This measure is really intended for measuring
not
> for driving. When trying to drive this measure you will need to
> ensure that you fulfill the interal constraint in the measure
saying
> that length of the vector should be one.
>
> In your case driving the measure with numeric values using an
> interpolation driver, will make this impossible just due to the
> interpolations.
>
> I hope this answers your questions, otherwise please wrtie again
>
> Best regards
> Søren, AnyBody Support
>
> — In anyscript@yahoogrou <mailto:anyscript%40yahoogroups.com> ps.com
<mailto:anyscript%40yahoogroups.com>
<mailto:anyscript%
40yahoogroups.com> ,
> Jean-Olivier Racine <jean-
> olivier.racine.1@> wrote:
> >
> > Hello all,
> >
> >
> >
> > I am trying to drive a segment’s orientation using the euler
param
> method. I
> > use a data file which contains quaternion orientation of my
> segment. The
> > model loads fine but when I try to run it (set initial
> considitons), I get
> > that it’s over-constrained.
> >
> >
> >
> > What am I doing wrong (see below)?
> >
> >
> >
> > // ---------------------
> >
> > // DOESN’T WORK (over-constrained, 1 unsolvable)
> >
> > AnyKinRotational RotMeasure = {
> >
> > AnyRefFrame &Global = Main.Model.GlobalRef;
> >
> > AnyRefFrame &Seg = .Seg;
> >
> > Type = EulerParam;
> >
> > Ref = 0;
> >
> > }; // RotMeasure
> >
> >
> >
> > AnyKinEqInterPolDriver RotDriver = {
> >
> > AnyKinRotational &Rot = .RotMeasure;
> >
> > Reaction.Type = {On,On,On,On};
> >
> > Type = Bspline;
> >
> > BsplineOrder = 8;
> >
> > FileName = .DataFile;
> >
> > }; // RotDriver
> >
> > // ---------------------
> >
> >
> >
> >
> >
> > // ---------------------
> >
> > // WORKS
> >
> > AnyKinRotational RotMeasure = {
> >
> > AnyRefFrame &Global = Main.Model.GlobalRef;
> >
> > AnyRefFrame &Seg = .Seg;
> >
> > Type = RotVector;
> >
> > Ref = 0;
> >
> > }; // RotMeasure
> >
> >
> >
> > AnyKinEqSimpleDriver RotDriver = {
> >
> > AnyKinRotational &Rot = .RotMeasure;
> >
> > Reaction.Type = {On,On,On};
> >
> > DriverPos = {0,0,0};
> >
> > DriverVel = {0,0,0};
> >
> > }; // RotDriver
> >
> > // ---------------------
> >
> >
> >
> > Thanks!
> >
> > Jean-Olivier Racine
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

Hi Jean-Olivier

I have put some short replies into your text, see below.

Yes, I am trying to drive segment orientation using euler parameters. It’s
an uncommon approach but it is, I believe, a very natural way of driving a
model. For example, one could define all joints to be ball and sockets and
drive segment orientations. It has interesting uses for ligament modeling,
complex movement and generalization of models.

Okay. I thought you were driving all six degrees of freedom of the segments,
but it is in fact only the rotations. I will keep that in mind.

For the rotation vector, I have some questions but I will put them in a new
post, to make things easier for referencing it later on.

Great - I’ll look at it ASAP.

Answers to the answers to my QUESTIONS: :wink:

  1. As I said above, yes, my goal is to drive the segment orientations.
    Maybe could it be put as a new parameter for the AnyKinRotational (i.e. Type
    = EulerParam; ForceUnitVector = {On})?

Yes I understand you point of view. Be sure that we will keep this under
consideration for future version (unfortunately it is too late for the soon
to come version 3).

  1. I love this idea. Because this is what I thought I was doing :wink: In
    any case, I can certainly see this as being useful to others, eventually. If
    you get measurements, it’s logical that you want to simulate using the exact
    data. Not to mention that nowadays, frame rates are becoming increasingly
    high, allowing to have enough data without using interpolation. And I
    suspect this would be fairly easy to implement for you.

That’s great and your are right that it will be fairly easy.

a. This brings me to a small comment on the structure of the driver
class structure. Currently, you have AnyKinEqInterPolDriver and
AnyFunInterpol as two different classes. But I believe it would be more
expandable to have a AnyKinEqDataDriver, to which you always supply the
exact amount of data, and then you could either include raw data, or use
AnyFunInterpol to generate the data points, of have new functions, such as
AnyFunSin, anyFunCos, AnyFunNoise, AnyFunStep, etc. This would, I believe,
be a lot more flexible. In any case, I am conscious you cannot remove
AnyKinEqInterPolDriver for backward compatibility, but you could still add
the AnyKinEqDataDriver.

.and right again. It will become somewhat like you suggest, because it is a
much more sensible and extensible structure, as you point out. Actually, it
is only for “historical” reasons that it is not like you suggest. The
currently known drivers in AnyBody came before the AnyFuns in the very early
versions (alpha and beta) of AnyBody and since then the need to do it right
has not be strong enough. I think the need is there now with demand for new
data driver functions.

  1. I’ve just read from Mathworld that “A cubic spline is a spline
    constructed of piecewise third-order polynomials which pass through a set of
    m control points.” So if data points are used as control points, then
    shouldn’t they pass by it? Anyhow, let’s skip this question, I feel like I’m
    arguing about something I don’t know, not to mention that it’s kind of a
    detail to the whole problem.

You are right about the Cubic spline, but a cubic spline is not exactly the
same as a B-spline. As far as I recall a cubic spline also requires you to
solve a system of equations to prepare its coefficients to match the data
points. Moreover, the cubic spline can indeed show what I referred to as
violent behavior, because it may need to curve a lot to hit the data point
exactly. This can lead to unexpected large accelerations.

  1. That solution scares me more than it r eassures me. (for the poor
    sparrows I mean!) :wink: I’m sure it will be a very interesting feature, but
    slightly overkill for my needs ;p

Let’s save the sparrows then;-)

  1. I very much like the idea of having an object for it. But even with
    optimization, I have a hard time seeing how it would be interfaced.
    Although, it could be done with something like 2.a (AnyFunQuaternion).

Yes I guess it should be wrapped into something nice, maybe rather a
AnyKinEqEulerParam (but let’s not get into a fight about the names;-).

Be sure that we will take it all under consideration. It has been very nice
to get this good feedback from you. I am sorry we couldn’t handle the
problem right away. I hope it works out with the rotation vector (I will
move on to your email about that now - see you soon)

Best regards,

Michael


Michael Damsgaard, AnyBody Support

<http://www.anybodytech.com> www.anybodytech.com

[Non-text portions of this message have been removed]