Browse Source

Copter: fix optflow position_ok check

We should accept predicted relative horizontal position only when disarmed
mission-4.1.18
Randy Mackay 10 years ago
parent
commit
be603da579
  1. 8
      ArduCopter/system.cpp

8
ArduCopter/system.cpp

@ -353,7 +353,13 @@ bool Copter::optflow_position_ok() @@ -353,7 +353,13 @@ bool Copter::optflow_position_ok()
// get filter status from EKF
nav_filter_status filt_status = inertial_nav.get_filter_status();
return (filt_status.flags.horiz_pos_rel || filt_status.flags.pred_horiz_pos_rel);
// if disarmed we accept a predicted horizontal relative position
if (!motors.armed()) {
return (filt_status.flags.pred_horiz_pos_rel);
} else {
return (filt_status.flags.horiz_pos_rel && !filt_status.flags.const_pos_mode);
}
#endif
}

Loading…
Cancel
Save