Skip to content

Commit

Permalink
failureDetectorCheck: revise messageing
Browse files Browse the repository at this point in the history
  • Loading branch information
MaEtUgR committed Sep 8, 2020
1 parent 981e05c commit ab17b6b
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,30 @@ bool PreFlightCheck::failureDetectorCheck(orb_advert_t *mavlink_log_pub, const v

if (status.failure_detector_status != vehicle_status_s::FAILURE_NONE) {
if (report_fail) {
// in case an error is forgotten to get handled here the user at least gets a less specific message
const char *message = "Unspecified";

if (status.failure_detector_status & vehicle_status_s::FAILURE_ROLL) {
mavlink_log_critical(mavlink_log_pub, "Preflight Fail: Roll failure detected");
message = "Roll";
}

if (status.failure_detector_status & vehicle_status_s::FAILURE_PITCH) {
mavlink_log_critical(mavlink_log_pub, "Preflight Fail: Pitch failure detected");
message = "Pitch";
}

if (status.failure_detector_status & vehicle_status_s::FAILURE_ALT) {
mavlink_log_critical(mavlink_log_pub, "Preflight Fail: Altitude failure detected");
message = "Altitude";
}

if (status.failure_detector_status & vehicle_status_s::FAILURE_EXT) {
message = "Parachute";
}

if (status.failure_detector_status & vehicle_status_s::FAILURE_ARM_ESC) {
message = "ESC";
}

mavlink_log_critical(mavlink_log_pub, "Preflight Fail: %s failure detected", message);
}

return false;
Expand Down

0 comments on commit ab17b6b

Please sign in to comment.