Skip to content

Commit

Permalink
Minor aesthetic fix for comments in Madgwick.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayitzin committed Jan 31, 2025
1 parent 2738c92 commit 29719a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ahrs/filters/madgwick.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ def updateMARG(self, q: np.ndarray, gyr: np.ndarray, acc: np.ndarray, mag: np.nd
m = mag/np.linalg.norm(mag)
# Rotate normalized magnetometer measurements
q_m = Quaternion([0, *m])
h = q.product(q_m.product(q.conj)) # (eq. 45)
h = q.product(q_m.product(q.conj)) # (eq. 45)
bx = np.linalg.norm([h[1], h[2]]) # (eq. 46)
bz = h[3]
qw, qx, qy, qz = q/np.linalg.norm(q)
Expand All @@ -734,6 +734,6 @@ def updateMARG(self, q: np.ndarray, gyr: np.ndarray, acc: np.ndarray, mag: np.nd
gradient = J.T@f # (eq. 34)
gradient /= np.linalg.norm(gradient)
qDot -= self.gain*gradient # (eq. 33)
q_new = q + qDot*dt # (eq. 13)
q_new = q + qDot*dt # (eq. 13)
q_new /= np.linalg.norm(q_new)
return q_new

0 comments on commit 29719a3

Please sign in to comment.