Skip to content

Commit

Permalink
Fix integration stage for integrators of type `ExplicitRungeKuttaSO3M…
Browse files Browse the repository at this point in the history
…ixin`

Co-authored-by: Diego Ferigo <[email protected]>
  • Loading branch information
xela-95 and diegoferigo committed Jul 1, 2024
1 parent 7340d43 commit 875daa5
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/jaxsim/integrators/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import jaxsim.api as js
import jaxsim.typing as jtp
from jaxsim.math import Quaternion
from jaxsim.utils.jaxsim_dataclass import JaxsimDataclass, Mutability

try:
Expand Down Expand Up @@ -548,17 +547,11 @@ def integrate_rk_stage(
op = lambda x0_leaf, k_leaf: x0_leaf + dt * k_leaf
xf: js.ode_data.ODEState = jax.tree_util.tree_map(op, x0, k)

W_Q_B_t0 = x0.physics_model.base_quaternion
W_ω_WB_t0 = x0.physics_model.base_angular_velocity
W_Q_B_tf = xf.physics_model.base_quaternion

return xf.replace(
physics_model=xf.physics_model.replace(
base_quaternion=Quaternion.integration(
quaternion=W_Q_B_t0,
dt=dt,
omega=W_ω_WB_t0,
omega_in_body_fixed=False,
),
base_quaternion=W_Q_B_tf / jnp.linalg.norm(W_Q_B_tf)
)
)

Expand Down

0 comments on commit 875daa5

Please sign in to comment.