diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-09-21 18:04:11 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-09-21 18:07:21 +0200 |
commit | e3cac1999a0b4398e669f90cd28279ec2a0784a7 (patch) | |
tree | 27732b2e70f7b1a0bda42b9cc0519b0b48387b6e /src | |
parent | 31a17ce29a76a2f58e6feb92abe1de01eed5a8eb (diff) | |
download | px4-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')
-rw-r--r-- | src/modules/navigator/navigator_main.cpp | 6 |
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 */ |