RT: only chose mission RTL if mission is valid

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2024-04-11 10:39:49 +02:00
parent 5fab21d099
commit 926e7878af
2 changed files with 7 additions and 1 deletions

View File

@ -617,7 +617,8 @@ void RTL::parameters_update()
bool RTL::hasMissionLandStart() const
{
return _mission_sub.get().land_start_index >= 0 && _mission_sub.get().land_index >= 0;
return _mission_sub.get().land_start_index >= 0 && _mission_sub.get().land_index >= 0
&& _navigator->get_mission_result()->valid;
}
bool RTL::hasVtolLandApproach(const PositionYawSetpoint &rtl_position) const

View File

@ -97,6 +97,11 @@ private:
};
private:
/**
* @brief Check mission landing validity
* @return true if mission has a land start, a land and is valid
*/
bool hasMissionLandStart() const;
/**