Skip to content

Commit

Permalink
mpu9250: fix magnetometer component issue introduced with #200 (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitlith authored Jan 23, 2023
1 parent db52508 commit 312037f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sensors/mpu9250sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void MPU9250Sensor::startCalibration(int calibrationType) {
ledManager.on();
int16_t mx,my,mz;
imu.getMagnetometer(&mx, &my, &mz);
magneto->sample(mx, my, mz);
magneto->sample(my, mx, -mz);

float rawMagFloat[3] = { (float)mx, (float)my, (float)mz};
Network::sendRawCalibrationData(rawMagFloat, CALIBRATION_TYPE_EXTERNAL_MAG, 0);
Expand Down Expand Up @@ -335,7 +335,7 @@ void MPU9250Sensor::startCalibration(int calibrationType) {
int16_t ax,ay,az,gx,gy,gz,mx,my,mz;
imu.getMotion9(&ax, &ay, &az, &gx, &gy, &gz, &mx, &my, &mz);
magneto_acc->sample(ax, ay, az);
magneto_mag->sample(mx, my, -mz);
magneto_mag->sample(my, mx, -mz);

// Thought: since we're sending the samples to the server anyway,
// we could make the server run magneto for us.
Expand Down

0 comments on commit 312037f

Please sign in to comment.