Angle driven model

Hello everyone!

My name is Anze and I am pretty new to Anybody.

I would like to drive a human model doing a squat exercise in 2D. For input I have angles in ankle and angles in knee from time 0s to time 2s.

Which driver should I use and how to input this time dependent data?

Can thorax be driven in a way that the body has a constant center of pressure? Or is it possible to just exclude thorax and still do the inverse dynamics analysis?

Thank you all!

Anze

Hi Anze,

You can use AnyKinEqInterpolDriver for defining such behaviour:


  AnyKinEqInterPolDriver <ObjectName> = 
  {
    //RefFrames = ;
    //Surfaces = ;
    //KinMeasureArr = ;
    //KinMeasureIndexArr = ;
    //MeasureOrganizer = ;
    //CType = ;
    //WeightFun = ;
    Type = ;
    //BsplineOrder = 4;
    //T = ;
    //Data = ;
    //FileName = "";
    //FileErrorContinueOnOff = Off;
    //AnyKinMeasure &<Insert name0> = <Insert object reference (or full object definition)>; You can make any number of these objects!
  };

Please check the repository for the usage example, e.g.:
Examples\MoCapModel\Model\JointsAndDriversOptimized.any
Examples\Egress\Model\JointsAndDrivers.any

CoP constraint is used in, for example, StandingModel. Please check JointsAndDrivers.any file in the Model folder:

  //Constraint the collective CoM to be right above the GlobalRef
  AnyKinEqSimpleDriver CoMDriver = {
    AnyKinCoM CoM = {
      AnyFolder &Body = Main.Model.HumanModel;
    };
    MeasureOrganizer = {0,2};  // Only the x and z directions
    DriverPos = {0,0};
    DriverVel = {0,0};
    Reaction.Type = {Off,Off};
  };  

Hope this helps.

Regards,
Pavel

Thank you Pavel. I will get right into it!

Hello again.

As Pavel proposed I have used AnyKinEqInterpolDriver, put the .txt files for input and it is all working as it should.

Next problem is when I try to put that driver in the Standing model (for both legs) for example for the HipFlexion I get two additional constraints. I have tried getting rid of the existing ones

Main.Model.ModelEnvironmentConnection.Drivers.HipDriverRight (3constr.) Segments(2): PelvisSeg Thigh and
Main.Model.ModelEnvironmentConnection.Drivers.HipDriverLeft (3constr.) Segments(2): PelvisSeg Thigh

but I can’t make it. Is it even possible to just comment out one of the properties (HipFlexion) of the HipDriver?

And is it possible to control the movement of this pre-existing model with my input?

Thank you!

Anze

Hi Anze,

You just need to remove the existing driver from the model (since you have knee/ankle data - you need to modify knee/ankle drivers). There are a couple of ways to do it - you can simply delete/outcomment the driver from the code:

 In Model/RightLegTDDrivers.any (and correspondingly LeftLegTDDrivers.any):
  //Knee driver
  AnyKinEqSimpleDriver KneeDriverRight={
    AnyKinMeasureOrg  &Knee = ...HumanModel.Interface.Right.KneeFlexion;
    DriverPos=pi/180*{.JntPos.Right.KneeFlexion};  
    DriverVel = pi/180*{.JntVel.Right.KneeFlexion};  
    Reaction.Type={Off};
  };
  
  //Ankle driver
  AnyKinEqSimpleDriver AnkleDriverRight={
    AnyKinMeasureOrg &ref1=...HumanModel.Interface.Right.AnklePlantarFlexion;
    AnyKinMeasureOrg &ref2=...HumanModel.Interface.Right.SubTalarEversion;
    DriverPos = pi/180*{.JntPos.Right.SubTalarEversion};  
    DriverVel=pi/180*{.JntVel.Right.SubTalarEversion};  
    Reaction.Type={Off};
    MeasureOrganizer={1};
  };

or you can learn about MechObjectExclude feature, which allows to exclude mechanical objects from your particular study, but keeping the definition in the model. This way you can simply add new drivers on top of existing ones and then configure your particular study.

But otherwise it should be quite simple - if your remove a driver for a single DoF, then one driver needs to be added to the relevant structure.

Kind regards,
Pavel

Thank you Pavel you have been very helpful.

I have another question, though. In the attachment, you can see muscles vastus lateralis and my question is why are there several 0 values for all the muscles?

Hi Anze,

Please have a look at this post. This answer will apply to you too.

Kind regards,
Pavel