From 2fca24f803e8ec88fee568337935921d3d92a754 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 28 Aug 2012 08:50:23 +0200 Subject: [PATCH] Added missing calibration announcement for gyro cal in commander --- apps/commander/commander.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/commander/commander.c b/apps/commander/commander.c index 352cf68f6e..6b2ddc8b45 100644 --- a/apps/commander/commander.c +++ b/apps/commander/commander.c @@ -446,6 +446,10 @@ void do_mag_calibration(int status_pub, struct vehicle_status_s *status) void do_gyro_calibration(int status_pub, struct vehicle_status_s *status) { + /* set to gyro calibration mode */ + status->preflight_gyro_calibration = true; + state_machine_publish(status_pub, status, mavlink_fd); + const int calibration_count = 3000; int sub_sensor_combined = orb_subscribe(ORB_ID(sensor_combined)); @@ -488,6 +492,10 @@ void do_gyro_calibration(int status_pub, struct vehicle_status_s *status) mavlink_log_critical(mavlink_fd, "[commander] Setting Z gyro offset failed!"); } + /* exit to gyro calibration mode */ + status->preflight_gyro_calibration = false; + state_machine_publish(status_pub, status, mavlink_fd); + char offset_output[50]; sprintf(offset_output, "[commander] gyro cal: x:%8.4f y:%8.4f z:%8.4f", (double)gyro_offset[0], (double)gyro_offset[1], (double)gyro_offset[2]); mavlink_log_info(mavlink_fd, offset_output);