Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master-ammr-2.5' into no-leg-imp…
Browse files Browse the repository at this point in the history
…rovements
  • Loading branch information
melund committed Jun 8, 2023
2 parents 5f496a1 + db115bb commit 09c77a6
Show file tree
Hide file tree
Showing 1,397 changed files with 20,448 additions and 12,009 deletions.
4 changes: 2 additions & 2 deletions Application/Examples/FreePosture/Model/JointsAndDrivers.any
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ AnyFolder Drivers = {
#endif


#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM1_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#include "RightLegTDDrivers.any"
#endif


#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_)
#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM1_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_)
#include "LeftLegTDDrivers.any"
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ AnyFolder Drivers = {
#endif


#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_)
#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM1_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_)
#include "ConstantDrivers/RightLegTDDrivers.any"
#else
#endif


#if BM_LEG_LEFT & (BM_LEG_MODEL == _LEG_MODEL_TLEM_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_)
#if BM_LEG_LEFT & (BM_LEG_MODEL == _LEG_MODEL_TLEM1_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_)
#include "ConstantDrivers/LeftLegTDDrivers.any"
#else
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ AnyFolder Drivers = {
#endif


#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM1_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#include "InterpolationDrivers/RightLegTDDrivers.any"
#else
#endif


#if BM_LEG_LEFT & (BM_LEG_MODEL == _LEG_MODEL_TLEM_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#if BM_LEG_LEFT & (BM_LEG_MODEL == _LEG_MODEL_TLEM1_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#include "InterpolationDrivers/LeftLegTDDrivers.any"
#else
#endif
Expand Down
4 changes: 2 additions & 2 deletions Application/Examples/ShoulderBag/Model/JointsAndDrivers.any
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ AnyFolder Drivers = {
#endif


#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM1_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#include "RightLegTDDrivers.any"
#else
#endif


#if BM_LEG_LEFT & (BM_LEG_MODEL == _LEG_MODEL_TLEM_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#if BM_LEG_LEFT & (BM_LEG_MODEL == _LEG_MODEL_TLEM1_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#include "LeftLegTDDrivers.any"
#else
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// RIGHT FACET
AnyKinPointSurface PointSurfaceMeasureR =
{
NormedMeasureOnOff = Off;
// Central
AnyRefFrame &PC1 = .seg1.FSRp1;
AnyRefFrame &PC2 = .seg1.FSRp2;
Expand Down Expand Up @@ -102,7 +101,6 @@
// LEFT FACET
AnyKinPointSurface PointSurfaceMeasureL =
{
NormedMeasureOnOff = Off;
// Central
AnyRefFrame &PC1 = .seg1.FSLp1;
AnyRefFrame &PC2 = .seg1.FSLp2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ HUMAN_MODEL.Trunk = {#include "<ANYBODY_PATH_BODY>/Trunk/NodeForScalingExt.any"}
HUMAN_MODEL.Right.ShoulderArm.Seg = {#include "<ANYBODY_PATH_BODY>/Arm/NodeForScalingExt.any"};
HUMAN_MODEL.Left.ShoulderArm.Seg = {#include "<ANYBODY_PATH_BODY>/Arm/NodeForScalingExt.any"};

#if (BM_LEG_MODEL == _LEG_MODEL_TLEM_) | (BM_LEG_MODEL == _LEG_MODEL_TLEM2_)
#if (BM_LEG_MODEL == _LEG_MODEL_TLEM1_) | (BM_LEG_MODEL == _LEG_MODEL_TLEM2_)
HUMAN_MODEL.Right.Leg.Seg = {#include "<ANYBODY_PATH_BODY>/LegTLEM/NodeForScalingExt.any"};
HUMAN_MODEL.Left.Leg.Seg = {#include "<ANYBODY_PATH_BODY>/LegTLEM/NodeForScalingExt.any"};
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ AnyFolder Drivers = {
#endif


#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM1_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#include "RightLegTDDrivers.any"
#endif


#if BM_LEG_LEFT & (BM_LEG_MODEL == _LEG_MODEL_TLEM_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#if BM_LEG_LEFT & (BM_LEG_MODEL == _LEG_MODEL_TLEM1_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_ )
#include "LeftLegTDDrivers.any"
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Main = {

//Body model configuration settings
#define BM_MANNEQUIN_DRIVER_DEFAULT ON
#define BM_LEG_RIGHT _LEG_MODEL_TLEM_
#define BM_LEG_LEFT _LEG_MODEL_TLEM_
#define BM_LEG_RIGHT _LEG_MODEL_TLEM1_
#define BM_LEG_LEFT _LEG_MODEL_TLEM1_
#define BM_LEG_MODEL _LEG_MODEL_TLEM2_

#define BM_ARM_THORAX_SCAPULA_CONTACT _MULTIPLE_POINT_CONTACT_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// This model was developed based on the original Klein-Horsman dataset, do not change
#define BM_SCALING _SCALING_NONE_
#define BM_LEG_MODEL _LEG_MODEL_TLEM_
#define BM_LEG_MODEL _LEG_MODEL_TLEM1_

// do not use arms
#define BM_ARM_LEFT OFF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ AnyFolder Drivers = {
#endif


#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_)
#if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_TLEM1_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_)
#include "RightLegTDDrivers.any"
#else
#endif


#if BM_LEG_LEFT & (BM_LEG_MODEL == _LEG_MODEL_TLEM_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_)
#if BM_LEG_LEFT & (BM_LEG_MODEL == _LEG_MODEL_TLEM1_ | BM_LEG_MODEL == _LEG_MODEL_TLEM2_)
#include "LeftLegTDDrivers.any"
#else
#endif
Expand Down
16 changes: 8 additions & 8 deletions Application/MocapExamples/ADL_Gait_[beta]/C3DSettings.any
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@ Main.ModelSetup.C3DFileData = {


#ifndef REFERENCE_TRIAL
// Filter are disabled, since trajectories and analog data is
// Filters are disabled, since trajectories and analog data is
// already filtered in the underlying dataset.
// From the paper:
//"trajectories were smoothed using a 4th order Butterworth low pass filter
// with a 6 Hz cut off frequency. Ground reaction forces and moments (expressed
// in N and N.mm, respectively) were smoothed using a 2th order Butterworth low
// pass filter with a 15 Hz cut-off frequency"
MarkerFilterIndex = -1;
AnalogFilterIndex = -1;
AnalogFilterIndex ??= -1;
MarkerFilterIndex ??= -1;
#endif



MarkerBsplineOrder = 4;

// Filter = {
// N = Main.ModelSetup.LabSpecificData.LowPassFilterSettings.MarkerFilterOrder;
// Fc = {Main.ModelSetup.LabSpecificData.LowPassFilterSettings.MarkerFilterCutOffFrequency};
// Type = LowPass;
// };
Filter = {
N = Main.ModelSetup.LabSpecificData.LowPassFilterSettings.MarkerFilterOrder;
Fc = {Main.ModelSetup.LabSpecificData.LowPassFilterSettings.MarkerFilterCutOffFrequency};
Type = LowPass;
};

/// This filter is used for the analog data
AnyFunButterworthFilter LowPassFilter = {
Expand Down
7 changes: 4 additions & 3 deletions Application/MocapExamples/ADL_Gait_[beta]/ExtraDrivers.any
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ AnyFolder ExtraDrivers = {
// See this file for options: #include "<ANYBODY_PATH_BODY>\Documentation\BodyModel.parameters.any"
// --------------------------------------------------------------------------
#define BM_MANNEQUIN_DRIVER_DEFAULT OFF
#define BM_MANNEQUIN_DRIVER_WEAK_SWITCH ON
#define BM_MANNEQUIN_DRIVER_WEAK_SWITCH OFF

#define BM_MANNEQUIN_DRIVER_NECK ON


#define BM_MANNEQUIN_DRIVER_ANKLE_SUBTALAR_EVERSION_RIGHT ON
#define BM_MANNEQUIN_DRIVER_ANKLE_SUBTALAR_EVERSION_LEFT ON
// #define BM_MANNEQUIN_DRIVER_ANKLE_SUBTALAR_EVERSION_RIGHT ON
// #define BM_MANNEQUIN_DRIVER_ANKLE_SUBTALAR_EVERSION_LEFT ON

// #define BM_MANNEQUIN_DRIVER_STERNOCLAVICULAR_PROTRACTION_RIGHT ON
// #define BM_MANNEQUIN_DRIVER_STERNOCLAVICULAR_PROTRACTION_LEFT ON
Expand Down
54 changes: 43 additions & 11 deletions Application/MocapExamples/ADL_Gait_[beta]/LabSpecificData.any
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,20 @@ Main.ModelSetup.LabSpecificData = {
#include "Outputs_extended.any"
#endif

// The low-pass filter cut-off frequencies are relatively low here. This is
// to compensate for the noise in the recording.
// A low cut-off frequency is possible since this is a slow excersize.
// For other activities use higher values and check that the filter
// does not alter the actual signal. (Suitable values for normal gait are 5/10).
LowPassFilterSettings.MarkerFilterCutOffFrequency = 10;
LowPassFilterSettings.ForceFilterCutOffFrequency = 12;

// Better start-guess/posture for gait trials
Main.HumanModel.Mannequin.Posture = {
Right.ElbowFlexion = 30;
Left.ElbowFlexion = 30;
};

Main.Studies.ParameterIdentification.KinematicStudyForParameterIdentification= {
Kinematics.KinematicTol = 1e-4;
};
Main.ModelSetup.TrialSpecificData.ParameterOptimizationConvergenceTol = 1e-2;




// Disable the upper bound for muscle recruitment. This improves the stability of the model by
// preventing the solver from changing if the some muscles becomes over loaded.
Expand All @@ -42,6 +49,21 @@ Main.ModelSetup.LabSpecificData = {
Gravity = -9.81*{0,0,1};


#ifdef REFERENCE_TRIAL
// Set narrow kinematic limits when running parameter optimization
// improves robustness
Main.ModelSetup.MocapExtraDrivers.DefaultJointLimits =
{
LimitElbowFlexionRight.ROM = {3, 120};
LimitElbowFlexionLeft.ROM = {3, 120};
WristFlexionRight.ROM = {-70,20};
WristFlexionLeft.ROM = {-70,20};
WristAbductionRight.ROM = {-30, 30};
WristAbductionLeft.ROM = {-30, 30};
};
#endif


// This adds different segment length as design variables to
// to the parameter identification study (Main.Studies.ParameterIdentification)
// This allows the segment length to be optimized based on the markers/motion
Expand All @@ -64,13 +86,23 @@ Main.ModelSetup.LabSpecificData = {
LEFT_LOWERARM_LENGTH = ON,
RIGHT_HAND_LENGTH= ON,
LEFT_HAND_LENGTH = ON,
RIGHT_HAND_BREADTH= ON,
LEFT_HAND_BREADTH = ON,
RIGHT_HAND_BREADTH= OFF,
LEFT_HAND_BREADTH = OFF,
RIGHT_TIBIAL_TORSION = ON,
LEFT_TIBIAL_TORSION = ON,
LEFT_RIGHT_SYMMETRY = ON
) ={};


Main.HumanModel.Anthropometrics.SegmentScaleFactors = {
// Some antropometrics are not optimized from markers but set
// to match the total BodyScale height parameter
Thorax.DepthScale = BodyScale;
Neck.LengthScale = Thorax.LengthScale;
Head.LengthScale = Thorax.LengthScale;
Head.DepthScale = Head.LengthScale;
Head.WidthScale = Head.LengthScale;

};

#else
OptimizeAnthropometricsOnOff OptimizeAntropometricsOnOff ={};
Expand All @@ -94,7 +126,7 @@ Main.ModelSetup.LabSpecificData = {
"------------------------------------------------------------------------------------------------------\n"+
"The 'Rehazenter-adult-walking-dataset' must be downloaded manually. It is available under \n"+
"a Creative Commons license from fig-share: \n"+
"https://ndownloader.figshare.com/files/22164558 \n"+
"https://figshare.com/articles/dataset/A_multimodal_dataset_of_human_gait_at_different_walking_speeds/7734767/8 \n"+
" \n"+
"Download the data and extract the files into the 'c3dfiles/' subfolder. So the layout becomes\n"+
" C3DFiles\\ \n"+
Expand Down
Loading

0 comments on commit 09c77a6

Please sign in to comment.