diff --git a/src/sensors/mpu9250sensor.cpp b/src/sensors/mpu9250sensor.cpp index 50b03fdd5..b4b3d12d5 100644 --- a/src/sensors/mpu9250sensor.cpp +++ b/src/sensors/mpu9250sensor.cpp @@ -274,9 +274,9 @@ void MPU9250Sensor::getMPUScaled() // Orientations of axes are set in accordance with the datasheet // See Section 9.1 Orientation of Axes // https://invensense.tdk.com/wp-content/uploads/2015/02/PS-MPU-9250A-01-v1.1.pdf - Mxyz[0] = (float)my; - Mxyz[1] = (float)mx; - Mxyz[2] = -(float)mz; + Mxyz[0] = (float)mx; + Mxyz[1] = (float)my; + Mxyz[2] = (float)mz; //apply offsets and scale factors from Magneto #if useFullCalibrationMatrix == true for (i = 0; i < 3; i++) @@ -309,9 +309,9 @@ void MPU9250Sensor::startCalibration(int calibrationType) { ledManager.on(); int16_t mx,my,mz; imu.getMagnetometer(&mx, &my, &mz); - calibrationDataMag[i * 3 + 0] = my; - calibrationDataMag[i * 3 + 1] = mx; - calibrationDataMag[i * 3 + 2] = -mz; + calibrationDataMag[i * 3 + 0] = mx; + calibrationDataMag[i * 3 + 1] = my; + calibrationDataMag[i * 3 + 2] = mz; Network::sendRawCalibrationData(calibrationDataMag, CALIBRATION_TYPE_EXTERNAL_MAG, 0); ledManager.off(); delay(250); @@ -378,9 +378,9 @@ void MPU9250Sensor::startCalibration(int calibrationType) { calibrationDataAcc[i * 3 + 0] = ax; calibrationDataAcc[i * 3 + 1] = ay; calibrationDataAcc[i * 3 + 2] = az; - calibrationDataMag[i * 3 + 0] = my; - calibrationDataMag[i * 3 + 1] = mx; - calibrationDataMag[i * 3 + 2] = -mz; + calibrationDataMag[i * 3 + 0] = mx; + calibrationDataMag[i * 3 + 1] = my; + calibrationDataMag[i * 3 + 2] = mz; Network::sendRawCalibrationData(calibrationDataAcc, CALIBRATION_TYPE_EXTERNAL_ACCEL, 0); Network::sendRawCalibrationData(calibrationDataMag, CALIBRATION_TYPE_EXTERNAL_MAG, 0); ledManager.off();