Skip to content

Commit

Permalink
Fixing accel / speed calc
Browse files Browse the repository at this point in the history
  • Loading branch information
DocGarbanzo committed Sep 28, 2024
1 parent a1ac68d commit b241923
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion donkeycar/parts/imu.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ def poll(self):
if not self.ahrs.flags.initialising:
self.euler = self.ahrs.quaternion.to_euler()
self.matrix = self.ahrs.quaternion.to_matrix()
self.lin_accel = np.dot(self.matrix, accel_phys) - self.accel_zero
self.lin_accel = np.dot(self.matrix, accel_phys)
# remove gravity from world coordinate z-axis
self.lin_accel[3] -= self.accel_zero[3]
delta_v = self.lin_accel * dt
self.speed += delta_v
self.pos += self.speed * dt
Expand Down

0 comments on commit b241923

Please sign in to comment.