Excluding SubTalar joint in AnyMoCap model

Continuing the discussion from How to exclude SubTalar joints?:

Hi everyone,

I'm working on a set of c3d files based on the typical Plug-in-Gait markerset, in which the foot segment is represented by only two markers, and therefore I want to exclude to lock the subtalar joint in the model and only allow motions of the foot as ankle plantar/dorsi-flexion.

I did it by including the following code:

Main={
 
  Main.Studies.MarkerTracking = { 

    AnyMechObjectExcluder ExcludeSubTalarsCostraints = {
      Objects = {
         &Main.HumanModel.BodyModel.Right.Leg.Jnt.SubTalar.Constraints,
         &Main.HumanModel.BodyModel.Left.Leg.Jnt.SubTalar.Constraints
      };
    };
  }; 


Main.HumanModel.BodyModel.Right.Leg.Jnt={

  AnyStdJoint LockedSubTalar = {
    AnyRefNode &TalusNode = Main.HumanModel.BodyModel.Right.Leg.Seg.Talus.SubTalarJoint;
    AnyRefNode &FootNode = Main.HumanModel.BodyModel.Right.Leg.Seg.Foot.SubTalarJoint;
  };
};



Main.HumanModel.BodyModel.Left.Leg.Jnt={
  
  AnyStdJoint LockedSubTalar = {
    AnyRefNode &TalusNode = Main.HumanModel.BodyModel.Left.Leg.Seg.Talus.SubTalarJoint;
    AnyRefNode &FootNode = Main.HumanModel.BodyModel.Left.Leg.Seg.Foot.SubTalarJoint;
 }; 
};


 Main.Studies.InverseDynamicStudy= {

    AnyMechObjectExcluder ExcludeSubTalarsConstraints = {
      Objects = {
         &Main.HumanModel.BodyModel.Right.Leg.Jnt.SubTalar.Constraints,
          &Main.HumanModel.BodyModel.Left.Leg.Jnt.SubTalar.Constraints
      };
     };

    AnyMechObjectExcluder ExcludeSubTalarsReactions = {
      Objects = {
         &Main.HumanModel.BodyModel.Right.Leg.Jnt.SubTalar.Constraints.Reaction,
          &Main.HumanModel.BodyModel.Left.Leg.Jnt.SubTalar.Constraints.Reaction
      };
    };

 };
  
}; //Main

I tested it on my own data with 2 foot markers, on another set of data with more foot markers, and also on the AMMR Plug-in-gait_MultiTrial_StandingRef example and it seems ot work well:
Main.Studies.InverseDynamicStudy.Output.BodyModel.*.Leg.InterfaceFolder.SubTalarEversion.Pos is zero throughout the modelled activities.

I originally thought I was meant to change the JointAngleOutputs.any and the JointsAndDriversOptimized.any from the AnyMoCapModel.any file to exclude the subtalar angle entirely from the different studies, but it doesn't seem be to be necessary and this code works well with the AMMR directly from the installation folder without modifying any other file.

The only issue is that, for my own application, it does not work if I run the Parameter Identification on the standing reference trial with the locked subtalar joint.
Either I get this message during the parameter optimization:
WARNING : System is kinematically indeterminateERROR(OBJ.DES2) : AnyMocapModel.any(35) : ParameterIdentification.ParameterOptimization : Optimization failed : Model is kinematically indeterminate
or if the optimization converges and then I run the marker tracking/inverse dynamics on the gait trials I get the following error:
ERROR(OBJ.MCH.KIN3) : AnyMocapModel.any(41) : MarkerTracking.InitialConditions : Kinematic analysis failed in time step 0 : Indefinite positions

As a way around this, I am excluding the subtalar joints only for the dynamic trials and not for the parameter identification of the static trials:

I do not get any errors with the Plug-in-gait_MultiTrial_StandingRef example when excluding the subtalar joint from the standing ref trial. I guess the foot position is pretty similar between the standing ref and the flywheel squat.

If anyone spots any conceptual error or sees any room for improvement, please let me know,
otherwise feel free to use the code above for your own applications as well.

Cheers,
Enrico

Hi Enrico

I think there is a much simpler solution. In ExtraDrivers.any, add a driver that drives the subtalar joint to a fixed angle. Hereby, all 6 dofs between talus and the foot will be locked and they behave as one segment.

In the Inverse dynamics model, change the reaction type for the subtalar driver to On.

Best regards
Michael

1 Like

Thanks Michael!
That is indeed much easier and makes much more sense.

Since in Main.Studies.InverseDynamicStudy.ModelEnvironmentConnection.JointsAndDrivers.JntDriverLeftLegTD the reactions are already defined as Reaction.Type = repmat(nDim, Off)
and I cannot set the type to Reaction.Type = {Off,Off,Off,Off,Off,On} from my application,
I guess that I have to work with a local copy of the AMMR/AnyMoCap Model files and not with the reference to the installation directory, but it's not a big issue.

Thanks again,
Enrico

Hi Enrico,

I guess you could just apply an AnyReacForce on the subtalar joint dof, from your model. In this way you would not need to modify the MocapModel.

Best regards
Søren