aboutsummaryrefslogtreecommitdiff
path: root/apps/commander/commander.c
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2012-10-29 16:41:53 +0100
committerLorenz Meier <lm@inf.ethz.ch>2012-10-29 16:41:53 +0100
commit574eb96a2ebafeb03d2933c68cb7f7b60269601a (patch)
tree9dd114b32042b58d9603bd4c2bcad051849aab22 /apps/commander/commander.c
parentc3c76ef3d50f71a7bef2994df462c5add11658d9 (diff)
downloadpx4-firmware-574eb96a2ebafeb03d2933c68cb7f7b60269601a.tar.gz
px4-firmware-574eb96a2ebafeb03d2933c68cb7f7b60269601a.tar.bz2
px4-firmware-574eb96a2ebafeb03d2933c68cb7f7b60269601a.zip
Calibration improvement
Diffstat (limited to 'apps/commander/commander.c')
-rw-r--r--apps/commander/commander.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/apps/commander/commander.c b/apps/commander/commander.c
index a7550b54b..d93a48e31 100644
--- a/apps/commander/commander.c
+++ b/apps/commander/commander.c
@@ -360,6 +360,10 @@ void do_mag_calibration(int status_pub, struct vehicle_status_s *status)
float *y = malloc(sizeof(float) * calibration_maxcount);
float *z = malloc(sizeof(float) * calibration_maxcount);
+ tune_confirm();
+ sleep(2);
+ tune_confirm();
+
while (hrt_absolute_time() < calibration_deadline &&
calibration_counter < calibration_maxcount) {
@@ -504,6 +508,13 @@ void do_mag_calibration(int status_pub, struct vehicle_status_s *status)
mavlink_log_info(mavlink_fd, buf);
mavlink_log_info(mavlink_fd, "[commander] mag calibration done");
+
+ tune_confirm();
+ sleep(2);
+ tune_confirm();
+ sleep(2);
+ /* third beep by cal end routine */
+
} else {
mavlink_log_info(mavlink_fd, "[commander] mag calibration FAILED (NaN)");
}
@@ -607,6 +618,12 @@ void do_gyro_calibration(int status_pub, struct vehicle_status_s *status)
// sprintf(buf, "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, buf);
mavlink_log_info(mavlink_fd, "[commander] gyro calibration done");
+
+ tune_confirm();
+ sleep(2);
+ tune_confirm();
+ sleep(2);
+ /* third beep by cal end routine */
} else {
mavlink_log_info(mavlink_fd, "[commander] gyro calibration FAILED (NaN)");
}
@@ -721,6 +738,12 @@ void do_accel_calibration(int status_pub, struct vehicle_status_s *status)
//sprintf(buf, "[commander] accel cal: x:%8.4f y:%8.4f z:%8.4f\n", (double)accel_offset[0], (double)accel_offset[1], (double)accel_offset[2]);
//mavlink_log_info(mavlink_fd, buf);
mavlink_log_info(mavlink_fd, "[commander] accel calibration done");
+
+ tune_confirm();
+ sleep(2);
+ tune_confirm();
+ sleep(2);
+ /* third beep by cal end routine */
} else {
mavlink_log_info(mavlink_fd, "[commander] accel calibration FAILED (NaN)");
}
@@ -740,7 +763,7 @@ void handle_command(int status_pub, struct vehicle_status_s *current_vehicle_sta
uint8_t result = MAV_RESULT_UNSUPPORTED;
/* announce command handling */
- ioctl(buzzer, TONE_SET_ALARM, 1);
+ tune_confirm();
/* supported command handling start */