FootPlateConditionalContact

FootPlateConditionalContact#

Creates a GRF prediction force plate

Listing 4 Include this file this file to use#
#include "<AMMR_TOOLS>\GRFPrediction/FootPlateConditionalContact.any"`

#FootPlateConditionalContact#

The class template generates the conditional-contact code which links the foot to the ground. The class needs a few important arguments: The ground plane (PLATE_BASE_FRAME) is a reference system where the ground plane is located.

Together with arguments NORMAL_DIRECTION this specifies the surface the model is walking on. Another important argument is the NODES_FOLDER, which is a folder that contains all the contacts points.

The contact points can be created manually, but to avoid this we use another class-template (CreateFootContactNodes25) to create the nodes automatically. As the name says it creates 25 nodes in the foot coordinate system. This part is specific to the model implementation. One could also imagine class-templates that produce a higher number of nodes or nodes in positions that corresponds to particular shoes or on other body parts.

Example

The following example is from the model repository.

 FootPlateConditionalContact GRF_Prediction_Right (
   NORMAL_DIRECTION = "Y",
   NUMBER_OF_NODES = 25,
   NODES_FOLDER = FootNodes,
   SHOW_TRIGGER_VOLUME = ON,
   PLATE_BASE_FRAME = Main.EnvironmentModel.GlobalRef 
 ) =
 {
   CreateFootContactNodes25 FootNodes (
      foot_ref = Main.HumanModel.BodyModel.Right.Leg.Seg.Foot
   ) = {};
   Settings.LimitDistHigh = 0.015; // Vertical height
 };

Full signature

FootPlateConditionalContact <ObjectName>(
  NORMAL_DIRECTION="Z",
  NUMBER_OF_NODES=1,
  PLATE_BASE_FRAME=Main.EnvironmentModel.GlobalRef,
  SHOW_TRIGGER_VOLUME=0,
  GLOBAL_REF=Main.EnvironmentModel.GlobalRef,
) = {
  Settings = { 
    AnyComponentDefinition CDef = {
    SubGroupRegexSearch = "([_[:alnum:]]+?)\.([_[:alnum:]]+?)";
  };

  NODES_FOLDER = { 
    AnyRefFrame Node## = <...>; (NUMBER_OF_NODES)
  };
};

Arguments

__CLASS__:

AnyFolder

NORMAL_DIRECTION:

Defines the normal direction of the ground plane the in PLATE_BASE_FRAME coordinate system. (Default: “Z”)

NUMBER_OF_NODES:

The number of contact nodes to expect within NODE_BASE_FRAME (Default: 1)

PLATE_BASE_FRAME:

Is a AnyRefFrame object where the ground planes is attached. (Default: Main.EnvironmentModel.GlobalRef)

SHOW_TRIGGER_VOLUME:

Visualize the volume where contacts may be triggered. (Default: 0)

GLOBAL_REF:

The global reference. This must be set if the global reference is not Main.EnvironmentModel.GlobalRef (Default: Main.EnvironmentModel.GlobalRef)

Expected members

Settings = { 
  AnyComponentDefinition CDef = {
    SubGroupRegexSearch = "([_[:alnum:]]+?)\.([_[:alnum:]]+?)";
};

/ Lower bound of the contact detection volume. #var AnyVar LimitDistLow = DesignVar(-0.10); FootPlateConditionalContact.Settings / Upper bound of the contact detection volume. #var AnyVar LimitDistHigh = DesignVar(0.04); FootPlateConditionalContact.Settings / Velocity threshold for contact detection. #var AnyVar LimitVelHigh = DesignVar(0.8); FootPlateConditionalContact.Settings / The size of the contact detection area. #var AnyVar Radius = DesignVar(1000); FootPlateConditionalContact.Settings / Strength of the contact elements. #var AnyVar Strength = DesignVar(200); FootPlateConditionalContact.Settings / Friction coefficient of the contact elements. / This adds limits to the amount of friction force / which can be recruited. #var AnyVar FrictionCoefficient = DesignVar(0.5);

#var AnyVar ScaleFactor = DesignVar(1);

FootPlateConditionalContact.Settings / Scale factor for the drawing of the GRF force vector. #var AnyVar ForceVectorDrawScaleFactor = DesignVar(0.0005); FootPlateConditionalContact.Settings / The ground velocity in the global reference system. #var AnyVec3 GroundVelocity = {0, 0, 0};

};

NODES_FOLDER = { 
  AnyRefFrame Node## = <...>; (NUMBER_OF_NODES)
};

A number of AnyRefFrame objects used for the contact detection.

Optional initialization members

Settings.LimitDistLow = DesignVar(-0.10);
class type:

AnyVar

Lower bound of the contact detection volume.

Settings.LimitDistHigh = DesignVar(0.04);
class type:

AnyVar

Upper bound of the contact detection volume.

Settings.LimitVelHigh = DesignVar(0.8);
class type:

AnyVar

Velocity threshold for contact detection.

Settings.Radius = DesignVar(1000);
class type:

AnyVar

The size of the contact detection area.

Settings.Strength = DesignVar(200);
class type:

AnyVar

Strength of the contact elements.

Settings.FrictionCoefficient = DesignVar(0.5);
class type:

AnyVar

Friction coefficient of the contact elements. This adds limits to the amount of friction force which can be recruited.

Settings.ForceVectorDrawScaleFactor = DesignVar(0.0005);
class type:

AnyVar

Scale factor for the drawing of the GRF force vector.

Settings.GroundVelocity = {0, 0, 0};
class type:

AnyVec3

The ground velocity in the global reference system.

NODES_FOLDER.y = .OnOff;
class type:

Opacit

A number of AnyRefFrame objects used for the contact detection. AnyRefFrame Node## = <…>; (NUMBER_OF_NODES)

–>Code for calculating COP #include “FootPlateConditionalContact_ForceMomentMeasure.any” ForceMomentMeasure_multiple ForceMomentMeasure_Auto(NODES = NUMBER_OF_NODES ) = {}; #include “FootPlateConditionalContact_ForceMomentMeasure_Manual.any”

AnyVar Fx = ForceMomentMeasure_Auto.Fx_On_Human; AnyVar Fy = ForceMomentMeasure_Auto.Fy_On_Human; AnyVar Fz = ForceMomentMeasure_Auto.Fz_On_Human; AnyVar Mx = ForceMomentMeasure_Auto.Mx_On_Human; AnyVar My = ForceMomentMeasure_Auto.My_On_Human; AnyVar Mz = ForceMomentMeasure_Auto.Mz_On_Human;

#if NORMAL_DIRECTION == “X” AnyVar Fxx =iffun(gtfun(abs(Fx),0.0), Fx, Fx+1e10); AnyVar Rx = 0; AnyVar Ry = -Mz/Fxx; AnyVar Rz = My/Fxx;
AnyVar OnOff = iffun(gtfun(abs(Fx), 10.0), 1.0, 0.0); #endif

#if NORMAL_DIRECTION == “Y” AnyVar Fyy =iffun(gtfun(abs(Fy),0.0), Fy, Fy+1e10); AnyVar Rx = Mz/Fyy; AnyVar Ry = 0; AnyVar Rz = -Mx/Fyy; AnyVar OnOff = iffun(gtfun(abs(Fy), 10.0), 1.0, 0.0); #endif

#if NORMAL_DIRECTION == “Z” AnyVar Fzz =iffun(gtfun(abs(Fz),0.0), Fz, Fz+1e10); AnyVar Rx = -My/Fzz; AnyVar Ry = Mx/Fzz; AnyVar Rz = 0; AnySwitch OnOff = iffun(gtfun(abs(Fz), 10.0), 1, 0); AnyIntVar OnOff = iffun(gtfun(abs(Fz), 10.0), 1, 0) ; #endif

AnyFloat RGlobal = transf3D({Rx,Ry,Rz},&PlateBaseFrame); AnyFloat FGlobal = {Fx,Fy,Fz}*PlateBaseFrame.Axes’; GRF_line. AnyDrawLine GRF_line= { AnyRefFrame & ref = .PlateBaseFrame; p0 = { .Rx, .Ry, .Rz}; p1 = p0 + 0.001 * {.Fx, .Fy, .Fz} ; Line.Thickness = 0.01; Line.RGB = {1, 0, 0}; GlobalCoord=Off;