Plane: removed 1D accel calibration

This commit is contained in:
Andrew Tridgell 2015-03-11 10:16:59 +11:00
parent 031c81beee
commit 5175f21225
3 changed files with 15 additions and 25 deletions

View File

@ -1038,23 +1038,25 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
break;
case MAV_CMD_PREFLIGHT_CALIBRATION:
if (packet.param3 == 1) {
in_calibration = true;
in_calibration = true;
if (packet.param1 == 1) {
ins.init_gyro();
if (ins.gyro_calibrated_ok_all()) {
ahrs.reset_gyro_drift();
result = MAV_RESULT_ACCEPTED;
} else {
result = MAV_RESULT_FAILED;
}
} else if (packet.param3 == 1) {
init_barometer();
if (airspeed.enabled()) {
zero_airspeed(false);
}
in_calibration = false;
result = MAV_RESULT_ACCEPTED;
} else if (packet.param1 == 1 ||
packet.param2 == 1) {
startup_INS_ground(true);
result = MAV_RESULT_ACCEPTED;
} else if (packet.param4 == 1) {
trim_radio();
result = MAV_RESULT_ACCEPTED;
}
else if (packet.param5 == 1) {
} else if (packet.param5 == 1) {
float trim_roll, trim_pitch;
AP_InertialSensor_UserInteract_MAVLink interact(this);
if (g.skip_gyro_cal) {
@ -1073,6 +1075,7 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
else {
send_text_P(SEVERITY_LOW, PSTR("Unsupported preflight calibration"));
}
in_calibration = false;
break;
case MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS:

View File

@ -6,7 +6,6 @@
static int8_t setup_radio (uint8_t argc, const Menu::arg *argv);
static int8_t setup_show (uint8_t argc, const Menu::arg *argv);
static int8_t setup_factory (uint8_t argc, const Menu::arg *argv);
static int8_t setup_level (uint8_t argc, const Menu::arg *argv);
static int8_t setup_accel_scale (uint8_t argc, const Menu::arg *argv);
static int8_t setup_set (uint8_t argc, const Menu::arg *argv);
static int8_t setup_erase (uint8_t argc, const Menu::arg *argv);
@ -19,7 +18,6 @@ static const struct Menu::command setup_menu_commands[] PROGMEM = {
// ======= ===============
{"reset", setup_factory},
{"radio", setup_radio},
{"level", setup_level},
{"accel", setup_accel_scale},
{"compass", setup_compass},
{"show", setup_show},
@ -265,13 +263,6 @@ setup_erase(uint8_t argc, const Menu::arg *argv)
return 0;
}
static int8_t
setup_level(uint8_t argc, const Menu::arg *argv)
{
startup_INS_ground(true);
return 0;
}
/*
handle full accelerometer calibration via user dialog
*/

View File

@ -257,7 +257,7 @@ static void startup_ground(void)
//INS ground start
//------------------------
//
startup_INS_ground(false);
startup_INS_ground();
// read the radio to set trims
// ---------------------------
@ -498,7 +498,7 @@ static void check_short_failsafe()
}
static void startup_INS_ground(bool do_accel_init)
static void startup_INS_ground(void)
{
#if HIL_MODE != HIL_MODE_DISABLED
while (barometer.get_last_update() == 0) {
@ -514,7 +514,7 @@ static void startup_INS_ground(bool do_accel_init)
#endif
AP_InertialSensor::Start_style style;
if (g.skip_gyro_cal && !do_accel_init) {
if (g.skip_gyro_cal) {
style = AP_InertialSensor::WARM_START;
arming.set_skip_gyro_cal(true);
} else {
@ -532,10 +532,6 @@ static void startup_INS_ground(bool do_accel_init)
ahrs.set_wind_estimation(true);
ins.init(style, ins_sample_rate);
if (do_accel_init) {
ins.init_accel();
ahrs.set_trim(Vector3f(0, 0, 0));
}
ahrs.reset();
// read Baro pressure at ground