From 0ecc8278b60d6796b31e1eb087eb27730e6eff89 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Thu, 7 Nov 2024 15:40:03 +0100 Subject: [PATCH 1/5] Navigator: RTL_direct: onyl start precision land if param is set to enable Signed-off-by: Silvan Fuhrer --- src/modules/navigator/mission_block.cpp | 2 +- src/modules/navigator/rtl_direct.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/navigator/mission_block.cpp b/src/modules/navigator/mission_block.cpp index b07542984dec..cbcefcd128fb 100644 --- a/src/modules/navigator/mission_block.cpp +++ b/src/modules/navigator/mission_block.cpp @@ -978,7 +978,7 @@ void MissionBlock::startPrecLand(uint16_t land_precision) _navigator->get_precland()->set_mode(PrecLandMode::Opportunistic); _navigator->get_precland()->on_activation(); - } else { //_mission_item.land_precision == 2 + } else if (_mission_item.land_precision == 2) { _navigator->get_precland()->set_mode(PrecLandMode::Required); _navigator->get_precland()->on_activation(); } diff --git a/src/modules/navigator/rtl_direct.cpp b/src/modules/navigator/rtl_direct.cpp index c264c6fc88b4..ee8d14ffc0f5 100644 --- a/src/modules/navigator/rtl_direct.cpp +++ b/src/modules/navigator/rtl_direct.cpp @@ -369,7 +369,9 @@ void RtlDirect::set_rtl_item() _mission_item.land_precision = _param_rtl_pld_md.get(); - startPrecLand(_mission_item.land_precision); + if (_mission_item.land_precision > 0) { + startPrecLand(_mission_item.land_precision); + } mavlink_log_info(_navigator->get_mavlink_log_pub(), "RTL: land at destination\t"); events::send(events::ID("rtl_land_at_destination"), events::Log::Info, "RTL: land at destination"); From e29c86c81fd7c0c049f1e31ba353e868f51a826b Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Mon, 11 Nov 2024 14:28:15 +0100 Subject: [PATCH 2/5] rtl_direct: don't check RTL_PLD_MD param twice but use _mission_item.land_precision Signed-off-by: Silvan Fuhrer --- src/modules/navigator/rtl_direct.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/navigator/rtl_direct.cpp b/src/modules/navigator/rtl_direct.cpp index ee8d14ffc0f5..88f4da22499a 100644 --- a/src/modules/navigator/rtl_direct.cpp +++ b/src/modules/navigator/rtl_direct.cpp @@ -110,7 +110,7 @@ void RtlDirect::on_active() updateAltToAvoidTerrainCollisionAndRepublishTriplet(_mission_item); } - if (_rtl_state == RTLState::LAND && _param_rtl_pld_md.get() > 0) { + if (_rtl_state == RTLState::LAND && _mission_item.land_precision > 0) { // Need to update the position and type on the current setpoint triplet. _navigator->get_precland()->on_active(); From 368bbfeb3b0155649920deeca5ba82c1e80183ce Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Mon, 11 Nov 2024 14:44:14 +0100 Subject: [PATCH 3/5] RTL params: make clear that RTL_PLD_MD does not apply for mission RTL destinations Signed-off-by: Silvan Fuhrer --- src/modules/navigator/rtl_params.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/navigator/rtl_params.c b/src/modules/navigator/rtl_params.c index 6fd734cc8e41..951993a7248c 100644 --- a/src/modules/navigator/rtl_params.c +++ b/src/modules/navigator/rtl_params.c @@ -139,6 +139,7 @@ PARAM_DEFINE_INT32(RTL_CONE_ANG, 45); * RTL precision land mode * * Use precision landing when doing an RTL landing phase. + * This setting does not apply for RTL destinations planned as part of a mission. * * @value 0 No precision landing * @value 1 Opportunistic precision landing From d98a706380f79667a5e9b5bf433f34b50e6894b3 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Tue, 12 Nov 2024 11:22:49 +0100 Subject: [PATCH 4/5] RTL fast reverse: enable precision landing Signed-off-by: Silvan Fuhrer --- src/modules/navigator/mission_base.h | 3 ++- src/modules/navigator/rtl_mission_fast_reverse.cpp | 7 +++++++ src/modules/navigator/rtl_mission_fast_reverse.h | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/modules/navigator/mission_base.h b/src/modules/navigator/mission_base.h index b8093ca01cf9..e4a125fe6fbe 100644 --- a/src/modules/navigator/mission_base.h +++ b/src/modules/navigator/mission_base.h @@ -483,7 +483,8 @@ class MissionBase : public MissionBlock, public ModuleParams mission_item_s _last_camera_trigger_item {}; mission_item_s _last_speed_change_item {}; - DEFINE_PARAMETERS( + DEFINE_PARAMETERS_CUSTOM_PARENT( + ModuleParams, (ParamFloat) _param_mis_dist_1wp, (ParamInt) _param_mis_mnt_yaw_ctl ) diff --git a/src/modules/navigator/rtl_mission_fast_reverse.cpp b/src/modules/navigator/rtl_mission_fast_reverse.cpp index 707219b1b37a..b50d49e50a6c 100644 --- a/src/modules/navigator/rtl_mission_fast_reverse.cpp +++ b/src/modules/navigator/rtl_mission_fast_reverse.cpp @@ -269,6 +269,13 @@ void RtlMissionFastReverse::handleLanding(WorkItemType &new_work_item_type) _mission_item.altitude = _home_pos_sub.get().alt; _mission_item.altitude_is_relative = false; _navigator->reset_position_setpoint(pos_sp_triplet->previous); + + _mission_item.land_precision = _param_rtl_pld_md.get(); + + if (_mission_item.land_precision > 0) { + startPrecLand(_mission_item.land_precision); + new_work_item_type = WorkItemType::WORK_ITEM_TYPE_PRECISION_LAND; + } } } } diff --git a/src/modules/navigator/rtl_mission_fast_reverse.h b/src/modules/navigator/rtl_mission_fast_reverse.h index 9a30e6d70de5..0351f8dbf889 100644 --- a/src/modules/navigator/rtl_mission_fast_reverse.h +++ b/src/modules/navigator/rtl_mission_fast_reverse.h @@ -74,4 +74,8 @@ class RtlMissionFastReverse : public RtlBase bool _in_landing_phase{false}; uORB::SubscriptionData _home_pos_sub{ORB_ID(home_position)}; /**< home position subscription */ + DEFINE_PARAMETERS_CUSTOM_PARENT( + RtlBase, + (ParamInt) _param_rtl_pld_md + ) }; From 585e5d1482f8062c1760b3f8315f9df710c82280 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Tue, 12 Nov 2024 11:23:27 +0100 Subject: [PATCH 5/5] MissionBase: remove unused param Signed-off-by: Silvan Fuhrer --- src/modules/navigator/mission_base.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/navigator/mission_base.h b/src/modules/navigator/mission_base.h index e4a125fe6fbe..65a021d45d4a 100644 --- a/src/modules/navigator/mission_base.h +++ b/src/modules/navigator/mission_base.h @@ -485,7 +485,6 @@ class MissionBase : public MissionBlock, public ModuleParams DEFINE_PARAMETERS_CUSTOM_PARENT( ModuleParams, - (ParamFloat) _param_mis_dist_1wp, (ParamInt) _param_mis_mnt_yaw_ctl )