mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 11:06:04 +08:00
Commander: no battery time based RTL when already landed
This commit is contained in:
@@ -3857,9 +3857,10 @@ void Commander::battery_status_check()
|
|||||||
|
|
||||||
// Compare estimate of RTL time to estimate of remaining flight time
|
// Compare estimate of RTL time to estimate of remaining flight time
|
||||||
if (_rtl_time_estimate_sub.copy(&rtl_time_estimate)
|
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
|
&& rtl_time_estimate.valid
|
||||||
&& _armed.armed
|
&& _armed.armed
|
||||||
|
&& !_vehicle_land_detected.ground_contact // not in any landing stage
|
||||||
&& !_rtl_time_actions_done
|
&& !_rtl_time_actions_done
|
||||||
&& PX4_ISFINITE(worst_battery_time_s)
|
&& PX4_ISFINITE(worst_battery_time_s)
|
||||||
&& rtl_time_estimate.safe_time_estimate >= worst_battery_time_s
|
&& rtl_time_estimate.safe_time_estimate >= worst_battery_time_s
|
||||||
|
|||||||
Reference in New Issue
Block a user