From e7c30322187068d76cf6ef9ea9935856134a3c6c Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 14 May 2015 17:31:05 +0200 Subject: [PATCH] Mag calibration: Accept less rotation to start the UI, ensure calibration abort does indeed abort. --- src/modules/commander/mag_calibration.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/commander/mag_calibration.cpp b/src/modules/commander/mag_calibration.cpp index 1a8de86c41..04e66a5cb6 100644 --- a/src/modules/commander/mag_calibration.cpp +++ b/src/modules/commander/mag_calibration.cpp @@ -209,7 +209,7 @@ static calibrate_return mag_calibration_worker(detect_orientation_return orienta float gyro_y_integral = 0.0f; float gyro_z_integral = 0.0f; - const float gyro_int_thresh_rad = 1.0f; + const float gyro_int_thresh_rad = 0.5f; int sub_gyro = orb_subscribe(ORB_ID(sensor_gyro)); @@ -220,7 +220,8 @@ static calibrate_return mag_calibration_worker(detect_orientation_return orienta /* abort on request */ if (calibrate_cancel_check(worker_data->mavlink_fd, cancel_sub)) { result = calibrate_return_cancelled; - break; + close(sub_gyro); + return result; } /* abort with timeout */