diff --git a/src/shared/Sensors/MPU9255.cpp b/src/shared/Sensors/MPU9255.cpp index 6089e4e9d4933d8b32e6a37e13ae7b6d71fcdbc5..71c11a0aa41d2e5febba96e1cfbcbf14919c69fd 100644 --- a/src/shared/Sensors/MPU9255.cpp +++ b/src/shared/Sensors/MPU9255.cpp @@ -27,11 +27,13 @@ bool MPU9255::init() { bool result = true; i2cInit(); + Thread::sleep(10); + if (!i2cReadIDTest()) { return false; } - axelInit(AFS_4G); // inizializzo l'acceleromerto + axelInit(AFS_16G); // inizializzo l'acceleromerto tempInit(); result = result && gyroInit(GFS_2000DPS); // inizializzo il giroscopio configPassThrough(); // Necessario per accedere direttamente al diff --git a/src/shared/Sensors/MPU9255.h b/src/shared/Sensors/MPU9255.h index d642b39a44783fc7687f245f296665c348fe8493..3ad3ea63ab76858fc02d5bb8ff3e45ab9c2fce21 100644 --- a/src/shared/Sensors/MPU9255.h +++ b/src/shared/Sensors/MPU9255.h @@ -174,11 +174,12 @@ private: bool initialized = false; // CALIBRATION VALUES - const float sensor_fsr = 32767.0; + const float sensor_fsr = 32768.0f; // ACCELEROMETER const float axel_x_offset = 0; // offset in g, it's to be filled by hand const float axel_y_offset = 0; // offset in g, it's to be filled by hand - const float axel_z_offset = 0.11; // offset in g, it's to be filled by hand + const float axel_z_offset = 0; // offset in g, it's to be filled by hand + // GYROSCOPE const float gyro_x_offset = 0; // default offset in LSB, it will be // overwritten at every start, with the new