RangeOfMotionLimits_template

RangeOfMotionLimits_template#

Create joint limits as soft kinematic constraints given some range of motion.

Listing 9 Include this file this file to use#
#include "<AMMR_TOOLS>\ModelUtilities/KinematicLimits/RangeOfMotionLimits_template.any"`

#RangeOfMotionLimits#

The class creates a set of limits (soft kinematic constraints) for the human model given some range of motion.

The class template should be used after the human model is included in the model. This ensures that all the BM_* statements are defined.

Note

Make sure the Limit drivers are included in your study. Otherwise they will have no effect.

Example

RangeOfMotionLimits RoMLimits(
   ARM_RIGHT = BM_ARM_RIGHT,
   ARM_LEFT = BM_ARM_LEFT,
   LEG_RIGHT = BM_LEG_RIGHT,
   LEG_LEFT = BM_LEG_LEFT
) = {
   // Example of changing af few of the limits:
   Limits.Trunk.PelvisThoraxExtension = {-90, 90};
   Limits.Right.ElbowPronation = {-90, 90};
}; 

If some joint should not have a range of motion limits, the class accepts arguments for disabling individual joint limits:

  RangeOfMotionLimits RoMLimits(
    PELVIS_THORAX_LATERAL_BENDING = "Off"
    ... 

Full signature

RangeOfMotionLimits <ObjectName>(
  ARM_RIGHT=<required>,
  ARM_LEFT=<required>,
  LEG_RIGHT=<required>,
  LEG_LEFT=<required>,
  PELVIS_THORAX_EXTENSION="On",
  PELVIS_THORAX_LATERAL_BENDING="On",
  PELVIS_THORAX_ROTATION="On",
  SKULL_THORAX_FLEXION="On",
  SKULL_THORAX_LATERALBENDING="On",
  SKULL_THORAX_ROTATION="On",
  STERNO_CLAVICULAR_PROTRACTION="On",
  STERNO_CLAVICULAR_ELEVATION="On",
  STERNO_CLAVICULAR_AXIALROTATION="Off",
  GLENOHUMERAL_FLEXION="On",
  GLENOHUMERAL_EXTERNAL_ROTATION="On",
  GLENOHUMERAL_ABDUCTION="On",
  ELBOW_FLEXION="On",
  ELBOW_PRONATION="On",
  WRIST_FLEXION="On",
  WRIST_ABDUCTION="On",
  HIP_ABDUCTION="On",
  HIP_FLEXION="On",
  HIP_EXTERNAL_ROTATION="On",
  KNEE_FLEXION="On",
  ANKLE_PLANTAR_FLEXION="On",
  SUBTALAR_EVERSION="On",
  HUMAN_MODEL=Main.HumanModel,
) = {
  Limits.Trunk = { 
    AnyFolder Right = {
         //RangeOfMotionLimits.Limits.Right
         /// The limits for SternoClavicularProtraction
         #var AnyVector SternoClavicularProtraction    = DesignVar({-23-20,  -23+20});
  };

  Limits.Right = { 
    AnyFolder Left = {
         //RangeOfMotionLimits.Limits.Left
         /// The limits for SternoClavicularProtraction
         #var AnyVector SternoClavicularProtraction    = DesignVar({-23-20,  -23+20});
  };

  Limits.Left = { 
    AnyFolder Trunk = {
       #if PELVIS_THORAX_EXTENSION == "On" 
       AnyFolder PelvisThoraxExtension = 
       {
          KinLimitsDriver Driver(
             KinMeasure= ...InterfaceRef.Trunk.PelvisThoraxExtension
          ) =  { LowerLimit =...Limits.Trunk.PelvisThoraxExtension[0]; HighLimit = ...Limits.Trunk.PelvisThoraxExtension[1]; MeasureConversion=180/pi; };
  };
};

Arguments

__CLASS__:

AnyFolder

ARM_RIGHT:

Indicate if the right arm should be included in the limits. Set this to BM_ARM_RIGHT to make it follow the body config (Required)

ARM_LEFT:

Indicate if the left arm should be included in the limits. Set this to BM_ARM_LEFT to make it follow the body config (Required)

LEG_RIGHT:

Indicate if the right leg should be included in the limits. Set this to BM_LEG_RIGHT to make it follow the body config (Required)

LEG_LEFT:

Indicate if the left leg should be included in the limits. Set this to BM_LEG_LEFT to make it follow the body config (Required)

PELVIS_THORAX_EXTENSION:

Enables/disables limits for the pelvis thorax extension (Default: “On”)

PELVIS_THORAX_LATERAL_BENDING:

Enables/disables limits for the pelvis thorax lateral bending (Default: “On”)

PELVIS_THORAX_ROTATION:

Enables/disables limits for the pelvis thorax rotation (Default: “On”)

SKULL_THORAX_FLEXION:

Enables/disables limits for the skull thorax flexion (Default: “On”)

SKULL_THORAX_LATERALBENDING:

Enables/disables limits for the skull thorax lateral bending (Default: “On”)

SKULL_THORAX_ROTATION:

Enables/disables limits for the skull thorax rotation (Default: “On”)

STERNO_CLAVICULAR_PROTRACTION:

Enables/disables limits for the sterno clavicular protraction (Default: “On”)

STERNO_CLAVICULAR_ELEVATION:

Enables/disables limits for the sterno clavicular elevation (Default: “On”)

STERNO_CLAVICULAR_AXIALROTATION:

Enables/disables limits for the sterno clavicular axial rotation (Default: “Off”)

GLENOHUMERAL_FLEXION:

Enables/disables limits for the glenohumeral flexion (Default: “On”)

GLENOHUMERAL_EXTERNAL_ROTATION:

Enables/disables limits for the glenohumeral external rotation (Default: “On”)

GLENOHUMERAL_ABDUCTION:

Enables/disables limits for the glenohumeral abduction (Default: “On”)

ELBOW_FLEXION:

Enables/disables limits for the elbow flexion (Default: “On”)

ELBOW_PRONATION:

Enables/disables limits for the elbow pronation (Default: “On”)

WRIST_FLEXION:

Enables/disables limits for the wrist flexion (Default: “On”)

WRIST_ABDUCTION:

Enables/disables limits for the wrist abduction (Default: “On”)

HIP_ABDUCTION:

Enables/disables limits for the hip abduction (Default: “On”)

HIP_FLEXION:

Enables/disables limits for the hip flexion (Default: “On”)

HIP_EXTERNAL_ROTATION:

Enables/disables limits for the hip external rotation (Default: “On”)

KNEE_FLEXION:

Enables/disables limits for the knee flexion (Default: “On”)

ANKLE_PLANTAR_FLEXION:

Enables/disables limits for the ankle plantar flexion (Default: “On”)

SUBTALAR_EVERSION:

Enables/disables limits for the subtalar eversion (Default: “On”)

HUMAN_MODEL:

The human model to which the limits should be applied. (Default: Main.HumanModel)

Expected members

Limits.Trunk = { 
  AnyFolder Right = {
         //RangeOfMotionLimits.Limits.Right
         /// The limits for SternoClavicularProtraction
         #var AnyVector SternoClavicularProtraction    = DesignVar({-23-20,  -23+20});
};

/ The limits for PelvisThoraxExtension #var AnyVector PelvisThoraxExtension = DesignVar({ -80, 30}); RangeOfMotionLimits.Limits.Trunk / The limits for PelvisThoraxLateralBending #var AnyVector PelvisThoraxLateralBending = DesignVar({ -40, 40}); RangeOfMotionLimits.Limits.Trunk / The limits for PelvisThoraxRotation #var AnyVector PelvisThoraxRotation = DesignVar({-90, 90}); RangeOfMotionLimits.Limits.Trunk / The limits for SkullThoraxFlexion #var AnyVector SkullThoraxFlexion = DesignVar({-70, 70}); RangeOfMotionLimits.Limits.Trunk / The limits for SkullThoraxLateralBending #var AnyVector SkullThoraxLateralBending = DesignVar({-60, 60}); RangeOfMotionLimits.Limits.Trunk / The limits for SkullThoraxRotation #var AnyVector SkullThoraxRotation = DesignVar({-90, 90}); };

Limits.Right = { 
  AnyFolder Left = {
         //RangeOfMotionLimits.Limits.Left
         /// The limits for SternoClavicularProtraction
         #var AnyVector SternoClavicularProtraction    = DesignVar({-23-20,  -23+20});
};

/ The limits for SternoClavicularElevation #var AnyVector SternoClavicularElevation = DesignVar({11.5-11.5, 11.5+70}); RangeOfMotionLimits.Limits.Right / The limits for SternoClavicularAxialRotation #var AnyVector SternoClavicularAxialRotation = DesignVar({-20-5, -20+5}); RangeOfMotionLimits.Limits.Right / The limits for GlenohumeralFlexion #var AnyVector GlenohumeralFlexion = DesignVar({-70, 180}); RangeOfMotionLimits.Limits.Right / The limits for GlenohumeralAbduction #var AnyVector GlenohumeralAbduction = DesignVar({-5, 180}); RangeOfMotionLimits.Limits.Right / The limits for GlenohumeralExternalRotation #var AnyVector GlenohumeralExternalRotation = DesignVar({-50, 50}); RangeOfMotionLimits.Limits.Right / The limits for ElbowFlexion #var AnyVector ElbowFlexion = DesignVar({0, 160}); RangeOfMotionLimits.Limits.Right / The limits for ElbowPronation #var AnyVector ElbowPronation = DesignVar({-90, 90}); RangeOfMotionLimits.Limits.Right / The limits for WristFlexion #var AnyVector WristFlexion = DesignVar({-90, 90}); RangeOfMotionLimits.Limits.Right / The limits for WristAbduction #var AnyVector WristAbduction = DesignVar({-30, 30}); RangeOfMotionLimits.Limits.Right / The limits for HipFlexion #var AnyVector HipFlexion = DesignVar({-30, 100}); RangeOfMotionLimits.Limits.Right / The limits for HipAbduction #var AnyVector HipAbduction = DesignVar({-20, 45}); RangeOfMotionLimits.Limits.Right / The limits for HipExternalRotation #var AnyVector HipExternalRotation = DesignVar({-45, 60}); RangeOfMotionLimits.Limits.Right / The limits for KneeFlexion #var AnyVector KneeFlexion = DesignVar({0, 160}); RangeOfMotionLimits.Limits.Right / The limits for AnklePlantarFlexion #var AnyVector AnklePlantarFlexion = DesignVar({-80, 40}); RangeOfMotionLimits.Limits.Right / The limits for SubTalarEversion #var AnyVector SubTalarEversion = DesignVar({-40, 40}); };

Limits.Left = { 
  AnyFolder Trunk = {
       #if PELVIS_THORAX_EXTENSION == "On" 
       AnyFolder PelvisThoraxExtension = 
       {
          KinLimitsDriver Driver(
             KinMeasure= ...InterfaceRef.Trunk.PelvisThoraxExtension
          ) =  { LowerLimit =...Limits.Trunk.PelvisThoraxExtension[0]; HighLimit = ...Limits.Trunk.PelvisThoraxExtension[1]; MeasureConversion=180/pi; };
};

/ The limits for SternoClavicularElevation #var AnyVector SternoClavicularElevation = DesignVar({11.5-11.5, 11.5+70}); RangeOfMotionLimits.Limits.Left / The limits for SternoClavicularAxialRotation #var AnyVector SternoClavicularAxialRotation = DesignVar({-20-5, -20+5}); RangeOfMotionLimits.Limits.Left / The limits for GlenohumeralFlexion #var AnyVector GlenohumeralFlexion = DesignVar({-70, 180}); RangeOfMotionLimits.Limits.Left / The limits for GlenohumeralAbduction #var AnyVector GlenohumeralAbduction = DesignVar({-5, 180}); RangeOfMotionLimits.Limits.Left / The limits for GlenohumeralExternalRotation #var AnyVector GlenohumeralExternalRotation = DesignVar({-50, 50}); RangeOfMotionLimits.Limits.Left / The limits for ElbowFlexion #var AnyVector ElbowFlexion = DesignVar({0, 160}); RangeOfMotionLimits.Limits.Left / The limits for ElbowPronation #var AnyVector ElbowPronation = DesignVar({-90, 90}); RangeOfMotionLimits.Limits.Left / The limits for WristFlexion #var AnyVector WristFlexion = DesignVar({-90, 90}); RangeOfMotionLimits.Limits.Left / The limits for WristAbduction #var AnyVector WristAbduction = DesignVar({-30, 30}); RangeOfMotionLimits.Limits.Left / The limits for HipFlexion #var AnyVector HipFlexion = DesignVar({-30, 100}); RangeOfMotionLimits.Limits.Left / The limits for HipAbduction #var AnyVector HipAbduction = DesignVar({-20, 45}); RangeOfMotionLimits.Limits.Left / The limits for HipExternalRotation #var AnyVector HipExternalRotation = DesignVar({-45, 60}); RangeOfMotionLimits.Limits.Left / The limits for KneeFlexion #var AnyVector KneeFlexion = DesignVar({0, 160}); RangeOfMotionLimits.Limits.Left / The limits for AnklePlantarFlexion #var AnyVector AnklePlantarFlexion = DesignVar({-80, 40}); RangeOfMotionLimits.Limits.Left / The limits for SubTalarEversion #var AnyVector SubTalarEversion = DesignVar({-40, 40}); };

};



AnyFolder& InterfaceRef = HUMAN_MODEL.BodyModel.Interface;

Optional initialization members

Limits.Trunk.PelvisThoraxExtension = DesignVar({ -80, 30});
class type:

AnyVector

The limits for PelvisThoraxExtension

Limits.Trunk.PelvisThoraxLateralBending = DesignVar({ -40, 40});
class type:

AnyVector

The limits for PelvisThoraxLateralBending

Limits.Trunk.PelvisThoraxRotation = DesignVar({-90, 90});
class type:

AnyVector

The limits for PelvisThoraxRotation

Limits.Trunk.SkullThoraxFlexion = DesignVar({-70, 70});
class type:

AnyVector

The limits for SkullThoraxFlexion

Limits.Trunk.SkullThoraxLateralBending = DesignVar({-60, 60});
class type:

AnyVector

The limits for SkullThoraxLateralBending

Limits.Trunk.SkullThoraxRotation = DesignVar({-90, 90});
class type:

AnyVector

The limits for SkullThoraxRotation

Limits.Right.SternoClavicularProtraction = DesignVar({-23-20, -23+20});
class type:

AnyVector

The limits for SternoClavicularProtraction

Limits.Right.SternoClavicularElevation = DesignVar({11.5-11.5, 11.5+70});
class type:

AnyVector

The limits for SternoClavicularElevation

Limits.Right.SternoClavicularAxialRotation = DesignVar({-20-5, -20+5});
class type:

AnyVector

The limits for SternoClavicularAxialRotation

Limits.Right.GlenohumeralFlexion = DesignVar({-70, 180});
class type:

AnyVector

The limits for GlenohumeralFlexion

Limits.Right.GlenohumeralAbduction = DesignVar({-5, 180});
class type:

AnyVector

The limits for GlenohumeralAbduction

Limits.Right.GlenohumeralExternalRotation = DesignVar({-50, 50});
class type:

AnyVector

The limits for GlenohumeralExternalRotation

Limits.Right.ElbowFlexion = DesignVar({0, 160});
class type:

AnyVector

The limits for ElbowFlexion

Limits.Right.ElbowPronation = DesignVar({-90, 90});
class type:

AnyVector

The limits for ElbowPronation

Limits.Right.WristFlexion = DesignVar({-90, 90});
class type:

AnyVector

The limits for WristFlexion

Limits.Right.WristAbduction = DesignVar({-30, 30});
class type:

AnyVector

The limits for WristAbduction

Limits.Right.HipFlexion = DesignVar({-30, 100});
class type:

AnyVector

The limits for HipFlexion

Limits.Right.HipAbduction = DesignVar({-20, 45});
class type:

AnyVector

The limits for HipAbduction

Limits.Right.HipExternalRotation = DesignVar({-45, 60});
class type:

AnyVector

The limits for HipExternalRotation

Limits.Right.KneeFlexion = DesignVar({0, 160});
class type:

AnyVector

The limits for KneeFlexion

Limits.Right.AnklePlantarFlexion = DesignVar({-80, 40});
class type:

AnyVector

The limits for AnklePlantarFlexion

Limits.Right.SubTalarEversion = DesignVar({-40, 40});
class type:

AnyVector

The limits for SubTalarEversion

Limits.Left.SternoClavicularProtraction = DesignVar({-23-20, -23+20});
class type:

AnyVector

The limits for SternoClavicularProtraction

Limits.Left.SternoClavicularElevation = DesignVar({11.5-11.5, 11.5+70});
class type:

AnyVector

The limits for SternoClavicularElevation

Limits.Left.SternoClavicularAxialRotation = DesignVar({-20-5, -20+5});
class type:

AnyVector

The limits for SternoClavicularAxialRotation

Limits.Left.GlenohumeralFlexion = DesignVar({-70, 180});
class type:

AnyVector

The limits for GlenohumeralFlexion

Limits.Left.GlenohumeralAbduction = DesignVar({-5, 180});
class type:

AnyVector

The limits for GlenohumeralAbduction

Limits.Left.GlenohumeralExternalRotation = DesignVar({-50, 50});
class type:

AnyVector

The limits for GlenohumeralExternalRotation

Limits.Left.ElbowFlexion = DesignVar({0, 160});
class type:

AnyVector

The limits for ElbowFlexion

Limits.Left.ElbowPronation = DesignVar({-90, 90});
class type:

AnyVector

The limits for ElbowPronation

Limits.Left.WristFlexion = DesignVar({-90, 90});
class type:

AnyVector

The limits for WristFlexion

Limits.Left.WristAbduction = DesignVar({-30, 30});
class type:

AnyVector

The limits for WristAbduction

Limits.Left.HipFlexion = DesignVar({-30, 100});
class type:

AnyVector

The limits for HipFlexion

Limits.Left.HipAbduction = DesignVar({-20, 45});
class type:

AnyVector

The limits for HipAbduction

Limits.Left.HipExternalRotation = DesignVar({-45, 60});
class type:

AnyVector

The limits for HipExternalRotation

Limits.Left.KneeFlexion = DesignVar({0, 160});
class type:

AnyVector

The limits for KneeFlexion

Limits.Left.AnklePlantarFlexion = DesignVar({-80, 40});
class type:

AnyVector

The limits for AnklePlantarFlexion

Limits.Left.SubTalarEversion = DesignVar({-40, 40});
class type:

AnyVector

The limits for SubTalarEversion