Navigator RTL: run find_RTL_destination() only on_inactive

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2023-06-30 12:08:19 +02:00 committed by Beat Küng
parent f275085e84
commit a617e9c54b
1 changed files with 1 additions and 2 deletions

View File

@ -322,9 +322,8 @@ void RTL::on_active()
rtl_time_estimate_s rtl_time_estimate{};
rtl_time_estimate.valid = false;
// Calculate RTL destination and time estimate only when there is a valid home and global position
// Calculate time estimate only when there is a valid home and global position
if (_navigator->home_global_position_valid() && global_position_recently_updated) {
find_RTL_destination();
calcRtlTimeEstimate(_rtl_state, rtl_time_estimate);
rtl_time_estimate.valid = true;
}