Error : argument will not be ready for evaluation until moment 'PosVar'

Hi I wish to apply the x position of node data on the thigh( r [0]) which is the output of the AnyBody into the AnyKinEqInterPolDriver for some position calculation:

Main.HumanModel.BodyModel.Left.Leg.Seg.Thigh={
AnyRefNode contactNode={

      AnyRefNode Node0={sRel={0.06,0.1,0};
        AnyDrawRefFrame drw={RGB={0,1,1};
          ScaleXYZ=0.2*{1,1,1};}; };

};

...

  AnyFloat rNode0= Main.HumanModel.BodyModel.Left.Leg.Seg.Thigh.contactNode.Node0.r[0];

...

Main.Studies.InverseDynamicStudy={
AnyKinEqInterPolDriver Motion = {

    AnyPrismaticJoint &ref0=.LeftContact_Thigh;
     AnyPrismaticJoint &ref1=.RightContact_Thigh;
    Type = PiecewiseLinear;
    T =Main.Studies.InverseDynamicStudy.tArray;
    Data = {.Dx_global_Left-.rNode0 , .Dx_global_Right};

  };

};

...
However, the errors as shown occurred:

ERROR(SCR.EXP10) : Main.any(229) : 'Data' : Expression evaluation failed at moment 'DesignVar' :
Main.any(218) : rNode0 : argument will not be ready for evaluation until moment 'PosVar'

May i know how to solve this issue?

Hi,

You are trying to construct an interpolation function that depends on a time-dependent value. Meaning that this function will have to be re-evaluated every time Main.HumanModel.BodyModel.Left.Leg.Seg.Thigh.contactNode.Node0.r will change, which will be happening all the time. But it is not allowed in the interpolation drivers by design.

We don't use r for such purpose. We would construct a prismatic joint or a 1dof kinematic constraint using underlying nodes bypassing interpolation driver:

AnyKinEqSimpleDriver myDriver = {
AnyKinLinear lin = {
AnyRefNode &myTargetNode= ...SOME_NODE_HERE.r;
AnyRefNode &rNode0= Main.HumanModel.BodyModel.Left.Leg.Seg.Thigh.contactNode.Node0;
Ref = 1;
};
MeasureOrganizer = {0}; // specify dof of interest from 'lin' to drive
DriverPos = {0};DriverVel={0};
};

Kind regards,
Pavel
P.S. generally try not to use 'output' variables such as r, rDot, etc. to construct the model. Connect object on a more general level like shown above.

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