From ee076c66c99fbd7895459e80d679c374340a9ed2 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 7 Mar 2022 11:24:01 +0100 Subject: refactor: make misc improvements & update calibration precision --- src/sensor/calibration.hpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/sensor/calibration.hpp') diff --git a/src/sensor/calibration.hpp b/src/sensor/calibration.hpp index 585d655..17f8fa9 100644 --- a/src/sensor/calibration.hpp +++ b/src/sensor/calibration.hpp @@ -4,28 +4,28 @@ #include "serial.hpp" // Calibration precision -constexpr float ACCEL_CAL_X_MAX = 0.006; -constexpr float ACCEL_CAL_X_MIN = -0.006; +constexpr double ACCEL_CAL_X_MAX = 0.003; +constexpr double ACCEL_CAL_X_MIN = -0.003; -constexpr float ACCEL_CAL_Y_MAX = 0.006; -constexpr float ACCEL_CAL_Y_MIN = -0.006; +constexpr double ACCEL_CAL_Y_MAX = 0.003; +constexpr double ACCEL_CAL_Y_MIN = -0.003; -constexpr float ACCEL_CAL_Z_MAX = 0.006; -constexpr float ACCEL_CAL_Z_MIN = -0.006; +constexpr double ACCEL_CAL_Z_MAX = 0.003; +constexpr double ACCEL_CAL_Z_MIN = -0.003; -constexpr float GYRO_CAL_X_MAX = 0.06; -constexpr float GYRO_CAL_X_MIN = -0.06; +constexpr double GYRO_CAL_X_MAX = 0.003; +constexpr double GYRO_CAL_X_MIN = -0.003; -constexpr float GYRO_CAL_Y_MAX = 0.06; -constexpr float GYRO_CAL_Y_MIN = -0.06; +constexpr double GYRO_CAL_Y_MAX = 0.05; +constexpr double GYRO_CAL_Y_MIN = -0.05; -constexpr float GYRO_CAL_Z_MAX = 0.06; -constexpr float GYRO_CAL_Z_MIN = -0.06; +constexpr double GYRO_CAL_Z_MAX = 0.04; +constexpr double GYRO_CAL_Z_MIN = -0.04; -constexpr uint32_t CALIBRATION_TIMEOUT = 120000; // Milliseconds +constexpr uint32_t CALIBRATION_TIMEOUT = 120000; // milliseconds -constexpr unsigned int SENSOR_READ_CNT = 20; -constexpr float SENSOR_VAL_ADJUST = 0.05; +constexpr uint32_t SENSOR_READ_CNT = 20; +constexpr double SENSOR_VAL_ADJUST = 0.05; class SensorCalibratorValues { -- cgit v1.2.3-18-g5258