aboutsummaryrefslogtreecommitdiff
path: root/src/modules/commander/accelerometer_calibration.cpp
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-08-27 07:50:52 +0200
committerLorenz Meier <lm@inf.ethz.ch>2013-08-27 07:50:52 +0200
commit9f45b1c589b72753455043c043a0199b471762ce (patch)
tree7e814009a98ef84a7f18a0da2b20c0424d0e84b2 /src/modules/commander/accelerometer_calibration.cpp
parent6a4d3c34fbad75d3fc8f6ed02f588fd02f526607 (diff)
parentb29d13347a10156bf1690b67938e2850d4e1e4c5 (diff)
downloadpx4-firmware-9f45b1c589b72753455043c043a0199b471762ce.tar.gz
px4-firmware-9f45b1c589b72753455043c043a0199b471762ce.tar.bz2
px4-firmware-9f45b1c589b72753455043c043a0199b471762ce.zip
Merge branch 'multirotor' of github.com:cvg/Firmware_Private into multirotor
Diffstat (limited to 'src/modules/commander/accelerometer_calibration.cpp')
-rw-r--r--src/modules/commander/accelerometer_calibration.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/commander/accelerometer_calibration.cpp b/src/modules/commander/accelerometer_calibration.cpp
index 82df7c37d..7a7fa6f4e 100644
--- a/src/modules/commander/accelerometer_calibration.cpp
+++ b/src/modules/commander/accelerometer_calibration.cpp
@@ -298,7 +298,7 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) {
/* set accel error threshold to 5m/s^2 */
float accel_err_thr = 5.0f;
/* still time required in us */
- int64_t still_time = 2000000;
+ hrt_abstime still_time = 2000000;
struct pollfd fds[1];
fds[0].fd = sub_sensor_combined;
fds[0].events = POLLIN;
@@ -342,7 +342,7 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) {
t_timeout = t + timeout;
} else {
/* still since t_still */
- if ((int64_t) t - (int64_t) t_still > still_time) {
+ if (t > t_still + still_time) {
/* vehicle is still, exit from the loop to detection of its orientation */
break;
}