318 lines (232 with data), 10.1 kB
//This file contains a moment measures for the following joints in the arm:
//Elbowpronation
//ElbowFlexion
//Glenohumeral
//The measures named:
// ElbowPronationNetMoment
// ElbowFlexionNetMoment
// GHNetMoment
//will measure the moments and forces supplied by the muscles spanning these and on top of these
//moments and force the forces and moments from the constraints in the joints will be added.
//The resulting force and moment are equal to the to total moment and force which
//could replace both the muscles spanning the joint and the joints reactions.
//The measures named:
// ElbowPronationNetMomentMuscles
// ElbowFlexionNetMomentMuscles
// GHNetMomentMuscles
//will measure ONLY the moments and forces supplied by the muscles spanning these joint and not the moments and forces which from the constraints in the joints.
//The resulting force and moment are equal to the to total moment and force which
//are supplied by the muscles.
//In both cases the resulting force and moment is given in the global coordinate system.
AnyForceMomentMeasure2 GHNetMoment = {
AnyRefNode &ref=..Seg.Scapula.gh.RotNode;
AnyObjectPtr pArrSegments = arrcat(
ObjSearch("..Seg.Humerus","AnySeg"),
ObjSearch("..Seg.Ulna","AnySeg"),
ObjSearch("..Seg.Radius","AnySeg"),
ObjSearch("..Seg.WristJointSeg","AnySeg"),
ObjSearch("..Seg.Hand", "AnySeg"),
ObjSearchRecursive("..Seg.Hand","*", "AnySeg")
);
IncludeSegments =pArrSegments;
AnyObjectPtr pArrReactions = arrcat(ObjSearchRecursive("..Jnt", "*", "AnyForceBase"));
AnyObjectPtr pArrMuscles = arrcat(
ObjSearchRecursive("..Mus", "*", "AnyMuscle"),
ObjSearchRecursive("..Jnt.GHReactions", "*", "AnyMuscle"),
ObjSearchRecursive("..JointMuscles","*", "AnyMuscle")
);
IncludeForces = arrcat(pArrMuscles,pArrReactions);
//Make transformation to the Scapula.gh.RotNode coordinate system
AnyVec3 Mlocal=M*ref.Axes;
AnyVar GHAbduction=Mlocal[0];
AnyVar GHFlexion=Mlocal[2];
AnyVar GHExternalRotation=Mlocal[1];
};
AnyForceMomentMeasure2 ElbowFlexionNetMoment = {
AnyRefNode &ref=..Seg.Humerus.fe.RotNode;
AnyObjectPtr pArrSegments = arrcat(
ObjSearch("..Seg.Ulna","AnySeg"),
ObjSearch("..Seg.Radius","AnySeg"),
ObjSearch("..Seg.WristJointSeg","AnySeg"),
ObjSearch("..Seg.Hand", "AnySeg"),
ObjSearchRecursive("..Seg.Hand","*", "AnySeg")
);
IncludeSegments =pArrSegments;
AnyObjectPtr pArrReactions = arrcat(ObjSearchRecursive("..Jnt", "*", "AnyForceBase"));
AnyObjectPtr pArrMuscles = arrcat(
ObjSearchRecursive("..Mus", "*", "AnyMuscle"),
ObjSearchRecursive("..Jnt.GHReactions", "*", "AnyMuscle"),
ObjSearchRecursive("..JointMuscles","*", "AnyMuscle")
);
IncludeForces = arrcat(pArrMuscles,pArrReactions);
//Make transformation to the Humerus.fe.rotnode coordinate system
AnyVec3 Mlocal=M*ref.Axes;
AnyVar ElbowFlexion=Mlocal[0];
};
AnyForceMomentMeasure2 ElbowPronationNetMoment = {
AnyRefNode &ref =..Seg.Ulna.ps2.RotNode;
AnyObjectPtr pArrSegments = arrcat(
ObjSearch("..Seg.Radius","AnySeg"),
ObjSearch("..Seg.WristJointSeg","AnySeg"),
ObjSearch("..Seg.Hand", "AnySeg"),
ObjSearchRecursive("..Seg.Hand","*", "AnySeg")
);
IncludeSegments =pArrSegments;
AnyObjectPtr pArrReactions = arrcat(ObjSearchRecursive("..Jnt", "*", "AnyForceBase"));
AnyObjectPtr pArrMuscles = arrcat(
ObjSearchRecursive("..Mus", "*", "AnyMuscle"),
ObjSearchRecursive("..Jnt.GHReactions", "*", "AnyMuscle"),
ObjSearchRecursive("..JointMuscles","*", "AnyMuscle")
);
IncludeForces = arrcat(pArrMuscles,pArrReactions);
//Make transformation to the radius.ps2.rotnode coordinate system
AnyVec3 Mlocal=M*ref.Axes;
AnyVar ElbowPronation=Mlocal[0];
};
AnyForceMomentMeasure2 WristFlexionNetMoment = {
AnyRefNode &ref =..Seg.Radius.wj.RotNode;
AnyObjectPtr pArrSegments = arrcat(
ObjSearch("..Seg.WristJointSeg","AnySeg"),
ObjSearch("..Seg.Hand", "AnySeg"),
ObjSearchRecursive("..Seg.Hand","*", "AnySeg")
);
IncludeSegments =pArrSegments;
AnyObjectPtr pArrReactions = arrcat(ObjSearchRecursive("..Jnt", "*", "AnyForceBase"));
AnyObjectPtr pArrMuscles = arrcat(
ObjSearchRecursive("..Mus", "*", "AnyMuscle"),
ObjSearchRecursive("..Jnt.GHReactions", "*", "AnyMuscle"),
ObjSearchRecursive("..JointMuscles","*", "AnyMuscle")
);
IncludeForces = arrcat(pArrMuscles,pArrReactions);
//Make transformation to the Radius.wj.rotnode coordinate system
AnyVec3 Mlocal=M*ref.Axes;
AnyVar WristFlexion=Mlocal[1];
};
AnyForceMomentMeasure2 WristAbductionNetMoment = {
AnyRefNode &ref =..Seg.WristJointSeg.RadialUlnarDeviation.RotNode;
AnyObjectPtr pArrSegments = arrcat(
ObjSearch("..Seg.Hand", "AnySeg"),
ObjSearchRecursive("..Seg.Hand","*", "AnySeg")
);
IncludeSegments =pArrSegments;
AnyObjectPtr pArrReactions = arrcat(ObjSearchRecursive("..Jnt", "*", "AnyForceBase"));
AnyObjectPtr pArrMuscles = arrcat(
ObjSearchRecursive("..Mus", "*", "AnyMuscle"),
ObjSearchRecursive("..Jnt.GHReactions", "*", "AnyMuscle"),
ObjSearchRecursive("..JointMuscles","*", "AnyMuscle")
);
IncludeForces = arrcat(pArrMuscles,pArrReactions);
//Make transformation to the WristJointSeg.RadialUlnarDeviation.rotnode coordinate system
AnyVec3 Mlocal=M*ref.Axes;
AnyVar WristAbduction=Mlocal[2];
};
//The same measures as above without the joint reactions
//******************************************************
AnyForceMomentMeasure2 GHNetMomentMuscles = {
AnyRefNode &ref=..Seg.Scapula.gh.RotNode;
AnyObjectPtr pArrSegments = arrcat(
ObjSearch("..Seg.Humerus","AnySeg"),
ObjSearch("..Seg.Ulna","AnySeg"),
ObjSearch("..Seg.Radius","AnySeg"),
ObjSearch("..Seg.WristJointSeg","AnySeg"),
ObjSearch("..Seg.Hand", "AnySeg"),
ObjSearchRecursive("..Seg.Hand","*", "AnySeg")
);
IncludeSegments =pArrSegments;
AnyObjectPtr pArrMuscles = arrcat(
ObjSearchRecursive("..Mus", "*", "AnyMuscle"),
ObjSearchRecursive("..Jnt.GHReactions", "*", "AnyMuscle"),
ObjSearchRecursive("..JointMuscles","*", "AnyMuscle")
);
IncludeForces = pArrMuscles;
//Make transformation to the Scapula.gh.RotNode coordinate system
AnyVec3 Mlocal=M*ref.Axes;
AnyVar GHAbduction=Mlocal[0];
AnyVar GHFlexion=Mlocal[2];
AnyVar GHExternalRotation=Mlocal[1];
};
AnyForceMomentMeasure2 ElbowFlexionNetMomentMuscles = {
AnyRefNode &ref=..Seg.Humerus.fe.RotNode;
AnyObjectPtr pArrSegments = arrcat(
ObjSearch("..Seg.Ulna","AnySeg"),
ObjSearch("..Seg.Radius","AnySeg"),
ObjSearch("..Seg.WristJointSeg","AnySeg"),
ObjSearch("..Seg.Hand", "AnySeg"),
ObjSearchRecursive("..Seg.Hand","*", "AnySeg")
);
IncludeSegments =pArrSegments;
AnyObjectPtr pArrMuscles = arrcat(
ObjSearchRecursive("..Mus", "*", "AnyMuscle"),
ObjSearchRecursive("..Jnt.GHReactions", "*", "AnyMuscle"),
ObjSearchRecursive("..JointMuscles","*", "AnyMuscle")
);
IncludeForces = pArrMuscles;
//Make transformation to the Humerus.fe.rotnode coordinate system
AnyVec3 Mlocal=M*ref.Axes;
AnyVar ElbowFlexion=Mlocal[0];
};
AnyForceMomentMeasure2 ElbowPronationNetMomentMuscles = {
AnyRefNode &ref =..Seg.Ulna.ps2.RotNode;
AnyObjectPtr pArrSegments = arrcat(
ObjSearch("..Seg.Radius","AnySeg"),
ObjSearch("..Seg.WristJointSeg","AnySeg"),
ObjSearch("..Seg.Hand", "AnySeg"),
ObjSearchRecursive("..Seg.Hand","*", "AnySeg")
);
IncludeSegments =pArrSegments;
AnyObjectPtr pArrMuscles = arrcat(
ObjSearchRecursive("..Mus", "*", "AnyMuscle"),
ObjSearchRecursive("..Jnt.GHReactions", "*", "AnyMuscle"),
ObjSearchRecursive("..JointMuscles","*", "AnyMuscle")
);
IncludeForces = pArrMuscles;
//Make transformation to the radius.ps2.rotnode coordinate system
AnyVec3 Mlocal=M*ref.Axes;
AnyVar ElbowPronation=Mlocal[0];
};
AnyForceMomentMeasure2 WristFlexionNetMomentMuscles = {
AnyRefNode &ref =..Seg.Radius.wj.RotNode;
AnyObjectPtr pArrSegments = arrcat(
ObjSearch("..Seg.WristJointSeg","AnySeg"),
ObjSearch("..Seg.Hand", "AnySeg"),
ObjSearchRecursive("..Seg.Hand","*", "AnySeg")
);
IncludeSegments =pArrSegments;
AnyObjectPtr pArrMuscles = arrcat(
ObjSearchRecursive("..Mus", "*", "AnyMuscle"),
ObjSearchRecursive("..Jnt.GHReactions", "*", "AnyMuscle"),
ObjSearchRecursive("..JointMuscles","*", "AnyMuscle")
);
IncludeForces = pArrMuscles;
//Make transformation to the Radius.wj.rotnode coordinate system
AnyVec3 Mlocal=M*ref.Axes;
AnyVar WristFlexion=Mlocal[1];
};
AnyForceMomentMeasure2 WristAbductionNetMomentMuscles = {
AnyRefNode &ref =..Seg.WristJointSeg.RadialUlnarDeviation.RotNode;
AnyObjectPtr pArrSegments = arrcat(
ObjSearch("..Seg.Hand", "AnySeg"),
ObjSearchRecursive("..Seg.Hand","*", "AnySeg")
);
IncludeSegments =pArrSegments;
AnyObjectPtr pArrMuscles = arrcat(
ObjSearchRecursive("..Mus", "*", "AnyMuscle"),
ObjSearchRecursive("..Jnt.GHReactions", "*", "AnyMuscle"),
ObjSearchRecursive("..JointMuscles","*", "AnyMuscle")
);
IncludeForces = pArrMuscles;
//Make transformation to the WristJointSeg.RadialUlnarDeviation.rotnode coordinate system
AnyVec3 Mlocal=M*ref.Axes;
AnyVar WristAbduction=Mlocal[2];
};
AnyForceMomentMeasure ElbowJointReactionMoments = {
AnyForceBase &Force = ..Jnt.HumeroUlnarJoint.Constraints.Reaction;
AnyRefFrame &Humerusfe = ..Seg.Humerus.fe;
AnyVec3 Mlocal = M*Humerusfe.Axes;
};
AnyForceMomentMeasure WristJointReactionMoments =
{
AnyForceBase &Force = ..Jnt.WristJointFlexion.Constraints.Reaction;
AnyRefFrame &Radiuswj = ..Seg.Radius.wj;
AnyVec3 Mlocal = M*Radiuswj.Axes;
};