diff --git a/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp b/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp index 92f23b24d9..fe93590862 100644 --- a/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp +++ b/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp @@ -378,7 +378,7 @@ bool AP_AdvancedFailsafe::should_crash_vehicle(void) // update GCS based termination // returns true if AFS is in the desired termination state -bool AP_AdvancedFailsafe::gcs_terminate(bool should_terminate) { +bool AP_AdvancedFailsafe::gcs_terminate(bool should_terminate, const char *reason) { if (!_enable) { gcs().send_text(MAV_SEVERITY_INFO, "AFS not enabled, can't terminate the vehicle"); return false; @@ -391,9 +391,9 @@ bool AP_AdvancedFailsafe::gcs_terminate(bool should_terminate) { if(should_terminate == is_terminating) { if (is_terminating) { - gcs().send_text(MAV_SEVERITY_INFO, "Terminating due to GCS request"); + gcs().send_text(MAV_SEVERITY_INFO, "Terminating due to %s", reason); } else { - gcs().send_text(MAV_SEVERITY_INFO, "Aborting termination due to GCS request"); + gcs().send_text(MAV_SEVERITY_INFO, "Aborting termination due to %s", reason); } return true; } else if (should_terminate && _terminate_action != TERMINATE_ACTION_TERMINATE) { diff --git a/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.h b/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.h index 1664b70805..c99581c5f9 100644 --- a/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.h +++ b/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.h @@ -77,7 +77,7 @@ public: bool should_crash_vehicle(void); // enables or disables a GCS based termination, returns true if AFS is in the desired termination state - bool gcs_terminate(bool should_terminate); + bool gcs_terminate(bool should_terminate, const char *reason); // called to set all outputs to termination state virtual void terminate_vehicle(void) = 0;