Hi, I'm trying to implement acceleration matching static optimization, but I don't know the correct way of getting accelerations.
To get correct accelerations, I think residual actuators are needed. At this stage, I'm ignoring reserve actuators. I have added strong CoordinateActuators to coordinates without muscles, e.g. pelvis and lumbar coordinates, with optimal force, min and max control values of 500, -1, and +1, respectively. Then, I updated coordinates values setValue and speeds setSpeedValue. In the equality constraint, muscles activations setActivation were updated and model equilibrateMuscles was called first. Here are 3 methods I found to control the actuators:
1. updating actuators activation setOverrideActuation.
2. updating model's control setControls.
3. adding a PrescribedController for every actuator and updating their Constants values setValue.
And finally, calling model.realizeAcceleration() followed by state.getUDot(). Method 2 seems to be working. Which method is correct?
Any help/guidance/tip is greatly appreciated.
-Mohammadreza
How to work with actuators in acceleration matching static optimization
- Mohammadreza Rezaie
- Posts: 408
- Joined: Fri Nov 24, 2017 12:48 am
- Mohammadreza Rezaie
- Posts: 408
- Joined: Fri Nov 24, 2017 12:48 am
Re: How to work with actuators in acceleration matching static optimization
Hi, any specific recommendations in this regard? I would be grateful for your help.
- Nicholas Bianco
- Posts: 1050
- Joined: Thu Oct 04, 2012 8:09 pm
Re: How to work with actuators in acceleration matching static optimization
Hi Mohammadreza,
Model accelerations are computed after the dynamics (i.e., forces) stage in OpenSim. You are correct that you need actuators in the model in order to produce model accelerations.
And yes, using the 'setControls' interface is the best way to set actuator controls for a custom optimization.
Best,
Nick
Model accelerations are computed after the dynamics (i.e., forces) stage in OpenSim. You are correct that you need actuators in the model in order to produce model accelerations.
And yes, using the 'setControls' interface is the best way to set actuator controls for a custom optimization.
Best,
Nick
- Mohammadreza Rezaie
- Posts: 408
- Joined: Fri Nov 24, 2017 12:48 am
Re: How to work with actuators in acceleration matching static optimization
Hi Nick,
Thank you so much for your response. It's great to see no PrescribedController is required.
Best,
-Mohammadreza
Thank you so much for your response. It's great to see no PrescribedController is required.
Best,
-Mohammadreza