From 6ea5e13598538bc9817733e2f4c4da8f21ae6a93 Mon Sep 17 00:00:00 2001 From: Martin Schuck Date: Thu, 6 Aug 2026 13:38:00 +0200 Subject: [PATCH] Fix usage of array_namespace --- crazyflow/dynamics/utils/rotation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crazyflow/dynamics/utils/rotation.py b/crazyflow/dynamics/utils/rotation.py index 3df0fa2..5366c7b 100644 --- a/crazyflow/dynamics/utils/rotation.py +++ b/crazyflow/dynamics/utils/rotation.py @@ -74,7 +74,7 @@ def ang_vel2rpy_rates(quat: Array, ang_vel: Array) -> Array: def rpy_rates2ang_vel(quat: Array, rpy_rates: Array) -> Array: """Convert rpy rates to angular velocity with batch support.""" - xp = quat.__array_namespace__() + xp = array_namespace(quat) rpy = R.from_quat(quat).as_euler("xyz") phi, theta = rpy[..., 0], rpy[..., 1] @@ -105,7 +105,7 @@ def ang_vel_deriv2rpy_rates_deriv(quat: Array, ang_vel: Array, ang_vel_deriv: Ar \dot{\psi} = \mathbf{\dot{W}}\mathbf{\omega} + \mathbf{W} \dot{\mathbf{\omega}} \] """ - xp = quat.__array_namespace__() + xp = array_namespace(quat) rpy = R.from_quat(quat).as_euler("xyz") phi, theta = rpy[..., 0], rpy[..., 1] rpy_rates = ang_vel2rpy_rates(quat, ang_vel) @@ -151,7 +151,7 @@ def rpy_rates_deriv2ang_vel_deriv(quat: Array, rpy_rates: Array, rpy_rates_deriv \dot{\omega} = \mathbf{\dot{W}}\dot{\mathbf{\psi}} + \mathbf{W} \ddot{\mathbf{\psi}} \] """ - xp = quat.__array_namespace__() + xp = array_namespace(quat) rpy = R.from_quat(quat).as_euler("xyz") phi, theta = rpy[..., 0], rpy[..., 1] phi_dot, theta_dot = rpy_rates[..., 0], rpy_rates[..., 1]