Skip to content

Commit

Permalink
Add NaN check for quaternions
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Feb 14, 2025
1 parent 57fae8b commit 938d9ce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/jaxsim/rbda/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ def process_inputs(
if W_Q_B.shape != (4,):
raise ValueError(W_Q_B.shape, (4,))

# Check that the quaternion does not contain NaNs.
exceptions.raise_value_error_if(
condition=jnp.isnan(W_Q_B).any(),
msg="A RBDA received a quaternion that contains NaNs.",
)

# Check that the quaternion is unary since our RBDAs make this assumption in order
# to prevent introducing additional normalizations that would affect AD.
exceptions.raise_value_error_if(
Expand Down

0 comments on commit 938d9ce

Please sign in to comment.