AP_NavEKF: compiler warnings: apply is_zero(float) or is_equal(float)

This commit is contained in:
Tom Pittenger 2015-05-02 02:12:27 -07:00 committed by Andrew Tridgell
parent 35f7a466e5
commit 3276eec30e

View File

@ -4262,7 +4262,7 @@ void NavEKF::readMagData()
// check if compass offsets have ben changed and adjust EKF bias states to maintain consistent innovations
if (_ahrs->get_compass()->healthy(0)) {
Vector3f nowMagOffsets = _ahrs->get_compass()->get_offsets(0);
bool changeDetected = ((nowMagOffsets.x != lastMagOffsets.x) || (nowMagOffsets.y != lastMagOffsets.y) || (nowMagOffsets.z != lastMagOffsets.z));
bool changeDetected = (!AP_Math::is_equal(nowMagOffsets.x,lastMagOffsets.x) || !AP_Math::is_equal(nowMagOffsets.y,lastMagOffsets.y) || !AP_Math::is_equal(nowMagOffsets.z,lastMagOffsets.z));
// Ignore bias changes before final mag field and yaw initialisation, as there may have been a compass calibration
if (changeDetected && secondMagYawInit) {
state.body_magfield.x += (nowMagOffsets.x - lastMagOffsets.x) * 0.001f;