Skip to content

Commit

Permalink
AttPosEKF: Fix inverted logic for inhibitMagStates
Browse files Browse the repository at this point in the history
  • Loading branch information
Zefz committed Mar 8, 2015
1 parent 1dc7d49 commit cdbd687
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/ekf_att_pos_estimator/estimator_22states.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,7 @@ void AttPosEKF::setOnGround(const bool isLanded)
bool isMovingForward = _accNavMagHorizontal > 0.5f;

// don't update magnetic field states if on ground or not using compass
inhibitMagStates = useCompass && !_onGround && (_isFixedWing || isMovingForward);
inhibitMagStates = !useCompass || _onGround) || (!_isFixedWing && !isMovingForward);

// don't update terrain offset state if there is no range finder and flying at low velocity or without GPS
if ((_onGround || !useGPS) && !useRangeFinder) {
Expand Down

0 comments on commit cdbd687

Please sign in to comment.