--- a +++ b/Application/Examples/WheelTurn/Model/JointsAndDrivers.any @@ -0,0 +1,236 @@ + +AnyFolder Drivers = { + + AnyFolder &JntPos=..Mannequin.Posture; + AnyFolder &JntVel=..Mannequin.PostureVel; + + + AnyFolder &Thorax = ..BodyModel.Trunk.SegmentsThorax.ThoraxSeg; + + + // ************************************ + // Drivers for attaching the pelvis to the global reference system + // ************************************ + + AnyKinEqSimpleDriver PelvisGroundDriver ={ + AnyKinLinear lin ={ + AnyFixedRefFrame &ref1 =....EnvironmentModel.GlobalRef; + AnyRefFrame &ref2 =....BodyModel.Trunk.SegmentsLumbar.PelvisSeg.CompatibilityFrameAMMR24; + }; + AnyKinRotational rot ={ + AnyFixedRefFrame &ref1 =....EnvironmentModel.GlobalRef; + AnyRefFrame &ref2 =....BodyModel.Trunk.SegmentsLumbar.PelvisSeg.CompatibilityFrameAMMR24; + Type=RotAxesAngles; + }; + DriverPos={ + .JntPos.PelvisPosX, + .JntPos.PelvisPosY, + .JntPos.PelvisPosZ, + pi/180*.JntPos.PelvisRotZ, + pi/180*.JntPos.PelvisRotY, + pi/180*.JntPos.PelvisRotX + }; + DriverVel={ + .JntVel.PelvisPosX, + .JntVel.PelvisPosY, + .JntVel.PelvisPosZ, + pi/180*.JntVel.PelvisRotX, + pi/180*.JntVel.PelvisRotY, + pi/180*.JntVel.PelvisRotZ + }; + Reaction.Type={On,On,On,On,On,On}; + }; + + AnyFolder &RefHM = Main.Model.BodyModel; + + + AnyFolder &ref=Main.Model.BodyModel.Trunk; + + + // ************************************ + // Drivers for the spine + // ************************************ + + //Neck driver + AnyKinEqSimpleDriver NeckJntDriver = { + 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,-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 = ...BodyModel.Interface.Trunk.PelvisThoraxLateralBending; + AnyKinMeasure& Ref3 = ...BodyModel.Interface.Trunk.PelvisThoraxRotation; + AnyKinMeasure& Ref1 = ...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}; + }; + + + // ************************************ + // Drivers for the right arm + // ************************************ + + + //Sterno clavicular joint driver + AnyKinEqSimpleDriver SCDriverRight ={ + AnyKinMeasure& ref1 =...BodyModel.Interface.Right.SternoClavicularProtraction; + AnyKinMeasure& ref2 =...BodyModel.Interface.Right.SternoClavicularElevation; + DriverPos = pi/180*{ + .JntPos.Right.SternoClavicularProtraction, + .JntPos.Right.SternoClavicularElevation + }; + DriverVel = { + .JntVel.Right.SternoClavicularProtraction, + .JntVel.Right.SternoClavicularElevation + }; + Reaction.Type={Off,Off}; + }; + + //Wrist driver + AnyKinEqSimpleDriver WristDriverRight ={ + AnyKinMeasure& ref1 =...BodyModel.Interface.Right.WristFlexion; + AnyKinMeasure& ref2 =...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}; + }; + + + //Elbow pronation driver + AnyKinEqSimpleDriver ElbowPSDriverRight={ + AnyKinMeasure& Elbow =...BodyModel.Interface.Right.ElbowPronation; + DriverPos= pi/180*{.JntPos.Right.ElbowPronation }; + DriverVel = pi/180*{.JntVel.Right.ElbowPronation }; + Reaction.Type={Off}; + }; + //Glenohumeral joint driver + AnyKinEqSimpleDriver GHDriverRight={ + // AnyKinMeasure& ref1 =...BodyModel.Interface.Right.GlenohumeralAbduction; + // AnyKinMeasure& ref2 =...BodyModel.Interface.Right.GlenohumeralFlexion; + AnyKinMeasure& ref3 =...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}; + }; + + + + // ************************************ + // Drivers for the left arm + // ************************************ + + + //Sterno clavicular joint driver + AnyKinEqSimpleDriver SCDriverLeft ={ + AnyKinMeasure& ref1 =...BodyModel.Interface.Left.SternoClavicularProtraction; + AnyKinMeasure& ref2 =...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}; + }; + + //Wrist driver + AnyKinEqSimpleDriver WristDriverLeft ={ + AnyKinMeasure& ref1 =...BodyModel.Interface.Left.WristFlexion; + AnyKinMeasure& ref2 =...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}; + }; + + + + + //Elbow pronation driver + AnyKinEqSimpleDriver ElbowPSDriverLeft={ + AnyKinMeasure& Elbow =...BodyModel.Interface.Left.ElbowPronation; + DriverPos= pi/180*{.JntPos.Left.ElbowPronation }; + DriverVel = pi/180*{.JntVel.Left.ElbowPronation }; + Reaction.Type={Off}; + }; + //Glenohumeral joint driver + AnyKinEqSimpleDriver GHDriverLeft={ + // AnyKinMeasure& ref1 =...BodyModel.Interface.Left.GlenohumeralAbduction; + // AnyKinMeasure& ref2 =...BodyModel.Interface.Left.GlenohumeralFlexion; + AnyKinMeasure& ref3 =...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}; + }; + + +}; //Drivers + +// Joints between the human model and the environment + + +Main.Model.BodyModel.Right.ShoulderArm.Seg.Hand.Carpals = { + AnyRefNode GripCenter = {sRel=.Scale({0.020, -0.065, ....Sign*0.0}); }; +}; + +AnyFolder Joints = { + AnySphericalJoint HandHandle = { + AnyRefFrame &Palm = Main.Model.BodyModel.Right.ShoulderArm.Seg.Hand.Carpals.GripCenter; + AnyRefNode &Rim = Main.Model.EnvironmentModel.Wheel.Handle; + }; + + AnySphericalJoint HandRest = { + AnyRefFrame &Palm = Main.Model.BodyModel.Left.ShoulderArm.Seg.Hand.Carpals.PalmJoint; + AnyRefNode &Ground = Main.Model.EnvironmentModel.GlobalRef.HandRest; + }; +}; \ No newline at end of file