Skip to content

Commit

Permalink
RT: only chose mission RTL if mission is valid
Browse files Browse the repository at this point in the history
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
  • Loading branch information
sfuhrer committed Apr 11, 2024
1 parent 5fab21d commit 926e787
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/navigator/rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/modules/navigator/rtl.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ class RTL : public NavigatorMode, public ModuleParams
};

private:

/**
* @brief Check mission landing validity
* @return true if mission has a land start, a land and is valid
*/
bool hasMissionLandStart() const;

/**
Expand Down

0 comments on commit 926e787

Please sign in to comment.