How to define a new RefNote based on the real-time distance between two existing nodes?

Good morning,

I am trying to define a new AnyRefNote based on the real-time distance between two existing nodes. Like the following code, I want to define a new AnyRefNode RotationCenterNode_Left. It is a part of AnySeg Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.HumerusMain.HumanModel.BodyModel.Left.ShoulderArm.Seg.Humerus.
It relative distance to the node C (Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Scapula.O_deltoideus_lateral_part_3) is half the relative distance between A and B.

AnyKinLinear RotationCenter_lin =
AnyRefFrame& A = Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Humerus.O_Extensor_Carpi_Radialis_Brevis;
AnyRefFrame& B = Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Ulna.I_Brachialis_1;
Ref = 0;

AnySeg& CenterNode_r = Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Humerus;
ref_Elbow_right =
AnyRefNode RotationCenterNode_Left =
sRel = Main.HumanModel.BodyModel.Left.ShoulderArm.Seg.Scapula.O_deltoideus_lateral_part_3.sRel+ 0.5*(Main.Model.EnvironmentModel.RotationCenter_lin.Pos);
AnyDrawRefFrame drw =
ScaleXYZ = 0.01 * {1, 1, 1};
RGB = {1, 0, 0};

I tried this code but it doesn't work.

ERROR(SCR.EXP10) : Environment.any(223) : 'RotationCenterNode_Left' : Expression evaluation failed at moment 'DesignVar' :
Environment.any(212) : RotationCenter_lin.Pos : argument will not be ready for evaluation until moment 'PosVar'
Model loading skipped

Could you please tell me why? Thank you!



AnyRefNode objects cannot have dynamics positions wrt. segment, and flow in space during simulation. Remember the rigid body dynamics assumption for this type of modelling.

And if you want something to move depending on the dynamic position - you should create a segment, kinematic measures, and drivers that would position it in the expected place.

Kind regards,

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.