Skip to content

Commit

Permalink
Fix dictionary iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Feb 2, 2024
1 parent f5d189e commit 7bfacee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jaxsim/simulation/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def get_model(self, model_name: str) -> Model:
The model with the given name.
"""

if model_name not in self.data.models.keys():
if model_name not in self.data.models:
raise ValueError(f"Failed to find model '{model_name}'")

return self.data.models[model_name]
Expand Down Expand Up @@ -250,7 +250,7 @@ def set_gravity(self, gravity: jtp.Vector) -> None:

self.data.gravity = gravity

for model_name, model in self.data.models.items():
for model in self.data.models.values():
model.physics_model.set_gravity(gravity=gravity)

@functools.partial(oop.jax_tf.method_rw, jit=False, vmap=False, validate=False)
Expand Down

0 comments on commit 7bfacee

Please sign in to comment.