aboutsummaryrefslogtreecommitdiff
path: root/src/modules/navigator
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-09-21 18:04:11 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-09-21 18:07:21 +0200
commite3cac1999a0b4398e669f90cd28279ec2a0784a7 (patch)
tree27732b2e70f7b1a0bda42b9cc0519b0b48387b6e /src/modules/navigator
parent31a17ce29a76a2f58e6feb92abe1de01eed5a8eb (diff)
downloadpx4-firmware-e3cac1999a0b4398e669f90cd28279ec2a0784a7.tar.gz
px4-firmware-e3cac1999a0b4398e669f90cd28279ec2a0784a7.tar.bz2
px4-firmware-e3cac1999a0b4398e669f90cd28279ec2a0784a7.zip
navigator: geofence with global pos: reduce update rate
Diffstat (limited to 'src/modules/navigator')
-rw-r--r--src/modules/navigator/navigator_main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp
index 9a8c54e7e..fc9120f13 100644
--- a/src/modules/navigator/navigator_main.cpp
+++ b/src/modules/navigator/navigator_main.cpp
@@ -386,9 +386,13 @@ Navigator::task_main()
/* global position updated */
if (fds[0].revents & POLLIN) {
global_position_update();
- if (_geofence.getSource() == Geofence::GF_SOURCE_GLOBALPOS) {
+ static int gposcounter = 0;
+ if (_geofence.getSource() == Geofence::GF_SOURCE_GLOBALPOS &&
+ gposcounter % 10 == 0) {
+ /* Geofence is checked only every 10th gpos update */
have_geofence_position_data = true;
}
+ gposcounter++;
}
/* Check geofence violation */