diff options
author | Anton Babushkin <rk3dov@gmail.com> | 2013-04-26 13:52:25 +0400 |
---|---|---|
committer | Anton Babushkin <rk3dov@gmail.com> | 2013-04-26 13:52:25 +0400 |
commit | 593e3252dd90b2437862aba1c8a54b5c6edb5600 (patch) | |
tree | fc211922daa1c70ed3fe7f05a21bbf5a7460779f /apps/commander | |
parent | e37f471ac4ce52e724b0d89714d9db6e1d16ee8e (diff) | |
download | px4-firmware-593e3252dd90b2437862aba1c8a54b5c6edb5600.tar.gz px4-firmware-593e3252dd90b2437862aba1c8a54b5c6edb5600.tar.bz2 px4-firmware-593e3252dd90b2437862aba1c8a54b5c6edb5600.zip |
Added hysteresis to still detector
Diffstat (limited to 'apps/commander')
-rw-r--r-- | apps/commander/accelerometer_calibration.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/commander/accelerometer_calibration.c b/apps/commander/accelerometer_calibration.c index f95039881..9e7a3b99e 100644 --- a/apps/commander/accelerometer_calibration.c +++ b/apps/commander/accelerometer_calibration.c @@ -274,7 +274,9 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) { break; } } - } else { + } else if ( accel_disp[0] > still_thr_raw2 * 2.0f || + accel_disp[1] > still_thr_raw2 * 2.0f || + accel_disp[2] > still_thr_raw2 * 2.0f) { /* not still, reset still start time */ if (t_still != 0) { mavlink_log_info(mavlink_fd, "moving"); |