adding moco initial state info that depends on other state

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
barak ostraich
Posts: 42
Joined: Thu Apr 12, 2018 12:17 am

adding moco initial state info that depends on other state

Post by barak ostraich » Mon Jan 30, 2023 11:08 am

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.

Tags:

User avatar
Nicholas Bianco
Posts: 1050
Joined: Thu Oct 04, 2012 8:09 pm

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

Post by Nicholas Bianco » Mon Jan 30, 2023 10:08 pm

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

POST REPLY