AP_Compass: IST8310 chip does not follow right-hand rule format, flip z

This commit is contained in:
Tom Pittenger 2017-02-28 12:11:34 -08:00 committed by Andrew Tridgell
parent b339050e45
commit 8415fde697

View File

@ -183,6 +183,9 @@ void AP_Compass_IST8310::timer()
auto y = static_cast<int16_t>(le16toh(buffer.ry));
auto z = static_cast<int16_t>(le16toh(buffer.rz));
// flip Z to conform to right-hand rule convention
z = -z;
/* convert uT to milligauss */
Vector3f field = Vector3f{x * 3.0f, y * 3.0f, z * 3.0f};