mission_base: land_start_item invalid only when negative. (#22856)

rtl: land_start_item invalid only when negative.

Update src/modules/navigator/rtl.cpp
This commit is contained in:
KonradRudin 2024-03-11 09:46:16 +01:00 committed by GitHub
parent a80a5a92f4
commit 8dcfcf5b9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ protected:
* @return true If mission has a land start of land item and a land item * @return true If mission has a land start of land item and a land item
* @return false otherwise * @return false otherwise
*/ */
bool hasMissionLandStart() const { return _mission.land_start_index > 0 && _mission.land_index > 0;}; bool hasMissionLandStart() const { return _mission.land_start_index >= 0 && _mission.land_index >= 0;};
/** /**
* @brief Go to next Mission Item * @brief Go to next Mission Item
* Go to next non jump mission item * Go to next non jump mission item

View File

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