Hi,
First, when we look your original ‘TrunkDrivers.any’ file, then we can see the following code:
//Thorax pelvis rotation driver
AnyKinEqSimpleDriver PostureDriver ={
AnyKinMeasureOrg &Ref2 = ..HumanModel.Interface.Trunk.PelvisThoraxLateralBending;
AnyKinMeasureOrg &Ref3 = ..HumanModel.Interface.Trunk.PelvisThoraxRotation;
AnyKinMeasureOrg &Ref1 = ..HumanModel.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};
};
So three joint angles such as PelvisThoraxLateralBending, PelvisThoraxRotation and PelvisThoraxExtension are controlled by the values in the ‘Mannequin.any’ file.
But I tried to change PelvisThoraxExtension according to handle cycle motion.
Following codes define the linear distance between two nodes and I only needed the horizontal distance. That’s the reason why I used AnyKinMeasureOrg from AnyKinLinear.
AnyKinLinear Pelvis_Handle_Distance =
{
AnyRefFrame& base = Main.Model.EnvironmentModel.GlobalRef.SaddlePos;
AnyRefFrame& target = Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Glove.lHandleNode;
Ref = 0;
};
AnyKinMeasureOrg Pelvis_Handle_Distance_x =
{
AnyKinLinear& lin = .Pelvis_Handle_Distance;
MeasureOrganizer = {0};
};
AnyKinMeasureLinComb makes a linear combination of several different kinematic measures.
What I assumed is that there may be a linear relationship between the horizontal distance(between saddle position node and the handle node) and the PelvisThoraxExtension angle. The equation is:
alpha*(Pelvis_Handle_Distance_x -initial_pelvis_handle_distance_x) = (-1)*PelvisThoraxExtension
I could see that the initial pelvis_handle_distance_x value was about 0.45m.
You have to see how AnyKinMeasureLinComb can be used.
AnyKinEq PelvisThoraxExtension_control =
{
AnyKinMeasureLinComb lin_comb =
{
AnyKinMeasure& Pelvis_Handle_Distance_x = ..Pelvis_Handle_Distance_x ;
AnyKinMeasure& PelvisThoraxExtension = ...HumanModel.Interface.Trunk.PelvisThoraxExtension;
AnyVar alpha = 50;
AnyVar dis_offset= 0.45;
Coef = {{alpha, 180/pi}};
Const = {(-1)*alpha*dis_offset};
};
Reaction.Type = {Off};
};
If you increase ‘alpha’ value, then you may be able to see some changes.
You should remember that ‘Reation.Type’ of this constraint should be ‘Off’.
I hope that this explanation may be helpful to you.
And I attached two pictures for your better understanding.
Best regards,
Moonki