Model movement problem

Hello,

I have a movement problem with my model. I’m using the FreePostureMove-Model and input joint angles as text-file. My Model is moving, but wrong.

For example the hip: the model should move the upper leg forward (lifting leg), but my model moves it backwards. How and especially where can I change this? The flexion at the knee, for example, is right. So I think I don’t have to change all orientations, but some.

Kind regards.

Hello,

First of all, please, provide your details for us to know who we are dealing with. This is a professional forum and we require this information.

Secondly, could you show how you define your “leg motion”? Could you isolate a problematic degree of freedom? For example, you could change the direction of hip flexion in the relevant Mannequin file :


      AnyVar HipFlexion =[b]-1*[/b](180/pi)*HipRot[0]; 

Kind regards,
Pavel

Dear Pavel,

Thanks for the reply.

When I try this nothing is changing.

Kind regards
Julika

Julika,

Could you help us by providing pieces of code you are using to drive the model?
Which files us are you using?
Could you make a screenshot of the problem? Preferably from a couple of angles to see which degrees of freedom are not being driven correct? I initially assumed it was “hip flexion”, but it might be something else.

Kind regards,
Pavel

Dear Pavel,

I input Joint angles as txt-file.

The Problem is for example at the arms too. At the beginning, the model should spread the arms (Abduction) instead of crossing over. It should be the so-called T-Pose. Afterwards the model stretches the arms to the front.

I also tried to change the axes of the arm (axes1, axes2, axes3 of GHMeasure), then the model abducted both arms, but then the model hasn’t made the next movement with the arms.

Kind regards
Julika

AnyKinEqInterPolDriver GHDriverRight={
 Type = Bspline;
 T = .InterpolShoulderRight.T;
 Data = .InterpolShoulderRight.Data*pi/180 [b]* {{-1,0,0},{0,1,0},{0,0,1}}[/b];
 AnyKinMeasureOrg &ref1
=...HumanModel.Interface.Right.GlenohumeralAbduction;
 AnyKinMeasureOrg &ref2
=...HumanModel.Interface.Right.GlenohumeralFlexion;
 AnyKinMeasureOrg &ref3
=...HumanModel.Interface.Right.GlenohumeralExternalRotation;
 Reaction.Type = {Off,Off,Off};
 };

Could you try fixing it like that?

P.

[SIZE=1]ERROR(SCR.EXP1)[/SIZE] : [SIZE=1]C:/U…s/k…E/D…p/A…x/A…o/A…n/E…s/F…e/JointsAndDrivers_IngressEgress.any[/SIZE] : ‘’ : Illegal operation for given argument types : ‘AnyFloat[3][4681]’ '’ ‘AnyInt[3][3]’

(I defined at the main study: nStep=4681)

Kind regards
Julika

Data = (.InterpolShoulderRight.Data*pi/180 * {{-1,0,0},{0,1,0},{0,0,1}})’;

Now the Start Position ist after clicking run like the picture in the attachment.
It only changes the postition, not the way of moving.

Julika,

I gave you a suggestion on how to fix the problem. From the screenshot i see that it seems to help with the right arm. Please apply the same logic for the left arm and all other problematic places.

Unfortunately I cannot fix everything for you remotely.

Kind regards,
Pavel

Yes, of course. But not the position is the problem, it’s the movement.
How can I define that, for example the tighs, is not moving to the back, but to the front? Somewhere I have to define that the tighs of the model have to move in the other direction. So I have to define that the tighs is not moving (Flexing the hip) 90°, but -90° or not?

Kind regards
Julika

Julika,

Apply the same trick on relevant drivers, e.g. FreePosture\Model\InterpolationDrivers\RightArmDrivers.any:



//Glenohumeral joint 
AnyKinEqInterPolDriver GHDriverRight={
  AnyKinMeasureOrg &ref1 =...HumanModel.Interface.Right.GlenohumeralAbduction;
  AnyKinMeasureOrg &ref2 =...HumanModel.Interface.Right.GlenohumeralFlexion;
  AnyKinMeasureOrg &ref3 =...HumanModel.Interface.Right.GlenohumeralExternalRotation;
  
  Data=(pi/180*{
    .JntPos.Right.GlenohumeralAbductionVec,  //GH joint
    .JntPos.Right.GlenohumeralFlexionVec,  //GH joint
    .JntPos.Right.GlenohumeralExternalRotationVec  //GH joint
  }' * {{-1,0,0},{0,1,0},{0,0,1}})';  
  T=.JntPos.Left.GlenohumeralTime;
  Type=PiecewiseLinear;
  
  Reaction.Type={Off,Off,Off};
};

And same for all other drivers.

I checked it works for me, direction is changed :slight_smile:

P.

So beacause I can’t upload anything at the Moment…

AnyKinEqSimpleDriver 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;
};
DriverPos={0,0,0,0,0,0};
DriverVel={0,0,0,0,0,0};

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

// ************************************
// Drivers for the spine
// ************************************

//Neck driver

AnyFunInterpol InterpolNeck = {
Type = Bspline;
FileName = “C:\Users\kisch.LFE\Desktop\Masterarbeit Julika Kisch\AMMR.v1.5.1-MyDemo\Application\Examples\FreePostureMove\Input\NeckFlexExt.txt”;
};

AnyKinEqInterPolDriver NeckJntDriver = {
Type = Bspline;
T = .InterpolNeck.T;
Data =.InterpolNeck.Data*pi/180;
AnyKinMeasureOrg &ref1 = …HumanModel.Interface.Trunk.NeckJoint;
Reaction.Type = {Off};
};

//Thorax pelvis rotation driver
AnyFunInterpol InterpolPelvis = {
Type = Bspline;
FileName = “C:\Users\kisch.LFE\Desktop\Masterarbeit Julika Kisch\AMMR.v1.5.1-MyDemo\Application\Examples\FreePostureMove\Input\ThoraxPelvis.txt”;
};

AnyKinEqInterPolDriver PostureDriver ={
Type = Bspline;
T = .InterpolPelvis.T;
Data = (.InterpolPelvis.Data’pi/180{{0,0,0},{0,0,0},{0,0,-1}})’;
AnyKinMeasureOrg &Ref2 = …HumanModel.Interface.Trunk.PelvisThoraxLateralBending;
AnyKinMeasureOrg &Ref3 = …HumanModel.Interface.Trunk.PelvisThoraxRotation;
AnyKinMeasureOrg &Ref1 = …HumanModel.Interface.Trunk.PelvisThoraxExtension;
Reaction.Type = {Off,Off,Off};
};

// ************************************
// Drivers for the right arm
// ************************************

//Sterno clavicular joint driver
AnyKinEqSimpleDriver SCDriverRight ={
AnyKinMeasureOrg &ref1 =…HumanModel.Interface.Right.SternoClavicularProtraction;
AnyKinMeasureOrg &ref2 =…HumanModel.Interface.Right.SternoClavicularElevation;
AnyKinMeasureOrg &ref3 =…HumanModel.Interface.Right.SternoClavicularAxialRotation;

DriverPos={0,0,0};
DriverVel={0,0,0};

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

//Glenohumeral joint

AnyFunInterpol InterpolShoulderRight = {
Type = Bspline;
FileName = “C:\Users\kisch.LFE\Desktop\Masterarbeit Julika Kisch\AMMR.v1.5.1-MyDemo\Application\Examples\FreePostureMove\Input\GlenohumeralRight.txt”;
};
AnyKinEqInterPolDriver GHDriverRight={
Type = Bspline;
T = .InterpolShoulderRight.T;
Data =(.InterpolShoulderRight.Data’ pi/180 * {{-1,0,0},{0,1,0},{0,0,1}})’; //{{-1,0,0},{0,1,0},{0,0,1}})’;
AnyKinMeasureOrg &ref1 =…HumanModel.Interface.Right.GlenohumeralAbduction;
AnyKinMeasureOrg &ref2 =…HumanModel.Interface.Right.GlenohumeralFlexion;
AnyKinMeasureOrg &ref3 =…HumanModel.Interface.Right.GlenohumeralExternalRotation;
Reaction.Type = {Off,Off,Off};
};

//Elbow flexion driver
AnyFunInterpol InterpolElbowFlexRight = {
Type = Bspline;
FileName = “C:\Users\kisch.LFE\Desktop\Masterarbeit Julika Kisch\AMMR.v1.5.1-MyDemo\Application\Examples\FreePostureMove\Input\ElbowRightFlexExt.txt”;
};
AnyKinEqInterPolDriver ElbowFlexionDriverRight={
Type = Bspline;
T = .InterpolElbowFlexRight.T;
Data =.InterpolElbowFlexRight.Data*pi/180;
AnyKinMeasureOrg &ref1 =…HumanModel.Interface.Right.ElbowFlexion;
Reaction.Type = {Off};
};

//Elbow pronation driver
AnyFunInterpol InterpolElbowRotRight = {
Type = Bspline;
FileName = “C:\Users\kisch.LFE\Desktop\Masterarbeit Julika Kisch\AMMR.v1.5.1-MyDemo\Application\Examples\FreePostureMove\Input\ElbowRightRotation.txt”;
};
AnyKinEqInterPolDriver ElbowPronationDriverRight={
Type = Bspline;
T = .InterpolElbowRotRight.T;
Data =.InterpolElbowRotRight.Data*pi/180;
AnyKinMeasureOrg &ref1 =…HumanModel.Interface.Right.ElbowPronation;
Reaction.Type = {Off};
};

//Wrist driver

AnyFunInterpol InterpolWristRight = {
Type = Bspline;
FileName = “C:\Users\kisch.LFE\Desktop\Masterarbeit Julika Kisch\AMMR.v1.5.1-MyDemo\Application\Examples\FreePostureMove\Input\WristRight.txt”;
};
AnyKinEqInterPolDriver WristDriverRight ={
Type = Bspline;
T = .InterpolWristRight.T;
Data =.InterpolWristRight.Data*pi/180;
AnyKinMeasureOrg &ref1 =…HumanModel.Interface.Right.WristFlexion;
AnyKinMeasureOrg[SIZE=2] &ref2 =…HumanModel.Interface.Right.WristAbduction;
Reaction.Type = {Off,Off};
};
[/SIZE]

AnyFolder &JointPos=InterpolationFunctions;

AnyFolder InitialPositionValues={

AnyFolder Posture ={
AnyVector PelvisPos= …JointPos.PelvisGroundFunction(Main.Study.tStart);
AnyVar PelvisPosX=PelvisPos[0];
AnyVar PelvisPosY=PelvisPos[1];
AnyVar PelvisPosZ=PelvisPos[2];
AnyVar PelvisRotZ=(180/pi)*PelvisPos[3];
AnyVar PelvisRotY=(180/pi)*PelvisPos[4];
AnyVar PelvisRotX=(180/pi)*PelvisPos[5];

//Thorax
AnyVector PelvisThorax= …JointPos.PostureFunction(Main.Study.tStart);
AnyVar PelvisThoraxLateralBending=PelvisThorax[0];
AnyVar PelvisThoraxRotation=PelvisThorax[1];
AnyVar PelvisThoraxExtension=PelvisThorax[2];

AnyVector NeckExt=…JointPos.NeckFunction(Main.Study.tStart);
AnyVar NeckExtension=(180/pi)*NeckExt[0];
//Right leg
AnyFolder Right={
AnyVector Hip= …JointPos.HipFunctionRight(Main.Study.tStart);

AnyVar HipFlexion=(180/pi)*Hip[0];
AnyVar HipExternalRotation=(180/pi)*Hip[1];
AnyVar HipAbduction=(180/pi)*Hip[2];

//shank
AnyVector KneeFE=…JointPos.KneeFunctionRight(Main.Study.tStart);
AnyVar KneeFlexion=(180/pi)*KneeFE[0];

//Foot
AnyVector Ankle= …JointPos.AnkleFunctionRight(Main.Study.tStart);
AnyVar AnklePlantarFlexion=(180/pi)*Ankle[0];
AnyVar AnkleEversion=(180/pi)*Ankle[1];

//right humerus
AnyVector Glenohumeral= …JointPos.GHFunctionRight(Main.Study.tStart);
AnyVar GlenohumeralAbduction=(180/pi)*Glenohumeral[0];
AnyVar GlenohumeralFlexion=(180/pi)*Glenohumeral[1];
AnyVar GlenohumeralExternalRotation=(180/pi)*Glenohumeral[2];

//right ulna
AnyVector ElbowFE=…JointPos.ElbowFlexionFunctionRight(Main.Study.tStart);
AnyVar ElbowFlexion=(180/pi)*ElbowFE[0];

//right Radius
AnyVector ElbowPS=…JointPos.ElbowPronationFunctionRight(Main.Study.tStart);
AnyVar ElbowPronation=(180/pi)*ElbowPS[0];

//right hand
AnyVector Wrist= …JointPos.WristFunctionRight(Main.Study.tStart);
AnyVar WristFlexion=(180/pi)*Wrist[0];
AnyVar[SIZE=2] WristAbduction=(180/pi)*Wrist[1];
};
[/SIZE]