Skip to content

Commit

Permalink
move imufusion into imu part
Browse files Browse the repository at this point in the history
  • Loading branch information
DocGarbanzo committed Sep 25, 2024
1 parent 38eaf9c commit 39d03fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions donkeycar/parts/imu.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ def poll(self):
self.time = new_time
delta_t = new_time - self.time
# convert from radians to degrees
gyro = self.offset.update(self.mpu.gyro / 180 * math.pi)
accel = self.mpu.acceleration / 9.81
scaled_gyro = np.array(self.mpu.gyro) / 180 * math.pi
gyro = self.offset.update(scaled_gyro)
accel = np.array(self.mpu.acceleration) / 9.81
self.ahrs.update_no_magnetometer(gyro, accel, delta_t)

euler = self.ahrs.quaternion.to_euler()
Expand Down

0 comments on commit 39d03fe

Please sign in to comment.