# Positions & Drivers

Hi

I have the positions of the elbow and the wrist in the time (files
elbow.txt and wrist.txt).
My movement is 3.28s long and I have 165 positions (50 Hz).
I want to use the model build with the “Getting started with
AnyScript” tutorial.
My mouvement is 3D also I changed the shoulder joint :
Original
AnyRevoluteJoint Shoulder = {
Axis = z;
Modified
AnySphericalJoint Shoulder = {

I don’t know how change the drivers.
My problem is to work with real movements.
My positions are in 2 files like this :
0.000 0.252 -0.310 0.025
0.020 0.254 -0.308 0.026
0.040 0.255 -0.307 0.026
0.060 0.257 -0.305 0.027
0.080 0.259 -0.304 0.028
0.100 0.261 -0.302 0.028
0.120 0.262 -0.301 0.029
0.140 0.264 -0.299 0.029
0.160 0.265 -0.298 0.030
0.180 0.267 -0.296 0.030

The first column is the time, the second is the position of my elbow
along x, the third along y and the fourth along z.
I can change the format of this files and the precision of the
values. I choose to work on a 40cm arm (I modified the script in
this way).
I know that is a simple problem but I’m blocked.
Could someone help me ?

If someone can show me a short example of model using tracking
points (files .txt), I could continue my work and the try of the
AnyBody Modeling System.

Fred

Hi Fred,

Sorry about the belated reply. Easter is upon us so things are
moving a bit slower than usual.

The first thing to do with a model like yours is to get a good count
of the degrees of freedom (DOFs). Your new spherical joint at the
shoulder has three DOFs, and the elbow has one. So the total model
will have four DOFs that you must drive. This means that you need
four marker coordinates, for instance,

• (x,y,z) of the wrist
• Z (lateral) of the elbow.

Here’s a step-by-step procedure:

1. Create two kinematic measures:

2. Save the x y z coordinates of the wrist on a file structured
exactly
as you proposed in your question.

3. Make a similar file but only with time and the z coordinate
For the elbow.

4. Create an AnyKinEqInterPolDriver to drive the kinematic measure
for the wrist position. Instead of the time and data vectors,
simply refer to the file containing the wrist coordinates
using the FileName property.

5. Create an AnyKinEqInterPolDriver to drive the kinematic measure
for the elbow position. However, since you only drive one DOF
for this joint, specify
MeasureOrganizer = {2};
inside the driver. This means that the driver only controls the
third DOF (number 2) of the elbow measure. Refer to the file
containing the elbow coordinates.

Make sure the old drivers have been removed from the model and try
The kinematic analysis. If it fails to work, the most likely
explanation is that the model cannot reach the positions in space
that you have specified in with the marker coordinates.

Best regards,
John,
AnyBody Support

— In anyscript@yahoogroups.com, “fred_puel” <fred_puel@…> wrote:
>
> Hi
>
> I want to modelize a real movement I had already capture.
> I have the positions of the elbow and the wrist in the time (files
> elbow.txt and wrist.txt).
> My movement is 3.28s long and I have 165 positions (50 Hz).
> I want to use the model build with the “Getting started with
> AnyScript” tutorial.
> My mouvement is 3D also I changed the shoulder joint :
> Original
> AnyRevoluteJoint Shoulder = {
> Axis = z;
> Modified
> AnySphericalJoint Shoulder = {
>
> I don’t know how change the drivers.
> My problem is to work with real movements.
> My positions are in 2 files like this :
> 0.000 0.252 -0.310 0.025
> 0.020 0.254 -0.308 0.026
> 0.040 0.255 -0.307 0.026
> 0.060 0.257 -0.305 0.027
> 0.080 0.259 -0.304 0.028
> 0.100 0.261 -0.302 0.028
> 0.120 0.262 -0.301 0.029
> 0.140 0.264 -0.299 0.029
> 0.160 0.265 -0.298 0.030
> 0.180 0.267 -0.296 0.030
> …
> The first column is the time, the second is the position of my
elbow
> along x, the third along y and the fourth along z.
> I can change the format of this files and the precision of the
> values. I choose to work on a 40cm arm (I modified the script in
> this way).
> I know that is a simple problem but I’m blocked.
> Could someone help me ?
>
> If someone can show me a short example of model using tracking
> points (files .txt), I could continue my work and the try of the
> AnyBody Modeling System.
>