--- a +++ b/Application/Examples/CrossTrainer/Model/JointsAndDrivers.any @@ -0,0 +1,378 @@ +AnyFolder Drivers = +{ + // Aliases for convenient referencing + AnyFolder &RefHM = Main.Model.BodyModel; + + AnyFolder &JntPos= ..Mannequin.Posture; + AnyFolder &JntVel= ..Mannequin.PostureVel; + + // ************************************ + // Drivers for the left & right legs + // ************************************ + + AnyStdJoint Left_Foot_Connect = + { + AnyRefFrame& base = Main.Model.FitnessMachine._ANY_INTERFACE_.Pedal___1____ANY_TOE2; + AnyRefFrame& target = Main.Model.Human_RefNodes.Left_Toe_Node; + //Constraints.Reaction.Type = {On, NonNegative, On, On, On, On}; + Constraints.Reaction.Type = {Off, Off, Off, Off, Off, Off}; + }; + + AnyStdJoint Right_Foot_Connect = + { + AnyRefFrame& base = Main.Model.FitnessMachine._ANY_INTERFACE_.Pedal___2____ANY_TOE2; + AnyRefFrame& target = Main.Model.Human_RefNodes.Right_Toe_Node; + //Constraints.Reaction.Type = {On, NonNegative, On, On, On, On}; + Constraints.Reaction.Type = {Off, Off, Off, Off, Off, Off}; + }; + +// AnyKinEqSimpleDriver HipAbduction_Rhythm_Driver = +// { +// AnyKinMeasureLinComb lincomb = +// { +// AnyKinMeasure& ref0 = ....HumanModel.Interface.Right.HipAbduction; +// AnyKinMeasure& ref1 = ....HumanModel.Interface.Left.HipAbduction ; +// Coef = {{1, -1}}; +// OutDim = 1; +// }; +// DriverPos = {0.0}; +// DriverVel = {0.0}; +// Reaction.Type = {Off}; +// }; + + AnyKinEqSimpleDriver HipExternalRotation_Rhythm_Driver = + { + AnyKinMeasureLinComb lincomb = + { + AnyKinMeasure& ref0 = ....BodyModel.Interface.Right.HipExternalRotation; + AnyKinMeasure& ref1 = ....BodyModel.Interface.Left.HipExternalRotation ; + Coef = {{1, -1}}; + OutDim = 1; + }; + DriverPos = {0.0}; + DriverVel = {0.0}; + Reaction.Type = {Off}; + }; + + AnyKinEqSimpleDriver KneeFlexion_Rhythm_Driver = + { + AnyKinMeasureLinComb limcomb = + { + AnyKinMeasure& ref0 = ....BodyModel.Interface.Right.KneeFlexion ; + AnyKinMeasure& ref1 = ....BodyModel.Interface.Left.KneeFlexion ; + Coef = {{1, 1}}; + OutDim = 1 ; + }; + DriverPos = pi/180*{90}; + DriverVel = {0.0}; + Reaction.Type={Off}; + }; + + // ************************************ + // Drivers for the trunk + // ************************************ + +// AnyKinEqSimpleDriver Pelvis_Rot_Driver = +// { +// AnyKinRotational rot = +// { +// AnyRefFrame &Base = Main.Model.FitnessMachine._ANY_INTERFACE_.ANY_PELVIS; +// AnyRefFrame &Target = Main.Model.Human_RefNodes.Pelvis_Node; +// Type = PlanarAngles ; +// Axis1 = y; +// Axis2 = z; +// Axis3 = x; +// }; +// MeasureOrganizer = {1, 2}; +// DriverPos = {0, 0}; +// DriverVel = {0, 0}; +// Reaction.Type = {Off, Off}; +// }; + + AnyKinEqSimpleDriver Pelvis_RotX_Driver = + { + AnyKinMeasure& ref = ...BodyModel.Interface.Trunk.PelvisRotX; + DriverPos = pi/180* + { + .JntPos.PelvisRotX + }; + DriverVel = pi/180* + { + .JntVel.PelvisRotX + }; + Reaction.Type={Off}; + }; + + AnyKinEqSimpleDriver Pelvis_RotZ_Driver = + { + AnyKinMeasure& ref = ...BodyModel.Interface.Trunk.PelvisRotZ; + DriverPos = pi/180* + { + .JntPos.PelvisRotZ + }; + DriverVel = pi/180* + { + .JntVel.PelvisRotZ + }; + Reaction.Type = {Off}; + }; + + AnyKinEqSimpleDriver Human_Full_CoM_Z_Driver = + { + AnyKinMeasureLinComb lincomb = + { + AnyKinCoM& human_CoM = Main.Model.Human_CoM.CoM_Full; + AnyKinLinear lin = + { + AnyRefFrame& target = Main.Model.FitnessMachine._ANY_INTERFACE_.ANY_PELVIS; + }; + OutDim = 3; + Coef = {{1,0,0,-1,0,0},{0,1,0,0,-1,0},{0,0,1,0,0,-1}}; + }; + MeasureOrganizer = {2}; + Reaction.Type = {Off}; + DriverPos = {0.0}; + DriverVel = {0.0}; + }; + + AnyKinEqSimpleDriver Human_Full_CoM_X_Driver = + { + AnyKinMeasureLinComb lincomb = + { + AnyKinCoM& human_CoM = Main.Model.Human_CoM.CoM_Full; + AnyKinLinear lin0 = + { + AnyRefFrame& target = Main.HumanModel.BodyModel.Right.Leg.Seg.Foot.SubTalarJoint; + }; + AnyKinLinear lin1 = + { + AnyRefFrame& target = Main.HumanModel.BodyModel.Left.Leg.Seg.Foot.SubTalarJoint; + }; + OutDim = 3; + Coef = + { + {1,0,0,-0.5,0,0,-0.5,0,0}, + {0,1,0,0,-0.5,0,0,-0.5,0}, + {0,0,1,0,0,-0.5,0,0,-0.5} + }; + }; + MeasureOrganizer = {0}; + Reaction.Type = {Off}; + DriverPos = {0.0}; + DriverVel = {0.0}; + }; + +// AnyKinEqSimpleDriver Human_CoM_Y_Driver = +// { +// AnyKinMeasureLinComb lincomb = +// { +// AnyKinCoM& human_CoM = Main.Model.Human_CoM.human_CoM; +// AnyKinLinear lin = +// { +// AnyRefFrame& target = Main.Model.FitnessMachine._ANY_INTERFACE_.ANY_PELVIS; +// }; +// OutDim = 3; +// Coef = {{1,0,0,-1,0,0},{0,1,0,0,-1,0},{0,0,1,0,0,-1}}; +// }; +// MeasureOrganizer = {1}; +// Reaction.Type = {Off}; +// DriverPos = {0.3}; +// DriverVel = {0.0}; +// }; + +// AnyKinEqSimpleDriver Human_Upper_CoM_X_Driver = +// { +// AnyKinMeasureLinComb lincomb = +// { +// AnyKinCoM& CoM_Upper = Main.Model.Human_CoM.CoM_Upper; +// AnyKinCoM& CoM_Full = Main.Model.Human_CoM.CoM_Full; +// OutDim = 3; +// Coef = +// { +// {1,0,0,-1,0,0}, +// {0,1,0,0,-1,0}, +// {0,0,1,0,0,-1} +// }; +// }; +// MeasureOrganizer = {0}; +// Reaction.Type = {Off}; +// DriverPos = {0.0}; +// DriverVel = {0.0}; +// }; + + //Thorax pelvis rotation driver + AnyKinEqSimpleDriver PelvisThorax_Driver = + { + //AnyKinMeasure& Ref0 = ...BodyModel.Interface.Trunk.PelvisThoraxRotation; + AnyKinMeasure& Ref1 = ...BodyModel.Interface.Trunk.PelvisThoraxExtension; + AnyKinMeasure& Ref2 = ...BodyModel.Interface.Trunk.PelvisThoraxLateralBending; + + DriverPos = pi/180* + { + //.JntPos.PelvisThoraxRotation, + .JntPos.PelvisThoraxExtension, + .JntPos.PelvisThoraxLateralBending + }; + DriverVel = pi/180* + { + //.JntVel.PelvisThoraxRotation, + .JntVel.PelvisThoraxExtension, + .JntVel.PelvisThoraxLateralBending + }; + //Reaction.Type = {Off,Off,Off}; + Reaction.Type = {Off, Off}; + //Reaction.Type = {Off}; + }; + + AnyKinEqSimpleDriver PelvisThoraxRotation_Rhythm_Driver = + { + AnyKinMeasureLinComb lincomb = + { + AnyKinMeasure& ref0 = ....BodyModel.Interface.Trunk.PelvisThoraxRotation; + AnyKinMeasureLinComb HipFlexion_Diff = + { + AnyKinMeasure& ref0 = .....BodyModel.Interface.Right.HipFlexion ; + AnyKinMeasure& ref1 = .....BodyModel.Interface.Left.HipFlexion ; + Coef = {{1, -1}}; + OutDim = 1; + }; + Coef = {{1, -1/50}}; + OutDim = 1; + }; + DriverPos = {0.0}; + DriverVel = {0.0}; + Reaction.Type = {Off}; + }; + +// //Neck driver +// AnyKinEqSimpleDriver NeckJnt_Driver = +// { +// AnyKinMeasure &lb = ...BodyModel.Interface.Trunk.SkullThoraxLateralBending; +// AnyKinMeasure &ar = ...BodyModel.Interface.Trunk.SkullThoraxRotation; +// AnyKinMeasure &fe = ...BodyModel.Interface.Trunk.SkullThoraxFlexion; +// DriverPos = pi/180*{.JntPos.NeckLateralBending, .JntPos.NeckRotation, .JntPos.NeckExtension}; +// DriverVel = pi/180*{.JntVel.NeckLateralBending, .JntVel.NeckRotation, .JntVel.NeckExtension}; +// Reaction.Type = {Off, Off, Off}; +// }; + + AnyKinEqSimpleDriver HeadOrientation_Driver = + { + AnyKinRotational rot = + { + AnyRefFrame& ref = Main.HumanModel.BodyModel.Trunk.SegmentsCervicalSpine.SkullSeg.TopOfHead; + Type = PlanarAngles; + }; + DriverPos = {0, 0, 0}; + DriverVel = {0, 0, 0}; + Reaction.Type = {Off, Off, Off}; + }; + + // ************************************ + // Drivers for the left & right arms + // ************************************ + + //Sterno clavicular joint driver + #if BM_ARM_LEFT & (BM_ARM_SHOULDER_RHYTHM == 0) + AnyKinEqSimpleDriver SCDriverLeft_Driver = + { + 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 + + //Sterno clavicular joint driver + #if BM_ARM_RIGHT & (BM_ARM_SHOULDER_RHYTHM == 0) + AnyKinEqSimpleDriver SCDriverRight_Driver = + { + 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 + + AnyKinEqSimpleDriver GlenohumeralAbduction_Rhythm_Driver = + { + AnyKinMeasureLinComb lincomb = + { + AnyKinMeasure& ref0 = ....BodyModel.Interface.Left.GlenohumeralAbduction; + AnyKinMeasure& ref1 = ....BodyModel.Interface.Right.GlenohumeralAbduction ; + Coef = {{1, 1}}; + OutDim = 1; + }; + DriverPos = pi/180*{20}; + DriverVel = {0.0}; + Reaction.Type = {Off}; + }; + + AnyKinEqSimpleDriver Elbow_Rhythm_Driver = + { + AnyKinMeasureLinComb lincomb = + { + AnyKinMeasureOrg org0 = + { + AnyKinLinear lin = + { + AnyRefFrame& ref0 = Main.Model.FitnessMachine.MainBase___1.ANY_PELVIS; + AnyRefFrame& ref1 = ......BodyModel.Left.ShoulderArm.Seg.Humerus.fe; + Ref = 0; + }; + MeasureOrganizer = {2}; //z + }; + AnyKinMeasureOrg org1 = + { + AnyKinLinear lin = + { + AnyRefFrame& ref0 = Main.Model.FitnessMachine.MainBase___1.ANY_PELVIS; + AnyRefFrame& ref1 = ......BodyModel.Right.ShoulderArm.Seg.Humerus.fe; + Ref = 0; + }; + MeasureOrganizer = {2}; //z + }; + Coef = {{1, 1}}; + OutDim = 1; + }; + DriverPos = {0.0}; + DriverVel = {0.0}; + Reaction.Type = {Off}; + }; + + AnyStdJoint Left_Hand_Connect = + { + AnyRefFrame& base = Main.Model.FitnessMachine._ANY_INTERFACE_.ANY_LEFT_HAND2; + AnyRefFrame& target = Main.Model.Human_RefNodes.Left_Palm_Node; + Constraints.Reaction.Type = {On, On, On, On, On, On}; + }; + + AnyStdJoint Right_Hand_Connect = + { + AnyRefFrame& base = Main.Model.FitnessMachine._ANY_INTERFACE_.ANY_RIGHT_HAND2; + AnyRefFrame& target = Main.Model.Human_RefNodes.Right_Palm_Node; + Constraints.Reaction.Type = {On, On, On, On, On, On}; + }; + +};//Drivers +