Page 1 of 1

Setting IntegratorMaximumStepSize

Posted: Mon Mar 15, 2021 12:44 pm
by shakibarafiee
Hi all,

I wanted to see how I can have more control over the integration step of the forward simulation in the python interface. I am working on this reflex-based OpenSim model that was published for the NeurIPS 2019 Learn to Move - Walk Challenge.

https://github.com/stanfordnmbl/osim-rl ... roller1.py

For this project, I need to have more control over the accuracy of the integration. I was thinking to start with setting both the integrator accuracy as well as the maximum step size. I was able to change the accuracy of the integrator; however, when I use the "setIntegratorMaximumStepSize" command, it gives me the following error.

object has no attribute 'setIntegratorMaximumStepSize'

I was hoping someone here could help me with this.

Thanks in advance,
Shakiba Rafiee

Re: Setting IntegratorMaximumStepSize

Posted: Mon Mar 29, 2021 2:28 pm
by ongcf
Not all integrators support `setIntegratorMaximumStepSize`, so it's likely the integrator used for osim-rl by default doesn't have it. My guess is that the integrator is a variable step integrator, so it will try to take as large of steps as possible while being controlled by the tolerance (which is a nice featuer to keep a simulation as quick as possible).

You can see the comments in the OpenSim doxygen and Simbody doxygen pages about this issue:
https://simtk.org/api_docs/opensim/api_ ... 38604ceaf5
https://simbody.github.io/3.5.0/classSi ... 688e6430ba

Re: Setting IntegratorMaximumStepSize

Posted: Mon Apr 19, 2021 1:34 pm
by shakibarafiee
Hi Carmicheal,

Thank you for the reply.

You are correct. I think the default integrator that the opensim_rl use, does not support "setIntegratorMaximumStepSize". I have been trying to use fixed-step size for the integrator with little success.

I am a little confused on the process here. It turns out that the manager class I end up using has very few functions. The one that makes sense seems to be manager.setDTArray().

Are there any examples for this function implemented in python that I can take a look at?