Commander: no battery time based RTL when already landed

This commit is contained in:
Matthias Grob 2022-03-15 13:19:45 +01:00
parent 69f6092031
commit db1fb6acf7

View File

@ -3857,9 +3857,10 @@ void Commander::battery_status_check()
// Compare estimate of RTL time to estimate of remaining flight time
if (_rtl_time_estimate_sub.copy(&rtl_time_estimate)
&& hrt_absolute_time() - rtl_time_estimate.timestamp < 2_s
&& (hrt_absolute_time() - rtl_time_estimate.timestamp) < 2_s
&& rtl_time_estimate.valid
&& _armed.armed
&& !_vehicle_land_detected.ground_contact // not in any landing stage
&& !_rtl_time_actions_done
&& PX4_ISFINITE(worst_battery_time_s)
&& rtl_time_estimate.safe_time_estimate >= worst_battery_time_s