AP_Arming: support skip_gyro_cal

also break up arming INS reports, to be clearer for users
This commit is contained in:
Andrew Tridgell 2015-01-20 19:47:15 +11:00
parent 0065b3b224
commit a37f3680e4
2 changed files with 19 additions and 6 deletions

View File

@ -48,7 +48,8 @@ const AP_Param::GroupInfo AP_Arming::var_info[] PROGMEM = {
//but I don't want to reimplement messaging to GCS at the moment:
AP_Arming::AP_Arming(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &compass,
const bool &home_set, gcs_send_t_p gcs_print_func)
: armed(false)
: armed(false)
, skip_gyro_cal(false)
, arming_method(NONE)
, ahrs(ahrs_ref)
, barometer(baro)
@ -113,11 +114,21 @@ bool AP_Arming::ins_checks(bool report)
if ((checks_to_perform & ARMING_CHECK_ALL) ||
(checks_to_perform & ARMING_CHECK_INS)) {
const AP_InertialSensor &ins = ahrs.get_ins();
if (! ins.get_gyro_health_all() ||
! ins.gyro_calibrated_ok_all() ||
! ins.get_accel_health_all()) {
if (! ins.get_gyro_health_all()) {
if (report) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: INS not healthy!"));
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: gyros not healthy!"));
}
return false;
}
if (!skip_gyro_cal && ! ins.gyro_calibrated_ok_all()) {
if (report) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: gyros not calibrated!"));
}
return false;
}
if (! ins.get_accel_health_all()) {
if (report) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: accels not healthy!"));
}
return false;
}

View File

@ -50,12 +50,14 @@ public:
uint16_t get_enabled_checks();
bool pre_arm_checks(bool report);
void set_skip_gyro_cal(bool set) { skip_gyro_cal = set; }
//for params
static const struct AP_Param::GroupInfo var_info[];
private:
bool armed;
bool armed:1;
bool skip_gyro_cal:1;
//Parameters
AP_Int8 require;