diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2013-08-26 12:43:36 +0200 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2013-08-26 13:53:42 +0200 |
commit | 00a2a0370eedf84f68dcda5995f4e34495aaf887 (patch) | |
tree | 81883054d33ec35c4fbbe1167ac28373c225c1c8 /src | |
parent | 31dcd5a16df3d36a21a971ff1e7ed2ff47e9667a (diff) | |
download | px4-firmware-00a2a0370eedf84f68dcda5995f4e34495aaf887.tar.gz px4-firmware-00a2a0370eedf84f68dcda5995f4e34495aaf887.tar.bz2 px4-firmware-00a2a0370eedf84f68dcda5995f4e34495aaf887.zip |
accelerometer_calibration fix
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/commander/accelerometer_calibration.cpp | 4 |
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; } |