From 81747f35bb153cf3bae553d147e8d22c06ff2970 Mon Sep 17 00:00:00 2001 From: chfriedrich98 Date: Fri, 13 Sep 2024 15:11:56 +0200 Subject: [PATCH] rover: add descend navigation state to land detection --- src/modules/land_detector/RoverLandDetector.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/land_detector/RoverLandDetector.cpp b/src/modules/land_detector/RoverLandDetector.cpp index 2011419db8c3..8e59c0c5d296 100644 --- a/src/modules/land_detector/RoverLandDetector.cpp +++ b/src/modules/land_detector/RoverLandDetector.cpp @@ -55,12 +55,13 @@ bool RoverLandDetector::_get_landed_state() const float distance_to_home = get_distance_to_next_waypoint(_curr_pos(0), _curr_pos(1), _home_position(0), _home_position(1)); - if (_vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_LAND) { + if (_vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_LAND + || _vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_DESCEND) { return true; // If Landing has been requested then say we have landed. } else if (_vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_RTL && distance_to_home < _param_nav_acc_rad.get() && _param_rtl_land_delay.get() > -FLT_EPSILON) { - return true; // If the rover reaches the home position during RTL we say we have landed + return true; // If the rover reaches the home position during RTL we say we have landed. } else { return !_armed; // If we are armed we are not landed.