Oh right, it raises the exception when initialize() is called -- my bad. But I have a better way to fix this issue (which I forgot about until just now, sorry Nathan!).
For the ClutchedPathSpring actuator, provide an Output with name "statebounds_<state_name>" that returns a Vec2 containing default bounds for this state variable (use DeGrooteFregly2016Muscle as a guide for this). "<state_name>" needs to be "stretch" or whatever you decide for the state name. In Moco, we automatically detect Outputs starting with "statebounds" to set default values for state info (this happens here, if you're curious).
ActivationCoordinateActuator works too because we automatically specify state info for actuators with activation dynamics based on the control info of those actuators. Any other actuators with states that don't end with "/activation" or don't implement the default bounds via Outputs above will not have state info set automatically.
Hopefully this resolves the issue. Sorry for not realizing this fix sooner!
-Nick
ClutchedPathSpring in gait simulation using Moco
- Nicholas Bianco
- Posts: 1044
- Joined: Thu Oct 04, 2012 8:09 pm
- Ross Miller
- Posts: 375
- Joined: Tue Sep 22, 2009 2:02 pm
Re: ClutchedPathSpring in gait simulation using Moco
Thanks Nick. To do this it looks like I would need to edit the cpp code for ClutchedPathSpring, is that correct? Would I then need to rebuild OpenSim from source? Nathan and I was discussing that earlier and I wasn't sure (my instinct was "yes").
Ross
Ross
- Nicholas Bianco
- Posts: 1044
- Joined: Thu Oct 04, 2012 8:09 pm
Re: ClutchedPathSpring in gait simulation using Moco
Hi Ross,
Yes, that should be added to the source code, and you would need to rebuild to get the changes.
We should make changes like this for all components with state variables not named "activation".
Yes, that should be added to the source code, and you would need to rebuild to get the changes.
We should make changes like this for all components with state variables not named "activation".
- Nicholas Bianco
- Posts: 1044
- Joined: Thu Oct 04, 2012 8:09 pm
Re: ClutchedPathSpring in gait simulation using Moco
FYI, I've just captured this problem in a GitHub issue: https://github.com/opensim-org/opensim-core/issues/3246.