Skip to content

Commit

Permalink
Fix calling PlaneTerrain.__eq__ from jit-compiled functions
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoferigo committed Jul 5, 2024
1 parent c744787 commit 0882bf9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/jaxsim/terrain/terrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import jax.numpy as jnp
import jax_dataclasses
import numpy as np

import jaxsim.typing as jtp

Expand Down Expand Up @@ -149,10 +150,10 @@ def __eq__(self, other: PlaneTerrain) -> bool:
return False

if not (
jnp.allclose(self.z, other.z)
and jnp.allclose(
jnp.array(self.plane_normal, dtype=float),
jnp.array(other.plane_normal, dtype=float),
np.allclose(self.z, other.z)
and np.allclose(
np.array(self.plane_normal, dtype=float),
np.array(other.plane_normal, dtype=float),
)
):
return False
Expand Down

0 comments on commit 0882bf9

Please sign in to comment.