From ef495d26b89b105871c9c8cc882a4821ed85d1ee Mon Sep 17 00:00:00 2001 From: Andreas Antener Date: Fri, 2 Dec 2016 11:53:36 +0100 Subject: [PATCH] Airspeed calibration: wait on filter before preflight check --- src/modules/commander/airspeed_calibration.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/commander/airspeed_calibration.cpp b/src/modules/commander/airspeed_calibration.cpp index fc7f4491cd..e59655764a 100644 --- a/src/modules/commander/airspeed_calibration.cpp +++ b/src/modules/commander/airspeed_calibration.cpp @@ -249,6 +249,7 @@ int do_airspeed_calibration(orb_advert_t *mavlink_log_pub) feedback_calibration_failed(mavlink_log_pub); goto error_return; + } else { calibration_log_info(mavlink_log_pub, "[cal] Positive pressure: OK (%d Pa)", (int)diff_pres.differential_pressure_raw_pa); @@ -272,6 +273,10 @@ int do_airspeed_calibration(orb_advert_t *mavlink_log_pub) calibration_log_info(mavlink_log_pub, CAL_QGC_DONE_MSG, sensor_name); tune_neutral(true); + /* Wait 2sec for the airflow to stop and ensure the driver filter has caught up, otherwise + * the followup preflight checks might fail. */ + usleep(2e6); + normal_return: calibrate_cancel_unsubscribe(cancel_sub); px4_close(diff_pres_sub);