Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integration stage for integrators of type ExplicitRungeKuttaSOMixin #192

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading