Added hysteresis to still detector

This commit is contained in:
Anton Babushkin 2013-04-26 13:52:25 +04:00
parent e37f471ac4
commit 593e3252dd
1 changed files with 3 additions and 1 deletions

View File

@ -274,7 +274,9 @@ int detect_orientation(int mavlink_fd, int sub_sensor_combined) {
break; 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 */ /* not still, reset still start time */
if (t_still != 0) { if (t_still != 0) {
mavlink_log_info(mavlink_fd, "moving"); mavlink_log_info(mavlink_fd, "moving");