diff --git a/src/modules/navigator/navigator.h b/src/modules/navigator/navigator.h index b4f0832429..c4503cd262 100644 --- a/src/modules/navigator/navigator.h +++ b/src/modules/navigator/navigator.h @@ -266,8 +266,8 @@ private: control::BlockParamFloat _param_loiter_radius; /**< loiter radius for fixedwing */ control::BlockParamFloat _param_acceptance_radius; /**< acceptance for takeoff */ - control::BlockParamInt _param_datalinkloss_obc; /**< if true: obc mode on data link loss enabled */ - control::BlockParamInt _param_rcloss_obc; /**< if true: obc mode on rc loss enabled */ + control::BlockParamInt _param_datalinkloss_act; /**< select data link loss action */ + control::BlockParamInt _param_rcloss_act; /**< select data link loss action */ control::BlockParamFloat _param_cruising_speed_hover; control::BlockParamFloat _param_cruising_speed_plane; diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp index 4e10c848aa..98305906cf 100644 --- a/src/modules/navigator/navigator_main.cpp +++ b/src/modules/navigator/navigator_main.cpp @@ -153,8 +153,8 @@ Navigator::Navigator() : _follow_target(this, "TAR"), _param_loiter_radius(this, "LOITER_RAD"), _param_acceptance_radius(this, "ACC_RAD"), - _param_datalinkloss_obc(this, "DLL_OBC"), - _param_rcloss_obc(this, "RCL_OBC"), + _param_datalinkloss_act(this, "DLL_ACT"), + _param_rcloss_act(this, "RCL_ACT"), _param_cruising_speed_hover(this, "MPC_XY_CRUISE", false), _param_cruising_speed_plane(this, "FW_AIRSPD_TRIM", false), _mission_cruising_speed(-1.0f) @@ -481,9 +481,13 @@ Navigator::task_main() break; case vehicle_status_s::NAVIGATION_STATE_AUTO_RCRECOVER: _pos_sp_triplet_published_invalid_once = false; - if (_param_rcloss_obc.get() != 0) { + if (_param_rcloss_act.get() == 0) { + _navigation_mode = &_loiter; + } else if (_param_rcloss_act.get() == 2) { + _navigation_mode = &_land; + } else if (_param_rcloss_act.get() == 3) { _navigation_mode = &_rcLoss; - } else { + } else { /* if == 1 or unknown, RTL */ _navigation_mode = &_rtl; } break; @@ -507,9 +511,13 @@ Navigator::task_main() /* Use complex data link loss mode only when enabled via param * otherwise use rtl */ _pos_sp_triplet_published_invalid_once = false; - if (_param_datalinkloss_obc.get() != 0) { + if (_param_datalinkloss_act.get() == 0) { + _navigation_mode = &_loiter; + } else if (_param_datalinkloss_act.get() == 2) { + _navigation_mode = &_land; + } else if (_param_datalinkloss_act.get() == 3) { _navigation_mode = &_dataLinkLoss; - } else { + } else { /* if == 1 or unknown, RTL */ _navigation_mode = &_rtl; } break; diff --git a/src/modules/navigator/navigator_params.c b/src/modules/navigator/navigator_params.c index aeff97111a..3b7fed8852 100644 --- a/src/modules/navigator/navigator_params.c +++ b/src/modules/navigator/navigator_params.c @@ -65,24 +65,37 @@ PARAM_DEFINE_FLOAT(NAV_LOITER_RAD, 50.0f); PARAM_DEFINE_FLOAT(NAV_ACC_RAD, 10.0f); /** - * Set OBC mode for data link loss + * Set data link loss failsafe mode * - * If set to 1 the behaviour on data link loss is set to a mode according to the Outback Challenge (OBC) rules + * The data link loss failsafe will only be entered after a timeout, + * set by a DIFFERENT parameter. If the timeout value is smaller than + * zero it will never be entered. + * + * @value 0 Loiter + * @value 1 Return to Land + * @value 2 Land at current position + * @value 3 Outback Challenge (OBC) rules * - * @boolean * @group Mission */ -PARAM_DEFINE_INT32(NAV_DLL_OBC, 0); +PARAM_DEFINE_INT32(NAV_DLL_ACT, 1); /** - * Set OBC mode for rc loss + * Set RC loss failsafe mode * - * If set to 1 the behaviour on data link loss is set to a mode according to the Outback Challenge (OBC) rules + * The RC loss failsafe will only be entered after a timeout, + * set by a DIFFERENT parameter. If the timeout value is smaller than + * zero it will never be entered. If RC input checks have been disabled + * by setting the COM_RC_IN_MODE param it will also not be triggered. + * + * @value 0 Loiter + * @value 1 Return to Land + * @value 2 Land at current position + * @value 3 Outback Challenge (OBC) rules * - * @boolean * @group Mission */ -PARAM_DEFINE_INT32(NAV_RCL_OBC, 0); +PARAM_DEFINE_INT32(NAV_RCL_ACT, 1); /** * Airfield home Lat