Browse Source

Navigator: Support finer granularity of RTL and failsafe actions

sbg
Lorenz Meier 9 years ago
parent
commit
5c70b44d0a
  1. 16
      src/modules/navigator/navigator_main.cpp
  2. 27
      src/modules/navigator/navigator_params.c

16
src/modules/navigator/navigator_main.cpp

@ -518,13 +518,13 @@ Navigator::task_main()
break; break;
case vehicle_status_s::NAVIGATION_STATE_AUTO_RCRECOVER: case vehicle_status_s::NAVIGATION_STATE_AUTO_RCRECOVER:
_pos_sp_triplet_published_invalid_once = false; _pos_sp_triplet_published_invalid_once = false;
if (_param_rcloss_act.get() == 0) { if (_param_rcloss_act.get() == 1) {
_navigation_mode = &_loiter; _navigation_mode = &_loiter;
} else if (_param_rcloss_act.get() == 2) {
_navigation_mode = &_land;
} else if (_param_rcloss_act.get() == 3) { } else if (_param_rcloss_act.get() == 3) {
_navigation_mode = &_land;
} else if (_param_rcloss_act.get() == 4) {
_navigation_mode = &_rcLoss; _navigation_mode = &_rcLoss;
} else { /* if == 1 or unknown, RTL */ } else { /* if == 2 or unknown, RTL */
_navigation_mode = &_rtl; _navigation_mode = &_rtl;
} }
break; break;
@ -548,13 +548,13 @@ Navigator::task_main()
/* Use complex data link loss mode only when enabled via param /* Use complex data link loss mode only when enabled via param
* otherwise use rtl */ * otherwise use rtl */
_pos_sp_triplet_published_invalid_once = false; _pos_sp_triplet_published_invalid_once = false;
if (_param_datalinkloss_act.get() == 0) { if (_param_datalinkloss_act.get() == 1) {
_navigation_mode = &_loiter; _navigation_mode = &_loiter;
} else if (_param_datalinkloss_act.get() == 2) {
_navigation_mode = &_land;
} else if (_param_datalinkloss_act.get() == 3) { } else if (_param_datalinkloss_act.get() == 3) {
_navigation_mode = &_land;
} else if (_param_datalinkloss_act.get() == 4) {
_navigation_mode = &_dataLinkLoss; _navigation_mode = &_dataLinkLoss;
} else { /* if == 1 or unknown, RTL */ } else { /* if == 2 or unknown, RTL */
_navigation_mode = &_rtl; _navigation_mode = &_rtl;
} }
break; break;

27
src/modules/navigator/navigator_params.c

@ -68,34 +68,35 @@ PARAM_DEFINE_FLOAT(NAV_ACC_RAD, 10.0f);
* Set data link loss failsafe mode * Set data link loss failsafe mode
* *
* The data link loss failsafe will only be entered after a timeout, * The data link loss failsafe will only be entered after a timeout,
* set by a DIFFERENT parameter. If the timeout value is smaller than * set by COM_RC_LOSS_T in seconds.
* zero it will never be entered.
* *
* @value 0 Loiter * @value 0 Disabled
* @value 1 Return to Land * @value 1 Loiter
* @value 2 Land at current position * @value 2 Return to Land
* @value 3 Outback Challenge (OBC) rules * @value 3 Land at current position
* @value 4 Outback Challenge (OBC) rules
* *
* @group Mission * @group Mission
*/ */
PARAM_DEFINE_INT32(NAV_DLL_ACT, 1); PARAM_DEFINE_INT32(NAV_DLL_ACT, 0);
/** /**
* Set RC loss failsafe mode * Set RC loss failsafe mode
* *
* The RC loss failsafe will only be entered after a timeout, * The RC loss failsafe will only be entered after a timeout,
* set by a DIFFERENT parameter. If the timeout value is smaller than * set by COM_RC_LOSS_T in seconds. If the timeout value is smaller than
* zero it will never be entered. If RC input checks have been disabled * 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. * by setting the COM_RC_IN_MODE param it will also not be triggered.
* *
* @value 0 Loiter * @value 0 Disabled
* @value 1 Return to Land * @value 1 Loiter
* @value 2 Land at current position * @value 2 Return to Land
* @value 3 Outback Challenge (OBC) rules * @value 3 Land at current position
* @value 4 Outback Challenge (OBC) rules
* *
* @group Mission * @group Mission
*/ */
PARAM_DEFINE_INT32(NAV_RCL_ACT, 1); PARAM_DEFINE_INT32(NAV_RCL_ACT, 0);
/** /**
* Airfield home Lat * Airfield home Lat

Loading…
Cancel
Save