Hello guys,
As some of you may know, I am working on a sit-to-stand model. My model is
based on the old Gait model (lower-limb) and uses orientation to drive the
segments. In short, I drive the thigh (3 DOFs x 2) and pelvis (3 DOFs)
segments using data files that contain rotation vectors over time, and I use
angles to drive the shank (knee, 1 DOF x 2) and feet (ankle, 2 DOFs x 2)
(time + 3 components) and I position the center of the pelvis (3 DOFs).
My problem is that the orientation of the segments do not match the
orientation I supply. More specifically, if I measure (using a
AnyKinRotational) the orientation between the global reference frame and the
thigh segment, I get a different result than if I look at the measure/driver
used to drive this very segment.
Here are extracts from the model code (links to the full model will follow)
and the specifics:
I first drive a zero-mass segment’s orientation to fit my rotational vector
data (SegOrient.any):
===== CODE START =====
AnyFunInterpol Data = {
Type = PiecewiseLinear;
FileName = .DataFile;
}; // Data
AnySeg Seg = {
Mass = 0;
Jii = {0,0,0};
AnyRefNode ISBNode = {
sRel = {0,0,0};
ARel = Main.Model.Environment.GlobalRef.ISBFrame.ARel;
AnyDrawRefFrame DrawRef = {
RGB = {0,1,0};
ScaleXYZ = {0.05,0.05,0.05} * ...ShowOrient;
};
}; // ISBNode
// […]
}; // Seg
AnyKinEqSimpleDriver LinDriver = {
AnyKinLinear LinMeasure = {
AnyRefFrame &Global = Main.Model.Environment.GlobalRef.ISBFrame;
AnyRefFrame &Seg = ..Seg.ISBNode;
Ref = 0;
}; // LinMeasure
Reaction.Type = {On, On, On}; // Markers need to be carried
DriverPos = {0,0,0};
DriverVel = {0,0,0};
}; // LinDriver
AnyKinEqInterPolDriver RotDriver = {
AnyKinRotational RotMeasure = {
AnyRefFrame &Global = Main.Model.Environment.GlobalRef.IRMFrame;
AnyRefFrame &Seg = ..Seg.IRMNode;
Type = RotVector;
Ref = 0;
}; // RotMeasure
Reaction.Type = {On, On, On}; // Markers need to be carried
Type = PiecewiseLinear;
T = .Data.T;
Data = .Data.Data;
}; // RotDriver
===== CODE END =====
I then drive (by limiting rotations) the segment orientation to match this
null-mass segment (Drivers.any):
===== CODE START =====
AnyKinEqSimpleDriver RThighRotDriver = {
AnyKinRotational RotLink = {
AnyRefNode &Model =
Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh.IRMNode;
AnyRefNode &Marker =
Main.Model.Environment.SegmentOrientations.RThigh.Seg.IRMNode;
Type = RotVector;
}; // RotLink
MeasureOrganizer = {0,1,2};
DriverPos = {0,0,0};
DriverVel = {0,0,0};
Reaction.Type = {Off,Off,Off};
}; // RThighRotDriver
===== CODE END =====
Up to here, everything seems fine. But when I look at my model, I notice a
fairly big orientation difference between the line joining the joint centers
(hip joint to knee joint) compared to the equivalent line drawn from my
marker data (hip joint center virtual marker and knee joint center virtual
marker). At first, I blame my transformations/calculations previous to
entering it in Anybody, but strangely, the error seem to come from Anybody!
To test demonstrate this, I simply created a measure that measure directly
the orientation difference between the global reference frame and the thigh
segment (STS.main.any):
===== CODE START =====
AnyKinRotational RThighRotV = {
AnyRefFrame &RefFrame = Main.Model.Environment.GlobalRef.IRMFrame;
AnyRefFrame &Thigh =
Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh.IRMNode;
Type = RotVector;
};
===== CODE END =====
Strangely enough, this last measure (RThighRotV) gives me a different result
than the one that is being driven (LinDriver.LinMeasure)! The error is
present both in the 3D view and the data.
Values at frame 0:
Main.Study.Output.Model.Environment.SegmentOrientations.RThigh.RotDriver.Rot
Measure.Pos
0.108464
0.058994
-1.187838
Main.Study.Output.Model.RThighRotV.Pos
0.08990936
0.06810572
-1.132129
So I assume that I am missing something fairly big or there is a bug, in
either case, I need your help as I am kinda stuck…
Other specifics:
-
I use Anybody 2.x, although I tried on 3.x with the same results.
-
I use the repository 6.0.
-
I used repository 6.0 also for 3.x, although it gives me several
warnings about the Ref parameter which is now deprecated, but it worked
anyway.
Below is the link to download the model:
http://www.health-ingenio.com/Files/Model.zip
Note that the repository is not included and should be placed under
Repository.6, at the same level as the zip’s directory.
Thank you very much for your help!
Jean-Olivier Racine, ing.jr
HumanCAD Development Team
NexGen Ergonomics Inc.
(450) 621-0138
[Non-text portions of this message have been removed]