# Driving the model using joint angles vs. time step

Hi,

I asked later a question about how to import kinematic data to
Now, let me explain my questions in more detail:
My final aim is to calculate muscle forces in shoulder and arm region
using the in vivo measurements.
First thing I want to know is that if I should use the ‘Arm3D’ in
the ‘Brep’ repository or something else in the ‘Arep’ directory?
Second, I recorded the marker data during different movements (e.g.
abduction, flexion, etc) for each time step during the subject
movement; then, for each movement, I calculated the Cardan (or Euler)
angles at each joint (e.g. SC joint, AC joint, Elbow joint, etc)
based on ISB recommendations for upper extremity (Wu et al, 2005);
please kindly explain me step by step (or guide me to some
references) how to apply these joint angles to drive the model and to
calculate the muscle forces?

Best regards,
Ali

Hi Ali

I have searched this group for messages related to this topis please

1072 , 309 and 211

In these messages you will the this link

which is a explanation to the coordinates system we have used in the
shoulder, it is different for the article you mentioned in some
joints, but not all of them, according to the previous messages the
GH should be similar whereas SC is different.

So if you would like to drive the model using the coordinate system
of the ISB recommendations for upper extremity (Wu et al, 2005);
You will need to create new rotational measures which will replicate
the measures used in the article. It will be too detailed to give
you a step by step procedure to follow on how to do this i am
afraid.

So here is a sketch …

1 create a node in the SC joint on both clavicula and thorax which
has the desired orientation. The ARel property of the nodes can be
used to change the orientation of the nodes.

2 Create an AnyKinRotational based on these nodes, be sure that the
rotation sequence is correct this can be controlled by the sequence
listed in the Axis1 Axis2 and Axis3 properties.

3 If you have measured data and you would like to drive the model
you can use an AnyKinEqinterpolDriver for this purpose.

I would recommend to create the model using the FrePostureMove model
as the basis. Then replace the bodymodel FullBodyModel listed by the
SpineRightArm model. Trying to load this model will give you
multiple errors you will need to get rid of drivers for the
bodyparts which was removed, and so on.

Once the model is running you should starts following the three
steps for each joint. The file Jnt.any contains the current joint of
the model and possible you can use some of them without change.

I hope this helps you move on, otherwise please write again.

The above steps requires some knowledge of AnyScript, if needed
www.anybodytech.com

Best regards
SÃ¸ren , AnyBody support

— In anyscript@yahoogroups.com, “Ali” <aliniku@…> wrote:
>
>
> Hi,
>
> I asked later a question about how to import kinematic data to
> AnyBody model, and received the answers but they didn’t help much.
> Now, let me explain my questions in more detail:
> My final aim is to calculate muscle forces in shoulder and arm
region
> using the in vivo measurements.
> First thing I want to know is that if I should use the ‘Arm3D’ in
> the ‘Brep’ repository or something else in the ‘Arep’ directory?
> Second, I recorded the marker data during different movements
(e.g.
> abduction, flexion, etc) for each time step during the subject
> movement; then, for each movement, I calculated the Cardan (or
Euler)
> angles at each joint (e.g. SC joint, AC joint, Elbow joint, etc)
> based on ISB recommendations for upper extremity (Wu et al, 2005);
> please kindly explain me step by step (or guide me to some
> references) how to apply these joint angles to drive the model and
to
> calculate the muscle forces?
>
>
> Best regards,
> Ali
>

— In anyscript@yahoogroups.com, “Ali” <aliniku@…> wrote:
>Hi Ali,
My name is Pierre-Olivier Lemieux. I’m a canadian student from
the ‘Ã‰cole de technologie supÃ©rieure’ school. I’m actually working
with the shoulder too and i’ve construct a model from the ‘Arm3D’
directory in ‘BRep’. My model use kinematic data of viapoints to drive
the deltoid muscle position. Of my point of view, it is possible to
drive the shoulder (more precisely the humerus) by kinematic data. To
do this, you have to refer to the ‘gait3D’ model in ‘ARep’. If you
have not check this model, just take a quick look on it. Actually,
it’s pretty simple to copy some code lines from this file to construct
yours.

I don’t know if you’re beging with the software, then I give you some

First, you have to link the different parts of the code together by
creating a new ‘.main’ program (please refer to the tutorial). A
frequent error that occur at this point is the kinematic conditions.
The fact is that you have to create the same number of constraints and
degree of freedom, in order to make your model works. That can be done
by creating a ‘JointsAndDrivers’ file that you wil refer to your
‘main’ file later.

An other thing to do is to create the code line that will retreive the
data. The file ‘markerdata’ is the ‘cornerstone’ that you need. Here
is the way that i’ve used :

AnySeg Humerus ={ // the name ‘Humerus’ is just an exemple

``````AnyString datafile="your_filename.txt"; //

AnyFunInterpol MarkerData = {
Type=Bspline;
BsplineOrder = 8;
FileName =datafile;//ref to the name of the data file to use
};

r0 = MarkerData(Main.MyStudy.tStart);
Mass = 'mass of your segment';
Jii= 'moment of inertia of your segment';

...

AnyKinLinear Lin={
AnyRefFrame &ref1= 'You will have to find/change this ref';
AnyRefFrame &ref2= 'You will have to find/change this ref';
};

AnyKinRotational Rot={
AnyRefFrame &ref1= 'You will have to find/change this ref';
AnyRefFrame &ref2= 'You will have to find/change this ref';
Type=RotVector;
};

AnyKinEqInterPolDriver LinDrv={
AnyKinLinear &ref1= .Lin;
//Type=PiecewiseLinear;
//Type=Bezier;
Type=Bspline;
BsplineOrder = 8;
FileName =.datafile;//refto the name of the data file to use
};

AnyKinEqSimpleDriver RotDrv={
AnyKinRotational &ref1= .Rot;
DriverPos={0,0,0};
DriverVel={0,0,0};
};

...
``````

};

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Your case is for angles, instead of points. Then, it makes the problem
much more complicated. Unfortunately, I don’t have any idea about how
to do this.

I hope this answer will helps you a little bit.

Best regards.

Pierre-Olivier

>
> Hi,
>
> I asked later a question about how to import kinematic data to
> AnyBody model, and received the answers but they didn’t help much.
> Now, let me explain my questions in more detail:
> My final aim is to calculate muscle forces in shoulder and arm region
> using the in vivo measurements.
> First thing I want to know is that if I should use the ‘Arm3D’ in
> the ‘Brep’ repository or something else in the ‘Arep’ directory?
> Second, I recorded the marker data during different movements (e.g.
> abduction, flexion, etc) for each time step during the subject
> movement; then, for each movement, I calculated the Cardan (or Euler)
> angles at each joint (e.g. SC joint, AC joint, Elbow joint, etc)
> based on ISB recommendations for upper extremity (Wu et al, 2005);
> please kindly explain me step by step (or guide me to some
> references) how to apply these joint angles to drive the model and to
> calculate the muscle forces?
>