Skip to content

Commit

Permalink
feat: Components & Groups w. new Muscle structure in Arms & Legs (#31)
Browse files Browse the repository at this point in the history
* move code block to show muscles first in ModelTree Mus folder

* add bm compatibility define statement

* remove deprecated member for AnyDoc

* reorganize members in the Trunk folder

* disable development object in interpol template

* chore: formatting

* add new component and group templates

* implement templating in trunk muscles

* implement templates for leg muscles

* add new component def for 8.2 versions

* add conditional check for jointMuscles component

* move detailed hand component def

* implement muscle groups in arm model

* add test of bm switch

* fix musclesleft file

* fix muscles right file

* format code

* move abdominal model parts  inside Abdominal folder

* rename deltoid group for consistency

* fix arm calibration study path to muscles

* add musclegroup level to arm output

* update macro for creating arm output variables

* update macro for creating leg output variables

* fix failing airline test model

* chore: changelog entry

* Updated changelog with warning about the muscle location change

* add missing references to leg viapoint muscles

* fix wrong path of muscle ref

* fix merging with latest ammr4.0

* Added section for migration from AMMR 3 in Docs

---------

Co-authored-by: Morten Enemark Lund <[email protected]>
  • Loading branch information
bkje14 and melund authored Dec 11, 2024
1 parent f839a72 commit fc66af9
Show file tree
Hide file tree
Showing 47 changed files with 11,145 additions and 10,651 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Main = {
This is because seats with slippery surfaces reduce the shear force on the
buttocks but in return require vasti muscle acitivity to prevent the body
from sliding forward on the seat pan.*/
AnySearchFun Vastus_Act={ Search = "Main.HumanModel.BodyModel.Right.Leg.Mus.Vastus*.Activity"; };
AnySearchFun Vastus_Act={ Search = "Main.HumanModel.BodyModel.Right.Leg.Mus.Vastus*.*.Activity"; };
AnyFloat Activity = max(Vastus_Act());

/** This variable collects the shear force between the buttocks and the seat
Expand Down
3 changes: 3 additions & 0 deletions Application/Examples/StandingModel/StandingModel.Main.any
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
Main =
{


#define BM_COMPATIBILITY_MUSCLE_STRUCTURE ON

// BodyModel configuration:
#include "Model/BodyModelConfiguration.any"

Expand Down
14 changes: 7 additions & 7 deletions Body/AAUHuman/Arm/Calibration/ArmCal1.any
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ AnyFolder ArmCal1 ={
#endif

#if BM_ARM_DELTOID_WRAPPING == _DELTOID_WRAPPING_RAKE_
AnyMuscleShortestPath &del1 = .SideHumanFolderRef.ShoulderArm.Mus.deltoideus_scapular_part_1;
AnyMuscleShortestPath &del2 = .SideHumanFolderRef.ShoulderArm.Mus.deltoideus_scapular_part_2;
AnyMuscleShortestPath &del3 = .SideHumanFolderRef.ShoulderArm.Mus.deltoideus_scapular_part_3;
AnyMuscleShortestPath &del1 = .SideHumanFolderRef.ShoulderArm.Mus.DeltoideusScapular.deltoideus_scapular_part_1;
AnyMuscleShortestPath &del2 = .SideHumanFolderRef.ShoulderArm.Mus.DeltoideusScapular.deltoideus_scapular_part_2;
AnyMuscleShortestPath &del3 = .SideHumanFolderRef.ShoulderArm.Mus.DeltoideusScapular.deltoideus_scapular_part_3;
#else
AnyMuscleShortestPath &del1 = .SideHumanFolderRef.ShoulderArm.Mus.deltoideus_posterior_part_1;
AnyMuscleShortestPath &del2 = .SideHumanFolderRef.ShoulderArm.Mus.deltoideus_posterior_part_2;
AnyMuscleShortestPath &del3 = .SideHumanFolderRef.ShoulderArm.Mus.deltoideus_posterior_part_3;
AnyMuscleShortestPath &del4 = .SideHumanFolderRef.ShoulderArm.Mus.deltoideus_posterior_part_4;
AnyMuscleShortestPath &del1 = .SideHumanFolderRef.ShoulderArm.Mus.DeltoideusPosterior.deltoideus_posterior_part_1;
AnyMuscleShortestPath &del2 = .SideHumanFolderRef.ShoulderArm.Mus.DeltoideusPosterior.deltoideus_posterior_part_2;
AnyMuscleShortestPath &del3 = .SideHumanFolderRef.ShoulderArm.Mus.DeltoideusPosterior.deltoideus_posterior_part_3;
AnyMuscleShortestPath &del4 = .SideHumanFolderRef.ShoulderArm.Mus.DeltoideusPosterior.deltoideus_posterior_part_4;
#endif

AnyFolder &MusParCalSide = .SideHumanFolderRef.ShoulderArm.MuscleModels;
Expand Down
83 changes: 42 additions & 41 deletions Body/AAUHuman/Arm/EvaluateMomentArmsStudy.any
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ AnyFolder Model = {
AnyFolder &ArmSegSideRef = .SideBodyModelRef.ShoulderArm.Seg;
AnyFolder &ArmJntsRef = .SideBodyModelRef.ShoulderArm.Jnt;
AnyFolder &MusRef = .SideBodyModelRef.ShoulderArm.Mus;


AnyFixedRefFrame ground = {
AnyRefNode node = {
ARel=..ThoraxRef.Axes0;
ARel=..ThoraxRef.Axes0;
sRel=..ThoraxRef.r0;
};
};

AnyKinEq FixSkullThoraxPelvis =
{
AnyKinMeasure& SkullThorax = ......BodyModel.Trunk.Joints.Cervical.SkullThoraxRotMeasure;
Expand All @@ -29,20 +29,20 @@ AnyFolder Model = {
AnyVar AngularVelocity = (..RangeOfMotion[1]-..RangeOfMotion[0])*pi/180;

AnyKinMeasureOrg ArmMeasure = {
#if BM_ARM_SHOULDER_RHYTHM == OFF
AnyKinMeasure& SCProtraction= ...SideBodyInterfaceRef.SternoClavicularProtraction;
AnyKinMeasure& SCElevation= ...SideBodyInterfaceRef.SternoClavicularElevation;
#endif
AnyKinMeasure& GHAbduction= ...SideBodyInterfaceRef.GlenohumeralAbduction;
AnyKinMeasure& GHFlexion= ...SideBodyInterfaceRef.GlenohumeralFlexion;
AnyKinMeasure& GHExternalRotation= ...SideBodyInterfaceRef.GlenohumeralExternalRotation;
AnyKinMeasure& ElbowFlexion= ...SideBodyInterfaceRef.ElbowFlexion;
AnyKinMeasure& ElbowPronation= ...SideBodyInterfaceRef.ElbowPronation;
AnyKinMeasure& WristFlexion= ...SideBodyInterfaceRef.WristFlexion;
AnyKinMeasure& WristAbduction= ...SideBodyInterfaceRef.WristAbduction;
#if BM_ARM_CLAVICULA_ROTATION_RHYTHM == OFF
AnyKinMeasure& ACMedialRotation= ...SideBodyInterfaceRef.AcromioClavicular.MedialRotation;
#endif
#if BM_ARM_SHOULDER_RHYTHM == OFF
AnyKinMeasure& SCProtraction= ...SideBodyInterfaceRef.SternoClavicularProtraction;
AnyKinMeasure& SCElevation= ...SideBodyInterfaceRef.SternoClavicularElevation;
#endif
AnyKinMeasure& GHAbduction= ...SideBodyInterfaceRef.GlenohumeralAbduction;
AnyKinMeasure& GHFlexion= ...SideBodyInterfaceRef.GlenohumeralFlexion;
AnyKinMeasure& GHExternalRotation= ...SideBodyInterfaceRef.GlenohumeralExternalRotation;
AnyKinMeasure& ElbowFlexion= ...SideBodyInterfaceRef.ElbowFlexion;
AnyKinMeasure& ElbowPronation= ...SideBodyInterfaceRef.ElbowPronation;
AnyKinMeasure& WristFlexion= ...SideBodyInterfaceRef.WristFlexion;
AnyKinMeasure& WristAbduction= ...SideBodyInterfaceRef.WristAbduction;
#if BM_ARM_CLAVICULA_ROTATION_RHYTHM == OFF
AnyKinMeasure& ACMedialRotation= ...SideBodyInterfaceRef.AcromioClavicular.MedialRotation;
#endif
};

AnyKinEqSimpleDriver ArmDriver= {
Expand All @@ -62,16 +62,16 @@ AnyFolder Model = {
DriverVel = Mask* (...RangeOfMotion[1]-...RangeOfMotion[0])*pi/180/...Study.tEnd;
};


AnyStdJoint TrunkGround={
AnyRefFrame &Ground = ..ground.node;
AnyRefFrame &Thorax= ..ThoraxRef;
};

AnyStdJoint TrunkGround={
AnyRefFrame &Ground = ..ground.node;
AnyRefFrame &Thorax= ..ThoraxRef;
};
};// Drivers
};// Model


AnyKinStudy Study = {
Gravity = {0,0,0};
#ifdef EVALUATE_MOMENT_ARMS_NSTEP
Expand All @@ -81,35 +81,35 @@ AnyKinStudy Study = {
#endif
Kinematics.SmallStepAssumptionOnOff = Off;
InitialConditions.SmallStepAssumptionOnOff = Off;

AnyFolder &Model = .Model;
AnyOutputFun AngularVelocity_output = {Val = ..Model.Drivers.AngularVelocity;};

AnyFolder MuscleStrengthCalculations = {
AnyFolder Abscissa = {
AnyVar JointAngle = not(not(..Model.Drivers.ArmDriver.DriverVel))*..Model.Drivers.ArmMeasure.Pos'*180/pi ;
};
#define _CODE_MACRO_(name) AnyVar name = ( .Model.MusRef.name.Strength);
#include "armmuscles_for_output.any"
#undef _CODE_MACRO_
#define _CODE_MACRO_(muscle, branch) AnyVar branch = ( ..Model.MusRef.muscle.branch.Strength);
#include "armmuscles_for_output.any"
#undef _CODE_MACRO_
};

AnyFolder PennationAngleCalculations = {
AnyFolder Abscissa = {
AnyVar JointAngle = not(not(..Model.Drivers.ArmDriver.DriverVel))*..Model.Drivers.ArmMeasure.Pos'*180/pi ;
};
#define _CODE_MACRO_(name) AnyVar name = ( .Model.MusRef.name.PennationAngle * 180/pi);
#include "armmuscles_for_output.any"
#undef _CODE_MACRO_
#define _CODE_MACRO_(muscle, branch) AnyVar branch = ( ..Model.MusRef.muscle.branch.PennationAngle * 180/pi);
#include "armmuscles_for_output.any"
#undef _CODE_MACRO_
};

AnyFolder MomentArmCalculations = {
AnyFolder Abscissa = {
AnyVar JointAngle = not(not(..Model.Drivers.ArmDriver.DriverVel))*..Model.Drivers.ArmMeasure.Pos'*180/pi ;
};
#define _CODE_MACRO_(name) AnyVar name = ( -1*.Model.MusRef.name.LmtDot/.Model.Drivers.AngularVelocity);
#include "armmuscles_for_output.any"
#undef _CODE_MACRO_
#define _CODE_MACRO_(muscle, branch) AnyVar branch = ( -1*..Model.MusRef.muscle.branch.LmtDot/..Model.Drivers.AngularVelocity);
#include "armmuscles_for_output.any"
#undef _CODE_MACRO_
};
};

Expand All @@ -122,11 +122,12 @@ AnyProject ModelViews = {};

ModelViews = {
AnyDrawGroup Selection = {
Objects = arrcat(ObjSearchRecursive(CompleteNameOf(&..Model.ThoraxRef), "*", "AnyDrawObject"),
ObjSearchRecursive(CompleteNameOf(&..Model.CervicalSpineSegRef), "*", "AnyDrawObject"),
ObjSearchRecursive(CompleteNameOf(&..Model.SkullRef), "*", "AnyDrawObject"),
ObjSearchRecursive(CompleteNameOf(&..Model.ArmSegSideRef), "*", "AnyDrawObject"),
ObjSearchRecursive(CompleteNameOf(&..Model.MusRef ), "*", "AnyDrawObject"));
Objects = arrcat(
ObjSearchRecursive(CompleteNameOf(&..Model.ThoraxRef), "*", "AnyDrawObject"),
ObjSearchRecursive(CompleteNameOf(&..Model.CervicalSpineSegRef), "*", "AnyDrawObject"),
ObjSearchRecursive(CompleteNameOf(&..Model.SkullRef), "*", "AnyDrawObject"),
ObjSearchRecursive(CompleteNameOf(&..Model.ArmSegSideRef), "*", "AnyDrawObject"),
ObjSearchRecursive(CompleteNameOf(&..Model.MusRef ), "*", "AnyDrawObject"));
};
Views = {
AnyProjectModelViewDefinition SelectedView = {
Expand Down
2 changes: 1 addition & 1 deletion Body/AAUHuman/Arm/LeftArmMusclesSelectedOutput.any
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ SelectedOutput.Left = {
#if BM_ARM_MUSCLES_LEFT == OFF
".....Left.ShoulderArm.JointMuscles.*.*.dof0.Muscle.*.Activity";
#else
".....Left.ShoulderArm.Mus.*.Activity";
".....Left.ShoulderArm.Mus.*.*.Activity";
#endif
};

Expand Down
Loading

0 comments on commit fc66af9

Please sign in to comment.