AP_NavEKF: fixed compass offset sign error

This commit is contained in:
Paul Riseborough 2014-01-02 16:53:33 +11:00 committed by Andrew Tridgell
parent ee774f69d0
commit be9f276f45

View File

@ -2054,8 +2054,8 @@ void NavEKF::readMagData()
if (_ahrs->get_compass()->last_update != lastMagUpdate) {
lastMagUpdate = _ahrs->get_compass()->last_update;
magData = _ahrs->get_compass()->get_field() * 0.001f;
magBias = _ahrs->get_compass()->get_offsets() * 0.001f;
magBias = -_ahrs->get_compass()->get_offsets() * 0.001f;
magData = _ahrs->get_compass()->get_field() * 0.001f + magBias;
// Recall states from compass measurement time
RecallStates(statesAtMagMeasTime, (IMUmsec - msecMagDelay));