From 0d597728e29c26fb47a7c1eca2ed570e500389ed Mon Sep 17 00:00:00 2001 From: diegoferigo Date: Fri, 20 Oct 2023 14:03:32 +0200 Subject: [PATCH] Make all fields of simulator.JaxSim static, excluding SimulatorData Fixes trace leaks when jitting vectorized simulations --- src/jaxsim/simulation/simulator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jaxsim/simulation/simulator.py b/src/jaxsim/simulation/simulator.py index 6b7e9b77c..fa96c3650 100644 --- a/src/jaxsim/simulation/simulator.py +++ b/src/jaxsim/simulation/simulator.py @@ -63,7 +63,7 @@ class JaxSim(Vmappable): """The JaxSim simulator.""" # Step size stored in ns in order to prevent floats approximation - step_size_ns: jtp.Int = dataclasses.field( + step_size_ns: Static[jtp.Int] = dataclasses.field( default_factory=lambda: jnp.array(1_000_000, dtype=jnp.uint64) )