//------------------------------------------------------- // Initial positions ShoulderArm //------------------------------------------------------- // Right.ShoulderArm.Seg.Humerus.Axes0 = {{-0.058875, 0.459044, -0.886460}, {0.198252, 0.875690, 0.440300}, {0.978381, -0.149819, -0.142563}}; // Right.ShoulderArm.Seg.Radius.Axes0 = {{-0.985956, -0.114060, -0.121985}, {0.145834, -0.232098, -0.961698}, {0.081379, -0.965982, 0.245472}}; // Right.ShoulderArm.Seg.Ulna.Axes0 = {{0.030984, 0.992048, -0.121985}, {-0.250888, -0.110417, -0.961698}, {-0.967520, 0.060402, 0.245472}}; // Right.ShoulderArm.Seg.Hand.Axes0 = {{-0.985956, -0.114060, -0.121985}, {0.145834, -0.232098, -0.961698}, {0.081379, -0.965982, 0.245472}}; // Left.ShoulderArm.Seg.Humerus.Axes0 = {{0.058875, 0.459044, -0.886460}, {-0.198252, 0.875690, 0.440300}, {0.978381, 0.149819, 0.142563}}; // Left.ShoulderArm.Seg.Radius.Axes0 = {{-0.985956, 0.114060, -0.121985}, {0.145834, 0.232098, -0.961698}, {-0.081379, -0.965982, -0.245472}}; // Left.ShoulderArm.Seg.Ulna.Axes0 = {{0.030984, -0.992048, -0.121985}, {-0.250888, 0.110417, -0.961698}, {0.967520, 0.060402, -0.245472}}; // Left.ShoulderArm.Seg.Hand.Axes0 = {{-0.985956, -0.114060, 0.121985}, {0.145834, -0.232098, 0.961698}, {-0.081379, 0.965982, 0.245472}}; //This file repicates the kinematics of the model at load time //The file will set the Axes0 values for the segments the calculations is based //on the joint driver values in the mannequin file. AnyFolder &ref=Main.Model.HumanModel; AnyFolder &JointPos=Main.Model.Mannequin.Posture; ref.Trunk.SegmentsLumbar.PelvisSeg.r0 = {JointPos.PelvisPosX,JointPos.PelvisPosY,JointPos.PelvisPosZ}; ref.Trunk.SegmentsLumbar.PelvisSeg.Axes0= RotMat((pi/180)*JointPos.PelvisRotZ ,z)* RotMat((pi/180)*JointPos.PelvisRotY ,y)* RotMat((pi/180)*JointPos.PelvisRotX ,x); //Thorax ref.Trunk.SegmentsThorax.ThoraxSeg.Axes0= ref.Trunk.SegmentsLumbar.PelvisSeg.Axes0* RotMat((pi/180)*JointPos.PelvisThoraxExtension ,z)* RotMat((pi/180)*JointPos.PelvisThoraxRotation ,y)* RotMat((pi/180)*JointPos.PelvisThoraxLateralBending ,x); //This is a rough approximation //L1Seg ref.Trunk.SegmentsLumbar.L1Seg.Axes0= ref.Trunk.SegmentsLumbar.PelvisSeg.Axes0* RotMat(5/6*(pi/180)*JointPos.PelvisThoraxExtension ,z)* RotMat(5/6*(pi/180)*JointPos.PelvisThoraxRotation ,y)* RotMat(5/6*(pi/180)*JointPos.PelvisThoraxLateralBending ,x); //L2Seg ref.Trunk.SegmentsLumbar.L2Seg.Axes0= ref.Trunk.SegmentsLumbar.PelvisSeg.Axes0* RotMat(4/6*(pi/180)*JointPos.PelvisThoraxExtension ,z)* RotMat(4/6*(pi/180)*JointPos.PelvisThoraxRotation ,y)* RotMat(4/6*(pi/180)*JointPos.PelvisThoraxLateralBending ,x); //L3Seg ref.Trunk.SegmentsLumbar.L3Seg.Axes0= ref.Trunk.SegmentsLumbar.PelvisSeg.Axes0* RotMat(3/6*(pi/180)*JointPos.PelvisThoraxExtension ,z)* RotMat(3/6*(pi/180)*JointPos.PelvisThoraxRotation ,y)* RotMat(3/6*(pi/180)*JointPos.PelvisThoraxLateralBending ,x); //L4Seg ref.Trunk.SegmentsLumbar.L4Seg.Axes0= ref.Trunk.SegmentsLumbar.PelvisSeg.Axes0* RotMat(2/6*(pi/180)*JointPos.PelvisThoraxExtension ,z)* RotMat(2/6*(pi/180)*JointPos.PelvisThoraxRotation ,y)* RotMat(2/6*(pi/180)*JointPos.PelvisThoraxLateralBending ,x); //L5Seg ref.Trunk.SegmentsLumbar.L5Seg.Axes0= ref.Trunk.SegmentsLumbar.PelvisSeg.Axes0* RotMat(1/6*(pi/180)*JointPos.PelvisThoraxExtension ,z)* RotMat(1/6*(pi/180)*JointPos.PelvisThoraxRotation ,y)* RotMat(1/6*(pi/180)*JointPos.PelvisThoraxLateralBending ,x); //SkullSeg ref.Trunk.SegmentsThorax.SkullSeg.Axes0= ref.Trunk.SegmentsThorax.ThoraxSeg.Axes0* ref.Trunk.SegmentsThorax.ThoraxSeg.C1HatNode.ARel* RotMat((pi/180)*JointPos.NeckExtension,z)* ref.Trunk.SegmentsThorax.SkullSeg.NeckNode.ARel'; //Right leg ref.Right.Leg.Seg.Thigh.Axes0 = ref.Trunk.SegmentsLumbar.PelvisSeg.Axes0*ref.Trunk.SegmentsLumbar.PelvisSeg.HipJointRight.RotNode.ARel* RotMat((pi/180)*JointPos.Right.HipFlexion,z)* RotMat((pi/180)*JointPos.Right.HipExternalRotation,y)* RotMat((pi/180)*JointPos.Right.HipAbduction,x)* ref.Right.Leg.Seg.Thigh.HipJoint.RotNode.ARel'; //shank ref.Right.Leg.Seg.Shank.Axes0 = ref.Right.Leg.Seg.Thigh.Axes0* ref.Right.Leg.Seg.Thigh.KneeJoint.ARel* ref.Right.Leg.Seg.Thigh.KneeJoint.RotNode.ARel* RotMat((-pi/180)*JointPos.Right.KneeFlexion,z)* //RotMat(pi,y)* ref.Right.Leg.Seg.Shank.KneeJoint.RotNode.ARel'* ref.Right.Leg.Seg.Shank.KneeJoint.ARel'; //Foot ref.Right.Leg.Seg.Foot.Axes0 = ref.Right.Leg.Seg.Shank.Axes0* ref.Right.Leg.Seg.Shank.AnkleJoint.ARel* ref.Right.Leg.Seg.Shank.AnkleJoint.RotNode.ARel* RotMat((pi/180)*JointPos.Right.AnklePlantarFlexion ,z)* RotMat((pi/180)*JointPos.Right.AnkleEversion ,y)* ref.Right.Leg.Seg.Foot.AnkleJoint.RotNode.ARel'* ref.Right.Leg.Seg.Foot.AnkleJoint.ARel'; //right humerus ref.Right.ShoulderArm.Seg.Humerus.Axes0 = ref.Trunk.SegmentsThorax.ThoraxSeg.Axes0* ref.Trunk.SegmentsThorax.ThoraxSeg.ij.ARel* ref.Trunk.SegmentsThorax.ThoraxSeg.ij.RotNode.ARel* RotMat((pi/180)*JointPos.Right.GlenohumeralFlexion ,z)* RotMat((pi/180)*JointPos.Right.GlenohumeralExternalRotation ,y)* RotMat((pi/180)*JointPos.Right.GlenohumeralAbduction ,x)* ref.Right.ShoulderArm.Seg.Humerus.gh.RotNode.ARel'* ref.Right.ShoulderArm.Seg.Humerus.gh.ARel'; //right ulna ref.Right.ShoulderArm.Seg.Ulna.Axes0 = ref.Right.ShoulderArm.Seg.Humerus.Axes0* ref.Right.ShoulderArm.Seg.Humerus.fe.ARel* ref.Right.ShoulderArm.Seg.Humerus.fe.RotNode.ARel* RotMat((pi/180)*JointPos.Right.ElbowFlexion,x)* ref.Right.ShoulderArm.Seg.Ulna.fe.RotNode.ARel'; //right Radius ref.Right.ShoulderArm.Seg.Radius.Axes0 = ref.Right.ShoulderArm.Seg.Ulna.Axes0* ref.Right.ShoulderArm.Seg.Ulna.ps2.ARel* ref.Right.ShoulderArm.Seg.Ulna.ps2.RotNode.ARel* //RotMat(-pi/2,z)* RotMat(0.0,y)* RotMat((pi/180)*JointPos.Right.ElbowPronation ,x)* ref.Right.ShoulderArm.Seg.Radius.PointPS2.ARel'* ref.Right.ShoulderArm.Seg.Radius.PointPS2.RotNode.ARel'; //right hand ref.Right.ShoulderArm.Seg.Hand.Axes0 = ref.Right.ShoulderArm.Seg.Radius.Axes0* ref.Right.ShoulderArm.Seg.Radius.wj.ARel* ref.Right.ShoulderArm.Seg.Radius.wj.RotNode.ARel* //RotMat(0.0,y)* RotMat((pi/180)*JointPos.Right.WristFlexion,y)* RotMat((pi/180)*JointPos.Right.WristAbduction,z)* ref.Right.ShoulderArm.Seg.Hand.wj.RotNode.ARel'* ref.Right.ShoulderArm.Seg.Hand.wj.ARel'; //Left hip ref.Left.Leg.Seg.Thigh.Axes0 =ref.Trunk.SegmentsLumbar.PelvisSeg.Axes0*ref.Trunk.SegmentsLumbar.PelvisSeg.HipJointLeft.RotNode.ARel* RotMat((pi/180)*JointPos.Left.HipFlexion,z)* RotMat((pi/180)*JointPos.Left.HipExternalRotation,y)* RotMat((pi/180)*JointPos.Left.HipAbduction,x)* ref.Left.Leg.Seg.Thigh.HipJoint.RotNode.ARel'; //left shank ref.Left.Leg.Seg.Shank.Axes0 = ref.Left.Leg.Seg.Thigh.Axes0* ref.Left.Leg.Seg.Thigh.KneeJoint.ARel* ref.Left.Leg.Seg.Thigh.KneeJoint.RotNode.ARel* RotMat((-pi/180)*JointPos.Left.KneeFlexion,z)* //RotMat(pi,y)* ref.Left.Leg.Seg.Shank.KneeJoint.RotNode.ARel'* ref.Left.Leg.Seg.Shank.KneeJoint.ARel'; //left foot ref.Left.Leg.Seg.Foot.Axes0 = ref.Left.Leg.Seg.Shank.Axes0* ref.Left.Leg.Seg.Shank.AnkleJoint.ARel* ref.Left.Leg.Seg.Shank.AnkleJoint.RotNode.ARel* RotMat((pi/180)*JointPos.Left.AnklePlantarFlexion ,z)* RotMat((pi/180)*JointPos.Left.AnkleEversion,y)* ref.Left.Leg.Seg.Foot.AnkleJoint.RotNode.ARel'* ref.Left.Leg.Seg.Foot.AnkleJoint.ARel'; //left humerus ref.Left.ShoulderArm.Seg.Humerus.Axes0 = ref.Trunk.SegmentsThorax.ThoraxSeg.Axes0* ref.Trunk.SegmentsThorax.ThoraxSeg.iji.ARel* ref.Trunk.SegmentsThorax.ThoraxSeg.iji.RotNode.ARel* RotMat((pi/180)*JointPos.Left.GlenohumeralExternalRotation ,y)* RotMat((pi/180)*JointPos.Left.GlenohumeralFlexion ,z)* RotMat((pi/180)*JointPos.Left.GlenohumeralAbduction ,x)* ref.Left.ShoulderArm.Seg.Humerus.gh.RotNode.ARel'* ref.Left.ShoulderArm.Seg.Humerus.gh.ARel'; //left ulna ref.Left.ShoulderArm.Seg.Ulna.Axes0 = ref.Left.ShoulderArm.Seg.Humerus.Axes0* ref.Left.ShoulderArm.Seg.Humerus.fe.ARel* ref.Left.ShoulderArm.Seg.Humerus.fe.RotNode.ARel* RotMat((pi/180)*JointPos.Left.ElbowFlexion,x)* ref.Left.ShoulderArm.Seg.Ulna.fe.RotNode.ARel'; //left Radius ref.Left.ShoulderArm.Seg.Radius.Axes0 = ref.Left.ShoulderArm.Seg.Ulna.Axes0* ref.Left.ShoulderArm.Seg.Ulna.ps2.ARel* ref.Left.ShoulderArm.Seg.Ulna.ps2.RotNode.ARel* //RotMat(-pi,z)* RotMat(0.0,y)* RotMat((pi/180)*JointPos.Left.ElbowPronation ,x)* ref.Left.ShoulderArm.Seg.Radius.PointPS2.ARel'* ref.Left.ShoulderArm.Seg.Radius.PointPS2.RotNode.ARel'; //Left hand ref.Left.ShoulderArm.Seg.Hand.Axes0 = ref.Left.ShoulderArm.Seg.Radius.Axes0* ref.Left.ShoulderArm.Seg.Radius.wj.ARel* ref.Left.ShoulderArm.Seg.Radius.wj.RotNode.ARel* //RotMat(0.0,y)* RotMat((pi/180)*JointPos.Left.WristFlexion,y)* RotMat((pi/180)*JointPos.Left.WristAbduction,z)* ref.Left.ShoulderArm.Seg.Hand.wj.RotNode.ARel* ref.Left.ShoulderArm.Seg.Hand.wj.ARel';