Skip to content

Commit

Permalink
fix quaternion integration equation in backend np (#383)
Browse files Browse the repository at this point in the history
* fix quaternion integration equation in backend np
  • Loading branch information
penghuanggp authored Dec 13, 2023
1 parent 963df7b commit d446a09
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crazyflie_sim/crazyflie_sim/backend/np.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ def rpm_to_force(rpm):
# to integrate the dynamics, see
# https://www.ashwinnarayan.com/post/how-to-integrate-quaternions/, and
# https://arxiv.org/pdf/1604.08139.pdf
# Sec 4.5, https://arxiv.org/pdf/1711.02508.pdf
omega_global = rowan.rotate(self.state.quat, self.state.omega)
q_next = rowan.normalize(
rowan.calculus.integrate(
self.state.quat, self.state.omega, dt))
self.state.quat, omega_global, dt))

# mJ = Jw x w + tau_u
omega_next = self.state.omega + (
Expand Down

0 comments on commit d446a09

Please sign in to comment.