RTLDirect: check for terrain collision in every state of RTL beside when landing

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2024-08-06 23:38:38 +02:00
parent 588c4a04c8
commit a737036633

View File

@ -104,8 +104,9 @@ void RtlDirect::on_active()
set_rtl_item();
}
if (_rtl_state == RTLState::LOITER_HOLD) { //TODO: rename _rtl_state to _rtl_state_next
if (_rtl_state != RTLState::IDLE) { //TODO: rename _rtl_state to _rtl_state_next (when in IDLE we're actually in LAND)
//check for terrain collision and update altitude if needed
// note: it may trigger multiple times during a RTL, as every time the altitude set is reset
updateAltToAvoidTerrainCollisionAndRepublishTriplet(_mission_item);
}