Page 1 of 1

adding moco initial state info that depends on other state

Posted: Mon Jan 30, 2023 11:08 am
by ostr1969
I use clutchedPathSpring and its stretch state has limits to bound in between.
The stretch must be starting from the formula of initial length and initial angle, which is also a state.
apparently, now i can fix the initial value for the stretch or, if not, it starts from a value which satisfies the goals.
so i need something like:
problem.setStateInfo(
"/jointset/knee_r/knee_angle_r/value", {-120 * Pi / 180, 10*Pi/180});
problem.setStateInfo("/forceset/clutch_spring_r/stretch", {0,0.13}, F(initKneeAngle) );

where F(initKneeAngle), is not free, it has a constrain to the initial angle.

is there an option to do this?
i know the c++ OpenSim Objects and can modify any if needed.

Re: adding moco initial state info that depends on other state

Posted: Mon Jan 30, 2023 10:08 pm
by nbianco
Hi Barak,

No, that is not possible, and currently the setStateInfo interface isn't set up to support such an addition.

It might be easier to achieve this with MocoInitialOutputGoal, but I'm not sure.

-Nick