mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
Fix the orientation of the magnetometer
This commit is contained in:
parent
43ed6cd89c
commit
2240ad924a
@ -250,8 +250,8 @@ static void SensorsTask(void *parameters)
|
|||||||
int16_t values[3];
|
int16_t values[3];
|
||||||
PIOS_HMC5883_ReadMag(values);
|
PIOS_HMC5883_ReadMag(values);
|
||||||
MagnetometerData mag; // Skip get as we set all the fields
|
MagnetometerData mag; // Skip get as we set all the fields
|
||||||
mag.x = -values[0];
|
mag.x = values[1];
|
||||||
mag.y = -values[1];
|
mag.y = values[0];
|
||||||
mag.z = -values[2];
|
mag.z = -values[2];
|
||||||
MagnetometerSet(&mag);
|
MagnetometerSet(&mag);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user