From 32db48f802941726d73e289c686a446585fbf425 Mon Sep 17 00:00:00 2001 From: DocGarbanzo Date: Sat, 19 Oct 2024 21:27:24 +0100 Subject: [PATCH] Only print lin accel if valid --- donkeycar/parts/imu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/donkeycar/parts/imu.py b/donkeycar/parts/imu.py index 2f4d6fae1..cfdf6022c 100755 --- a/donkeycar/parts/imu.py +++ b/donkeycar/parts/imu.py @@ -144,7 +144,7 @@ def __init__(self): def calibrate(self): logger.info('Calibrating Mpu6050 ...') - num_loops = 400 + num_loops = 800 gyro = np.zeros(3) accel = np.zeros(3) accel_norm = 0 @@ -153,7 +153,7 @@ def calibrate(self): # tmp = self.mpu.gyro # tmp = self.mpu.acceleration tic = time.time() - for _ in range(2 * num_loops): + for _ in range(num_loops): gyro += self.mpu.gyro accel += self.mpu.acceleration accel_norm += np.linalg.norm(self.mpu.acceleration)