Skip to content

Commit 3b62ca2

Browse files
committed
Fix wrong attitude indexing in sys_id model
1 parent 90fe83d commit 3b62ca2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crazyflow/sim/physics.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ def surrogate_identified_collective_wrench(
6161
acc = thrust * k1 + drift * k2
6262
rpy = rot.as_euler("xyz")
6363
k1, k2, k3 = SYS_ID_PARAMS["roll_acc"]
64-
roll_rate_deriv = k1 * rpy[0] + k2 * rpy_rates_local[0] + k3 * attitude[1]
64+
roll_rate_deriv = k1 * rpy[0] + k2 * rpy_rates_local[0] + k3 * attitude[0]
6565
k1, k2, k3 = SYS_ID_PARAMS["pitch_acc"]
66-
pitch_rate_deriv = k1 * rpy[1] + k2 * rpy_rates_local[1] + k3 * attitude[2]
66+
pitch_rate_deriv = k1 * rpy[1] + k2 * rpy_rates_local[1] + k3 * attitude[1]
6767
k1, k2, k3 = SYS_ID_PARAMS["yaw_acc"]
68-
yaw_rate_deriv = k1 * rpy[2] + k2 * rpy_rates_local[2] + k3 * attitude[3]
68+
yaw_rate_deriv = k1 * rpy[2] + k2 * rpy_rates_local[2] + k3 * attitude[2]
6969
rpy_rates_deriv = jnp.array([roll_rate_deriv, pitch_rate_deriv, yaw_rate_deriv])
7070
# The identified dynamics model does not use forces or torques, because we assume no knowledge
7171
# of the drone's mass and inertia. However, to remain compatible with the physics pipeline, we

0 commit comments

Comments
 (0)