Skip to content

Commit fa77dda

Browse files
committed
Sub:stop spammin depth sensor messages
1 parent ddccad8 commit fa77dda

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ArduSub/mode.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ bool Sub::set_mode(Mode::Number mode, ModeReason reason)
9595

9696
// check for valid altitude if old mode did not require it but new one does
9797
// we only want to stop changing modes if it could make things worse
98-
if (!sub.control_check_barometer() && // maybe use ekf_alt_ok() instead?
99-
flightmode->has_manual_throttle() &&
100-
!new_flightmode->has_manual_throttle()) {
98+
if (flightmode->has_manual_throttle() &&
99+
!new_flightmode->has_manual_throttle() &&
100+
!sub.control_check_barometer()) { // maybe use ekf_alt_ok() instead?
101101
gcs().send_text(MAV_SEVERITY_WARNING, "Mode change failed: %s need alt estimate", new_flightmode->name());
102102
LOGGER_WRITE_ERROR(LogErrorSubsystem::FLIGHT_MODE, LogErrorCode(mode));
103103
return false;

0 commit comments

Comments
 (0)