aboutsummaryrefslogtreecommitdiff
path: root/src/modules/navigator
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-07-19 19:25:53 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-07-19 19:25:53 +0200
commit7baa337d9bcf7077a5e5080e951899cb595f6ff6 (patch)
treee301ebd9a1279f64ce4df2571aff45db99d12b3d /src/modules/navigator
parentfd5065535435f9f3fa3c32b620db471f905072c2 (diff)
downloadpx4-firmware-7baa337d9bcf7077a5e5080e951899cb595f6ff6.tar.gz
px4-firmware-7baa337d9bcf7077a5e5080e951899cb595f6ff6.tar.bz2
px4-firmware-7baa337d9bcf7077a5e5080e951899cb595f6ff6.zip
flight termination on geofence violation
Diffstat (limited to 'src/modules/navigator')
-rw-r--r--src/modules/navigator/navigator_main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp
index 331a9a728..ba46bd568 100644
--- a/src/modules/navigator/navigator_main.cpp
+++ b/src/modules/navigator/navigator_main.cpp
@@ -335,6 +335,11 @@ Navigator::task_main()
/* Check geofence violation */
if (!_geofence.inside(&_global_pos)) {
+ /* inform other apps via the sp triplet */
+ _pos_sp_triplet.geofence_violated = true;
+ if (_pos_sp_triplet.geofence_violated != true) {
+ _pos_sp_triplet_updated = true;
+ }
/* Issue a warning about the geofence violation once */
if (!_geofence_violation_warning_sent) {
@@ -342,6 +347,11 @@ Navigator::task_main()
_geofence_violation_warning_sent = true;
}
} else {
+ /* inform other apps via the sp triplet */
+ _pos_sp_triplet.geofence_violated = false;
+ if (_pos_sp_triplet.geofence_violated != false) {
+ _pos_sp_triplet_updated = true;
+ }
/* Reset the _geofence_violation_warning_sent field */
_geofence_violation_warning_sent = false;
}