From a783763f5acd09e73ba9092b7474d0d39206d148 Mon Sep 17 00:00:00 2001 From: murata Date: Sat, 23 Jun 2018 05:21:46 +0900 Subject: [PATCH] Copter: Crash origin to crash message Copter: Crash origin to crash message --- ArduCopter/crash_check.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ArduCopter/crash_check.cpp b/ArduCopter/crash_check.cpp index 98b12c27eb..b5e6b11339 100644 --- a/ArduCopter/crash_check.cpp +++ b/ArduCopter/crash_check.cpp @@ -44,7 +44,8 @@ void Copter::crash_check() #endif // vehicle not crashed if 1hz filtered acceleration is more than 3m/s (1G on Z-axis has been subtracted) - if (land_accel_ef_filter.get().length() >= CRASH_CHECK_ACCEL_MAX) { + const float filtered_acc = land_accel_ef_filter.get().length(); + if (filtered_acc >= CRASH_CHECK_ACCEL_MAX) { crash_counter = 0; return; } @@ -65,7 +66,7 @@ void Copter::crash_check() // keep logging even if disarmed: AP::logger().set_force_log_disarmed(true); // send message to gcs - gcs().send_text(MAV_SEVERITY_EMERGENCY,"Crash: Disarming"); + gcs().send_text(MAV_SEVERITY_EMERGENCY,"Crash: Disarming: AngErr=%.0f>%.0f, Accel=%.1f<%.1f", angle_error, CRASH_CHECK_ANGLE_DEVIATION_DEG, filtered_acc, CRASH_CHECK_ACCEL_MAX); // disarm motors copter.arming.disarm(AP_Arming::Method::CRASH); }