|
|
|
@ -346,6 +346,24 @@ static void pre_arm_checks(bool display_failure)
@@ -346,6 +346,24 @@ static void pre_arm_checks(bool display_failure)
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if INS_MAX_INSTANCES > 1 |
|
|
|
|
// check all accelerometers point in roughly same direction |
|
|
|
|
if (ins.get_accel_count() > 1) { |
|
|
|
|
const Vector3f &prime_accel_vec = ins.get_accel(); |
|
|
|
|
for(uint8_t i=0; i<ins.get_accel_count(); i++) { |
|
|
|
|
// get next accel vector |
|
|
|
|
const Vector3f &accel_vec = ins.get_accel(i); |
|
|
|
|
Vector3f vec_diff = accel_vec - prime_accel_vec; |
|
|
|
|
if (vec_diff.length() > PREARM_MAX_ACCEL_VECTOR_DIFF) { |
|
|
|
|
if (display_failure) { |
|
|
|
|
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Accels inconsistent")); |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
// check gyros are healthy |
|
|
|
|
if(!ins.get_gyro_health_all()) { |
|
|
|
|
if (display_failure) { |
|
|
|
|