Copter: parachute failure message if landed

This commit is contained in:
Randy Mackay 2015-05-12 21:54:07 +09:00
parent 3269cd63cb
commit 41077be4ad
2 changed files with 13 additions and 2 deletions

View File

@ -176,8 +176,18 @@ static void parachute_manual_release()
return; return;
} }
// do not release if vehicle is landed
// do not release if we are landed or below the minimum altitude above home // do not release if we are landed or below the minimum altitude above home
if (ap.land_complete || (parachute.alt_min() != 0 && (current_loc.alt < (int32_t)parachute.alt_min() * 100))) { if (ap.land_complete) {
// warn user of reason for failure
gcs_send_text_P(SEVERITY_HIGH,PSTR("Parachute: Landed"));
// log an error in the dataflash
Log_Write_Error(ERROR_SUBSYSTEM_PARACHUTE, ERROR_CODE_PARACHUTE_LANDED);
return;
}
// do not release if we are landed or below the minimum altitude above home
if ((parachute.alt_min() != 0 && (current_loc.alt < (int32_t)parachute.alt_min() * 100))) {
// warn user of reason for failure // warn user of reason for failure
gcs_send_text_P(SEVERITY_HIGH,PSTR("Parachute: Too Low")); gcs_send_text_P(SEVERITY_HIGH,PSTR("Parachute: Too Low"));
// log an error in the dataflash // log an error in the dataflash

View File

@ -357,8 +357,9 @@ enum FlipState {
#define ERROR_CODE_FLIP_ABANDONED 2 #define ERROR_CODE_FLIP_ABANDONED 2
// subsystem specific error codes -- autotune // subsystem specific error codes -- autotune
#define ERROR_CODE_AUTOTUNE_BAD_GAINS 2 #define ERROR_CODE_AUTOTUNE_BAD_GAINS 2
// parachute failed to deploy because of low altitude // parachute failed to deploy because of low altitude or landed
#define ERROR_CODE_PARACHUTE_TOO_LOW 2 #define ERROR_CODE_PARACHUTE_TOO_LOW 2
#define ERROR_CODE_PARACHUTE_LANDED 3
// EKF check definitions // EKF check definitions
#define ERROR_CODE_EKFCHECK_BAD_VARIANCE 2 #define ERROR_CODE_EKFCHECK_BAD_VARIANCE 2
#define ERROR_CODE_EKFCHECK_VARIANCE_CLEARED 0 #define ERROR_CODE_EKFCHECK_VARIANCE_CLEARED 0