Switch to side-by-side view

--- a
+++ b/Application/Examples/LegPressMachine/Model/JointsAndDrivers.any
@@ -0,0 +1,277 @@
+AnyFolder Drivers = 
+{
+  // Aliases for convenient referencing
+  AnyFolder &JntPos= ..Mannequin.Posture;  
+  AnyFolder &JntVel= ..Mannequin.PostureVel;  
+
+  AnyFolder &RefHM = Main.Model.BodyModel;
+  AnyFolder &ref=Main.Model.BodyModel.Trunk;
+  AnyFolder &Thorax = ..BodyModel.Trunk.SegmentsThorax.ThoraxSeg;
+  AnyFolder &LegR = ..BodyModel.Right.Leg;
+  AnyFolder &LegL = ..BodyModel.Left.Leg;
+
+  AnyKinEqSimpleDriver PelvisDriver = 
+  {
+      AnyKinLinear lin = 
+      {
+        AnyRefFrame& base = Main.Model.EnvironmentModel.Segs.Back_Rest.Pelvis_node;
+        AnyRefFrame& target = Main.Model.HumanRefNodes.PelvisSeg.CenterNode;
+        Ref = 0;
+      };
+      AnyKinRotational rot = 
+      {
+        AnyRefFrame& base = Main.Model.EnvironmentModel.Segs.Back_Rest.Pelvis_node;
+        AnyRefFrame& target = Main.Model.HumanRefNodes.PelvisSeg.CenterNode;
+        Type = RotAxesAngles;
+      };      
+      MeasureOrganizer = {0, 1, 2, 3, 4, 5};
+      DriverPos = {0, 0.0, 0, 0, 0, 0};
+      DriverVel = {0, 0, 0, 0, 0, 0};
+      Reaction.Type = {Off, Off, Off, Off, Off, Off};
+  };
+
+  // ************************************
+  // Drivers for the spine
+  // ************************************
+  
+  //Neck driver 
+  AnyKinEqSimpleDriver NeckJntDriver = 
+  {
+    AnyKinMeasure& LatBending = ...BodyModel.Interface.Trunk.SkullThoraxLateralBending;
+    AnyKinMeasure& Rotation = ...BodyModel.Interface.Trunk.SkullThoraxRotation;
+    AnyKinMeasure& Flexion = ...BodyModel.Interface.Trunk.SkullThoraxFlexion;
+    
+    DriverPos = pi/180*{.JntPos.NeckLateralBending,.JntPos.NeckRotation,-1*.JntPos.NeckExtension};
+    DriverVel = pi/180*{.JntVel.NeckLateralBending,.JntVel.NeckRotation,-1*.JntVel.NeckExtension};
+    Reaction.Type = {Off,Off,Off};
+  };
+  
+  //Thorax pelvis rotation driver
+  AnyKinEqSimpleDriver PostureDriver =
+  {
+    AnyKinMeasure& Ref2 = Main.Model.BodyModel.Interface.Trunk.PelvisThoraxLateralBending;        
+    AnyKinMeasure& Ref3 = Main.Model.BodyModel.Interface.Trunk.PelvisThoraxRotation;   
+    AnyKinMeasure& Ref1 = Main.Model.BodyModel.Interface.Trunk.PelvisThoraxExtension;
+    
+    DriverPos = pi/180*{
+      .JntPos.PelvisThoraxLateralBending,
+      .JntPos.PelvisThoraxRotation,
+      .JntPos.PelvisThoraxExtension
+    };
+    DriverVel = pi/180*{
+      .JntVel.PelvisThoraxLateralBending,
+      .JntVel.PelvisThoraxRotation,
+      .JntVel.PelvisThoraxExtension
+    };
+    Reaction.Type = {
+                      Off,
+                      Off,
+                      Off
+                     };
+  };    
+  AnyStdJoint Left_Foot_Fix_Joint = 
+  {
+    AnyRefFrame& base = Main.Model.EnvironmentModel.Segs.Foot_Rest.left_toe_node;
+    AnyRefFrame& target = Main.Model.HumanRefNodes.LeftFoot.ToeNode;
+    Constraints.Reaction.Type = {Off, Off, Off, Off, Off, Off};
+  };
+
+  AnyStdJoint Right_Foot_Fix_Joint  = 
+  {
+    AnyRefFrame& base = Main.Model.EnvironmentModel.Segs.Foot_Rest.right_toe_node;
+    AnyRefFrame& target = Main.Model.HumanRefNodes.RightFoot.ToeNode;
+    Constraints.Reaction.Type = {Off, Off, Off, Off, Off, Off};
+  }; 
+  
+
+  // ************************************
+  // Drivers for the right leg
+  // ************************************
+
+  //Knee driver
+  AnyKinEqInterPolDriver KneeDriverRight = 
+  {
+      AnyKinMeasureOrg  &Knee = ...BodyModel.Interface.Right.KneeFlexion;
+      Type = Bspline;
+      T = Main.Parameters.TrialSpecificData.TimeVector;
+      Data = pi/180*{Main.Parameters.TrialSpecificData.KneeFlexionAngleVector};
+      Reaction.Type = {Off};
+  };
+
+//  // ************************************
+//  // Drivers for the left leg
+//  // ************************************
+
+    
+  // ************************************
+  // Drivers for the right arm
+  // ************************************
+  
+  //Sterno clavicular joint driver
+  #if BM_ARM_RIGHT & (BM_ARM_SHOULDER_RHYTHM == 0)
+  AnyKinEqSimpleDriver SCDriverRight ={
+    AnyKinMeasure& ref1 =Main.Model.BodyModel.Interface.Right.SternoClavicularProtraction;
+    AnyKinMeasure& ref2 =Main.Model.BodyModel.Interface.Right.SternoClavicularElevation;
+    DriverPos = pi/180*
+    {
+      .JntPos.Right.SternoClavicularProtraction,
+      .JntPos.Right.SternoClavicularElevation
+    };
+    DriverVel = pi/180*
+    {
+      .JntVel.Right.SternoClavicularProtraction,
+      .JntVel.Right.SternoClavicularElevation
+    };
+    Reaction.Type={Off,Off};
+  };
+  #endif
+  
+  
+//  //Glenohumeral joint driver
+//  AnyKinEqSimpleDriver GHDriverRight={
+//    AnyKinMeasure& ref1 =Main.Model.BodyModel.Interface.Right.GlenohumeralAbduction;
+//    AnyKinMeasure& ref2 =Main.Model.BodyModel.Interface.Right.GlenohumeralFlexion;
+//    AnyKinMeasure& ref3 =Main.Model.BodyModel.Interface.Right.GlenohumeralExternalRotation;
+//    DriverPos=pi/180*{
+//      .JntPos.Right.GlenohumeralAbduction,  //GH joint
+//      .JntPos.Right.GlenohumeralFlexion,  //GH joint
+//      .JntPos.Right.GlenohumeralExternalRotation  //GH joint
+//    };    
+//    DriverVel = pi/180*{
+//      .JntVel.Right.GlenohumeralAbduction,  //GH joint
+//      .JntVel.Right.GlenohumeralFlexion,  //GH joint
+//      .JntVel.Right.GlenohumeralExternalRotation  //GH joint
+//    };    
+//    Reaction.Type = {
+//                      Off,
+//                      Off,
+//                      Off
+//                     };
+//  };
+//
+  //Elbow pronation driver 
+  AnyKinEqSimpleDriver ElbowDriverRight={
+    AnyKinMeasure& ref1 =Main.Model.BodyModel.Interface.Right.ElbowPronation;
+    //AnyKinMeasure& ref2 =Main.Model.BodyModel.Interface.Right.ElbowFlexion;
+    
+    DriverPos= pi/180*
+                {
+                 .JntPos.Right.ElbowPronation
+                 //.JntPos.Right.ElbowFlexion
+                };  
+    DriverVel = pi/180*
+                {.JntVel.Right.ElbowPronation
+                 //.JntVel.Right.ElbowFlexion
+                };  
+    Reaction.Type={Off};
+  };
+  
+//  //Wrist driver 
+//  AnyKinEqSimpleDriver WristDriverRight ={
+//    AnyKinMeasure& ref1 =Main.Model.BodyModel.Interface.Right.WristFlexion;
+//    AnyKinMeasure& ref2 =Main.Model.BodyModel.Interface.Right.WristAbduction;
+//    DriverPos = pi/180*{
+//      .JntPos.Right.WristFlexion,
+//      .JntPos.Right.WristAbduction
+//    };
+//    
+//    DriverVel = pi/180*{
+//      .JntVel.Right.WristFlexion,
+//      .JntVel.Right.WristAbduction
+//    };
+//    Reaction.Type={Off, Off};
+//  };
+  
+  // ************************************
+  // Drivers for the left arm
+  // ************************************
+  
+  //Sterno clavicular joint driver
+  #if BM_ARM_LEFT & (BM_ARM_SHOULDER_RHYTHM == OFF)
+  AnyKinEqSimpleDriver SCDriverLeft ={
+    AnyKinMeasure& ref1 =Main.Model.BodyModel.Interface.Left.SternoClavicularProtraction;
+    AnyKinMeasure& ref2 =Main.Model.BodyModel.Interface.Left.SternoClavicularElevation;
+    
+    DriverPos = pi/180*{
+      .JntPos.Left.SternoClavicularProtraction,
+      .JntPos.Left.SternoClavicularElevation
+    };
+    
+    DriverVel = pi/180*{
+      .JntVel.Left.SternoClavicularProtraction,
+      .JntVel.Left.SternoClavicularElevation
+    };
+    
+    Reaction.Type={Off,Off};
+  };
+  #endif
+  
+//  //Glenohumeral joint driver
+//  AnyKinEqSimpleDriver GHDriverLeft={
+//    AnyKinMeasure& ref1 =Main.Model.BodyModel.Interface.Left.GlenohumeralAbduction;
+//    AnyKinMeasure& ref2 =Main.Model.BodyModel.Interface.Left.GlenohumeralFlexion;
+//    AnyKinMeasure& ref3 =Main.Model.BodyModel.Interface.Left.GlenohumeralExternalRotation;
+//    DriverPos=pi/180*{
+//      .JntPos.Left.GlenohumeralAbduction,  //GH joint
+//      .JntPos.Left.GlenohumeralFlexion,  //GH joint
+//      .JntPos.Left.GlenohumeralExternalRotation  //GH joint
+//    };    
+//    DriverVel = pi/180*{
+//      .JntVel.Left.GlenohumeralAbduction,  //GH joint
+//      .JntVel.Left.GlenohumeralFlexion,  //GH joint
+//      .JntVel.Left.GlenohumeralExternalRotation  //GH joint
+//    };    
+//    Reaction.Type = {
+//                      Off,
+//                      Off,
+//                      Off
+//                     };
+//  };
+//  
+  //Elbow pronation driver 
+  AnyKinEqSimpleDriver ElbowDriverLeft={
+    AnyKinMeasure& ref1 =Main.Model.BodyModel.Interface.Left.ElbowPronation;
+    //AnyKinMeasure& reg2 = Main.Model.BodyModel.Interface.Left.ElbowFlexion;
+    DriverPos= pi/180*
+              {
+               .JntPos.Left.ElbowPronation
+               //.JntPos.Left.ElbowFlexion 
+              };  
+    DriverVel = pi/180*
+                {
+                 .JntVel.Left.ElbowPronation
+                // .JntVel.Left.ElbowFlexion
+                };  
+    Reaction.Type={Off};
+  };
+//  
+//  //Wrist driver
+//  AnyKinEqSimpleDriver WristDriverLeft =
+//  {
+//    AnyKinMeasure& ref1 =Main.Model.BodyModel.Interface.Left.WristFlexion;
+//    AnyKinMeasure& ref2 =Main.Model.BodyModel.Interface.Left.WristAbduction;
+//    DriverPos = pi/180*{
+//      .JntPos.Left.WristFlexion,
+//      .JntPos.Left.WristAbduction};
+//    
+//    DriverVel = pi/180*{
+//      .JntVel.Left.WristFlexion,
+//      .JntVel.Left.WristAbduction};
+//    Reaction.Type={Off, Off};
+//  };
+  
+  AnyStdJoint Left_Hand_Fix = 
+  {
+    AnyRefFrame& base = Main.Model.EnvironmentModel.Segs.Handle_Left.Hand_Node;
+    AnyRefFrame& target = Main.Model.HumanRefNodes.LeftGlove.PalmNode;
+    //Axis = y;
+  };
+  AnyStdJoint Right_Hand_Fix = 
+  {
+    AnyRefFrame& base = Main.Model.EnvironmentModel.Segs.Handle_Right.Hand_Node;
+    AnyRefFrame& target = Main.Model.HumanRefNodes.RightGlove.PalmNode;    
+    //Axis = y;
+  };  
+
+};//Drivers
+