aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/gps/gps.cpp
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-05-09 17:13:38 +0200
committerLorenz Meier <lm@inf.ethz.ch>2013-05-09 17:13:38 +0200
commit3ec536a876a66f4e56549957e81ed4547c92a0c3 (patch)
treeb0f318ae468e1aa710e24287425a282b2208d55c /src/drivers/gps/gps.cpp
parent5886e93a33329d39dc2ea535d224fcd60ab7afd7 (diff)
downloadpx4-firmware-3ec536a876a66f4e56549957e81ed4547c92a0c3.tar.gz
px4-firmware-3ec536a876a66f4e56549957e81ed4547c92a0c3.tar.bz2
px4-firmware-3ec536a876a66f4e56549957e81ed4547c92a0c3.zip
Improved GPS update rate calculation
Diffstat (limited to 'src/drivers/gps/gps.cpp')
-rw-r--r--src/drivers/gps/gps.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp
index 7db257816..38835418b 100644
--- a/src/drivers/gps/gps.cpp
+++ b/src/drivers/gps/gps.cpp
@@ -288,7 +288,6 @@ GPS::task_main()
// GPS is obviously detected successfully, reset statistics
_Helper->reset_update_rates();
- warnx("module configuration successful");
while (_Helper->receive(TIMEOUT_5HZ) > 0 && !_task_should_exit) {
// lock();
@@ -306,6 +305,8 @@ GPS::task_main()
_rate = last_rate_count / ((float)((hrt_absolute_time() - last_rate_measurement)) / 1000000.0f);
last_rate_measurement = hrt_absolute_time();
last_rate_count = 0;
+ _Helper->store_update_rates();
+ _Helper->reset_update_rates();
}
if (!_healthy) {
@@ -381,7 +382,6 @@ GPS::print_info()
warnx("rate velocity: \t%6.2f Hz", (double)_Helper->get_velocity_update_rate());
warnx("rate publication:\t%6.2f Hz", (double)_rate);
- _Helper->reset_update_rates();
}
usleep(100000);