Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always forward to the integrator the model and data passed to jaxsim.api.model.step #183

Merged

Conversation

diegoferigo
Copy link
Member

@diegoferigo diegoferigo commented Jun 19, 2024

This modification is necessary to re-use the same jit-compiled jaxsim.api.model.step function and the same integrator (closed over an initial model) on a modified model having the same structure of the initial model.

It enables running simulations with parametric models having constant pytree structure without incurring in jit recompilations.

For more details, refer to the following logic:

Note: furthermore, if, for any reason, the user wants to pass to the integrator a different model or data, they can do it as follows:

_ = js.model.step(
    model=model,
    data=data,
    dt=dt,
    integrator=integrator,
    integrator_state=integrator_state,
    # Override model and data:
    integrator_kwargs=dict(model=other_model, data=other_data),
)

Related to #101 and #120.


馃摎 Documentation preview 馃摎: https://jaxsim--183.org.readthedocs.build//183/

@diegoferigo diegoferigo self-assigned this Jun 19, 2024
@diegoferigo diegoferigo marked this pull request as ready for review June 19, 2024 09:54
@diegoferigo diegoferigo merged commit 0cfd5f7 into main Jun 20, 2024
29 checks passed
@diegoferigo diegoferigo deleted the allow_overriding_model_and_data_in_integrator_kwargs branch June 20, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants