aboutsummaryrefslogtreecommitdiff
path: root/src/modules/navigator/navigator_main.cpp
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-07-19 20:03:37 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-07-19 20:03:37 +0200
commitb5ef8fd2cd54d180b5debe362a4c1f07f64394af (patch)
tree46b9d8713629703eddb923fa644490fb46f1c3ec /src/modules/navigator/navigator_main.cpp
parent7baa337d9bcf7077a5e5080e951899cb595f6ff6 (diff)
downloadpx4-firmware-b5ef8fd2cd54d180b5debe362a4c1f07f64394af.tar.gz
px4-firmware-b5ef8fd2cd54d180b5debe362a4c1f07f64394af.tar.bz2
px4-firmware-b5ef8fd2cd54d180b5debe362a4c1f07f64394af.zip
create empty datalinkloss class for OBC
Currently the class does the same as the RTL class. It is now possible whichclass is sued in the navigator to handle datalink loss via a parameter
Diffstat (limited to 'src/modules/navigator/navigator_main.cpp')
-rw-r--r--src/modules/navigator/navigator_main.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp
index ba46bd568..1ce6770c9 100644
--- a/src/modules/navigator/navigator_main.cpp
+++ b/src/modules/navigator/navigator_main.cpp
@@ -40,6 +40,7 @@
* @author Jean Cyr <jean.m.cyr@gmail.com>
* @author Julian Oes <julian@oes.ch>
* @author Anton Babushkin <anton.babushkin@me.com>
+ * @author Thomas Gubler <thomasgubler@gmail.com>
*/
#include <nuttx/config.h>
@@ -125,10 +126,12 @@ Navigator::Navigator() :
_loiter(this, "LOI"),
_rtl(this, "RTL"),
_offboard(this, "OFF"),
+ _dataLinkLoss(this, "DLL"),
_can_loiter_at_sp(false),
_pos_sp_triplet_updated(false),
_param_loiter_radius(this, "LOITER_RAD"),
- _param_acceptance_radius(this, "ACC_RAD")
+ _param_acceptance_radius(this, "ACC_RAD"),
+ _param_datalinkloss_obc(this, "DLL_OBC")
{
/* Create a list of our possible navigation types */
_navigation_mode_array[0] = &_mission;
@@ -376,7 +379,13 @@ Navigator::task_main()
_navigation_mode = &_rtl;
break;
case NAVIGATION_STATE_AUTO_RTGS:
- _navigation_mode = &_rtl; /* TODO: change this to something else */
+ /* Use complex data link loss mode only when enabled via param
+ * otherwise use rtl */
+ if (_param_datalinkloss_obc.get() != 0) {
+ _navigation_mode = &_dataLinkLoss;
+ } else {
+ _navigation_mode = &_rtl; /* TODO: change this to something else */
+ }
break;
case NAVIGATION_STATE_LAND:
case NAVIGATION_STATE_TERMINATION: