Skip to content

Commit

Permalink
fix quaternion integration equation in backend np
Browse files Browse the repository at this point in the history
  • Loading branch information
penghuanggp committed Dec 12, 2023
1 parent 5bd08d8 commit 8e54aa5
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
#
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 8e54aa5

Please sign in to comment.