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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove absolute time from JaxSimModelData and introduce JaxSimModel.time_step #262

Merged
merged 7 commits into from
Oct 11, 2024

Conversation

diegoferigo
Copy link
Member

@diegoferigo diegoferigo commented Oct 11, 2024

In this PR, I'm finally addressing a longstanding problem that complicated the usage of 32-bit precision as described in #136. After having explored more complex solutions, we decided to stop tracking the absolute simulation time within JaxSim, moving the responsibility to downstream code if necessary.

More details:

  • Remove JaxSimData.time() and JaxSimData.time_ns.
  • Add a new JaxSimModel.time_step that stores the default integration $\Delta t$. This can be useful in some particular cases, for example those system dynamics that need to know the $\Delta t$ used by the integrator (e.g. semi-implicit integrators, visco-elastic contacts, etc).
  • Add a new t0 argument to jaxsim.api.model.step, so that it's still possible to run AD w.r.t. the time if the dynamics considered by the integrator is time-dependent (this is rarely the case).

📚 Documentation preview 📚: https://jaxsim--262.org.readthedocs.build//262/

@diegoferigo diegoferigo self-assigned this Oct 11, 2024
@diegoferigo diegoferigo force-pushed the remove_time_from_data branch from e01ec46 to e43f736 Compare October 11, 2024 08:39
Copy link
Collaborator

@flferretti flferretti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot Diego! This was very much needed! I just left a couple comments

src/jaxsim/rbda/contacts/visco_elastic.py Show resolved Hide resolved
src/jaxsim/api/ode.py Outdated Show resolved Hide resolved
Co-authored-by: Filippo Luca Ferretti <102977828+flferretti@users.noreply.github.com>
@diegoferigo diegoferigo enabled auto-merge October 11, 2024 10:03
@diegoferigo diegoferigo merged commit b804caf into main Oct 11, 2024
24 checks passed
@diegoferigo diegoferigo deleted the remove_time_from_data branch October 11, 2024 10:17
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.

2 participants