|
|
|
@ -1,7 +1,7 @@
@@ -1,7 +1,7 @@
|
|
|
|
|
#include "Copter.h" |
|
|
|
|
|
|
|
|
|
// Code to detect a crash main ArduCopter code
|
|
|
|
|
#define CRASH_CHECK_TRIGGER_SEC 5 // 2 seconds inverted indicates a crash
|
|
|
|
|
#define CRASH_CHECK_TRIGGER_SEC 3 // 3 seconds inverted indicates a crash
|
|
|
|
|
#define CRASH_CHECK_ANGLE_DEVIATION_DEG 30.0f // 30 degrees beyond angle max is signal we are inverted
|
|
|
|
|
#define CRASH_CHECK_ACCEL_MAX 3.0f // vehicle must be accelerating less than 3m/s/s to be considered crashed
|
|
|
|
|
#define CRASH_CHECK_ANGLE_MIN_DEG 15.0f // vehicle must be leaning at least 15deg to trigger crash check
|
|
|
|
@ -85,11 +85,7 @@ void Copter::crash_check()
@@ -85,11 +85,7 @@ void Copter::crash_check()
|
|
|
|
|
// send message to gcs
|
|
|
|
|
gcs().send_text(MAV_SEVERITY_EMERGENCY,"坠机:锁定");//Crash: Disarming
|
|
|
|
|
// disarm motors
|
|
|
|
|
if(g.zr_use_rc != 2){ |
|
|
|
|
copter.arming.disarm(); |
|
|
|
|
}else{ |
|
|
|
|
crash_counter = 0; |
|
|
|
|
} |
|
|
|
|
copter.arming.disarm(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|