Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the possibility to step the simulator over a time horizon instead of being stepped over only a single$\Delta t$ .
Two modalities are supported:
Callbacks could be useful in any case to extract data from the entire horizon for logging purpose.
Note that this kind of integration over horizon is mostly beneficial when it is combined with
jax.jit
. In this way, the simulator can maximize runtime performance by compiling together a possibly long forward simulation.Note: We do not support integrating in parallel multiple cloned models belonging to a single simulation instance. Integration parallelism is performed by creating multiple
simulator.JaxSim
objects with only one model. The overhead of the simulator instance is almost negligible, and this approach makes callingjax.vmap
explicit from the user point-of-view.Note: The new
JaxSim.step_over_horizon
method, contrarily to all the other methods that can be either called in an object-oriented or a functional way thanks toJaxsimDataclass
, is purely functional. This is due to the logic related to the callbacks.