Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr commander msg output cleanup #8175

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions src/modules/commander/PreflightCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static bool magnometerCheck(orb_advert_t *mavlink_log_pub, unsigned instance, bo
if (!h.isValid()) {
if (!optional) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: NO MAG SENSOR #%u", instance);
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: NO MAGNETOMETER SENSOR #%u.", instance);
Copy link
Contributor

@Antiheavy Antiheavy Jan 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR: https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R132

}
}

Expand All @@ -142,7 +142,7 @@ static bool magnometerCheck(orb_advert_t *mavlink_log_pub, unsigned instance, bo

if (ret) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: MAG #%u UNCALIBRATED", instance);
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: MAGNETOMETER #%u UNCALIBRATED.", instance);
Copy link
Contributor

@Antiheavy Antiheavy Jan 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR: https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R126

}
success = false;
goto out;
Expand All @@ -152,7 +152,7 @@ static bool magnometerCheck(orb_advert_t *mavlink_log_pub, unsigned instance, bo

if (ret != OK) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: MAG #%u SELFTEST FAILED", instance);
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: MAGNETOMETER #%u SELFTEST FAILED.", instance);
Copy link
Contributor

@Antiheavy Antiheavy Jan 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalization and wording should be updated for consistency with this PR: https://github.com/PX4/Firmware/pull/10586/files
Suggested new text: "Preflight Fail: Compass #%u self test failed"

}
success = false;
goto out;
Expand Down Expand Up @@ -251,7 +251,7 @@ static bool accelerometerCheck(orb_advert_t *mavlink_log_pub, unsigned instance,
if (!h.isValid()) {
if (!optional) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: NO ACCEL SENSOR #%u", instance);
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: NO ACCELEROMETER SENSOR #%u.", instance);
Copy link
Contributor

@Antiheavy Antiheavy Jan 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR: https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R285

}
}

Expand All @@ -262,7 +262,7 @@ static bool accelerometerCheck(orb_advert_t *mavlink_log_pub, unsigned instance,

if (ret) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: ACCEL #%u UNCALIBRATED", instance);
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: ACCELEROMETER #%u UNCALIBRATED.", instance);
Copy link
Contributor

@Antiheavy Antiheavy Jan 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalization already improved in this more recent PR: https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R262
However, using full word "accelerometer" is probably better than "Accel"
Suggested new text: "Preflight Fail: accelerometer #%u uncalibrated"

}
success = false;
goto out;
Expand All @@ -272,7 +272,7 @@ static bool accelerometerCheck(orb_advert_t *mavlink_log_pub, unsigned instance,

if (ret != OK) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: ACCEL #%u TEST FAILED: %d", instance, ret);
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: ACCELEROMETER #%u TEST FAILED: %d.", instance, ret);
Copy link
Contributor

@Antiheavy Antiheavy Jan 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalization and wording should be updated for consistency with this PR: #10586
Suggested new text: "Preflight Fail: accelerometer #%u test fails: %d"

}
success = false;
goto out;
Expand All @@ -290,15 +290,15 @@ static bool accelerometerCheck(orb_advert_t *mavlink_log_pub, unsigned instance,

if (accel_magnitude < 4.0f || accel_magnitude > 15.0f /* m/s^2 */) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: ACCEL RANGE, hold still on arming");
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: ACCEL RANGE, hold still on arming.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R274

}
/* this is frickin' fatal */
success = false;
goto out;
}
} else {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: ACCEL READ");
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: ACCELEROMETER READ.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalization and wording should be updated for consistency with this PR: #10586
Suggested new text: "Preflight Fail: accelerometer read"

}
/* this is frickin' fatal */
success = false;
Expand All @@ -324,7 +324,7 @@ static bool gyroCheck(orb_advert_t *mavlink_log_pub, unsigned instance, bool opt
if (!h.isValid()) {
if (!optional) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: NO GYRO SENSOR #%u", instance);
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: NO GYRO SENSOR #%u.", instance);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R332

}
}

Expand All @@ -335,7 +335,7 @@ static bool gyroCheck(orb_advert_t *mavlink_log_pub, unsigned instance, bool opt

if (ret) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: GYRO #%u UNCALIBRATED", instance);
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: GYRO #%u UNCALIBRATED.", instance);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R326

}
success = false;
goto out;
Expand All @@ -345,7 +345,7 @@ static bool gyroCheck(orb_advert_t *mavlink_log_pub, unsigned instance, bool opt

if (ret != OK) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: GYRO #%u SELFTEST FAILED", instance);
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: GYRO #%u SELFTEST FAILED.", instance);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalization and wording should be updated for consistency with this PR: #10586
Suggested new text: "Preflight Fail: gyro #%u self test failed"

}
success = false;
goto out;
Expand All @@ -368,7 +368,7 @@ static bool baroCheck(orb_advert_t *mavlink_log_pub, unsigned instance, bool opt
if (!h.isValid()) {
if (!optional) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: NO BARO SENSOR #%u", instance);
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: NO BAROMETER SENSOR #%u.", instance);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R366

}
}

Expand Down Expand Up @@ -405,7 +405,7 @@ static bool airspeedCheck(orb_advert_t *mavlink_log_pub, bool optional, bool rep
if ((orb_copy(ORB_ID(differential_pressure), fd_diffpres, &differential_pressure) != PX4_OK) ||
(hrt_elapsed_time(&differential_pressure.timestamp) > 1000000)) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: AIRSPEED SENSOR MISSING");
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: AIRSPEED SENSOR MISSING.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R392

}
success = false;
goto out;
Expand All @@ -414,7 +414,7 @@ static bool airspeedCheck(orb_advert_t *mavlink_log_pub, bool optional, bool rep
if ((orb_copy(ORB_ID(airspeed), fd_airspeed, &airspeed) != PX4_OK) ||
(hrt_elapsed_time(&airspeed.timestamp) > 1000000)) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: AIRSPEED SENSOR MISSING");
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: AIRSPEED SENSOR MISSING.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R403

}
success = false;
goto out;
Expand All @@ -428,7 +428,7 @@ static bool airspeedCheck(orb_advert_t *mavlink_log_pub, bool optional, bool rep
*/
if (prearm && fabsf(airspeed.confidence) < 0.95f) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: AIRSPEED SENSOR STUCK");
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: AIRSPEED SENSOR STUCK.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R419

}
success = false;
goto out;
Expand All @@ -441,7 +441,7 @@ static bool airspeedCheck(orb_advert_t *mavlink_log_pub, bool optional, bool rep
*/
if (fabsf(differential_pressure.differential_pressure_filtered_pa) > 15.0f && !prearm) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: CHECK AIRSPEED CAL OR PITOT");
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: CHECK AIRSPEED CAL OR PITOT.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R434

}
success = false;
goto out;
Expand Down Expand Up @@ -481,7 +481,7 @@ static bool gnssCheck(orb_advert_t *mavlink_log_pub, bool report_fail, bool &loc
//Report failure to detect module
if (!success) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: GPS RECEIVER MISSING");
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: GPS RECEIVER MISSING.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... is this warning still around? this might not be applicable anymore...

}
}

Expand All @@ -506,7 +506,7 @@ static bool ekf2Check(orb_advert_t *mavlink_log_pub, bool optional, bool report_
param_get(param_find("COM_ARM_EKF_HGT"), &test_limit);
if (status.hgt_test_ratio > test_limit) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: EKF HGT ERROR");
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: EKF HGT ERROR.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R533

}
success = false;
goto out;
Expand All @@ -516,7 +516,7 @@ static bool ekf2Check(orb_advert_t *mavlink_log_pub, bool optional, bool report_
param_get(param_find("COM_ARM_EKF_VEL"), &test_limit);
if (status.vel_test_ratio > test_limit) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: EKF VEL ERROR");
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: EKF VEL ERROR.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R545

}
success = false;
goto out;
Expand All @@ -526,7 +526,7 @@ static bool ekf2Check(orb_advert_t *mavlink_log_pub, bool optional, bool report_
param_get(param_find("COM_ARM_EKF_POS"), &test_limit);
if (status.pos_test_ratio > test_limit) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: EKF HORIZ POS ERROR");
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: EKF HORIZ POS ERROR.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R557

}
success = false;
goto out;
Expand Down Expand Up @@ -562,7 +562,7 @@ static bool ekf2Check(orb_advert_t *mavlink_log_pub, bool optional, bool report_
param_get(param_find("COM_ARM_EKF_YAW"), &test_limit);
if (status.mag_test_ratio > test_limit) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: EKF YAW ERROR");
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: EKF YAW ERROR.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R569

}
success = false;
goto out;
Expand All @@ -572,7 +572,7 @@ static bool ekf2Check(orb_advert_t *mavlink_log_pub, bool optional, bool report_
param_get(param_find("COM_ARM_EKF_AB"), &test_limit);
if (fabsf(status.states[13]) > test_limit || fabsf(status.states[14]) > test_limit || fabsf(status.states[15]) > test_limit) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: EKF HIGH IMU ACCEL BIAS");
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: EKF HIGH IMU ACCELEROMETER BIAS.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R582

}
success = false;
goto out;
Expand All @@ -582,7 +582,7 @@ static bool ekf2Check(orb_advert_t *mavlink_log_pub, bool optional, bool report_
param_get(param_find("COM_ARM_EKF_GB"), &test_limit);
if (fabsf(status.states[10]) > test_limit || fabsf(status.states[11]) > test_limit || fabsf(status.states[12]) > test_limit) {
if (report_fail) {
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: EKF HIGH IMU GYRO BIAS");
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: EKF HIGH IMU GYRO BIAS.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change no longer needed. Text already improved in this more recent PR:
https://github.com/PX4/Firmware/pull/10586/files#diff-a2bcb238e25d8a97ab2aee48f54dbc48R595

}
success = false;
goto out;
Expand Down Expand Up @@ -643,7 +643,7 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, bool checkSensors, bool check
/* check if the primary device is present */
if (!prime_found && prime_id != 0) {
if (reportFailures) {
mavlink_log_critical(mavlink_log_pub, "Warning: Primary compass not found");
mavlink_log_critical(mavlink_log_pub, "Primary compass not found.");
}
failed = true;
}
Expand Down Expand Up @@ -678,7 +678,7 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, bool checkSensors, bool check
/* check if the primary device is present */
if (!prime_found && prime_id != 0) {
if (reportFailures) {
mavlink_log_critical(mavlink_log_pub, "Warning: Primary accelerometer not found");
mavlink_log_critical(mavlink_log_pub, "Primary accelerometer not found.");
}
failed = true;
}
Expand Down Expand Up @@ -707,7 +707,7 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, bool checkSensors, bool check
/* check if the primary device is present */
if (!prime_found && prime_id != 0) {
if (reportFailures) {
mavlink_log_critical(mavlink_log_pub, "Warning: Primary gyro not found");
mavlink_log_critical(mavlink_log_pub, "Primary gyro not found.");
}
failed = true;
}
Expand Down Expand Up @@ -737,7 +737,7 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, bool checkSensors, bool check
// // check if the primary device is present
if (!prime_found && prime_id != 0) {
if (reportFailures) {
mavlink_log_critical(mavlink_log_pub, "warning: primary barometer not operational");
mavlink_log_critical(mavlink_log_pub, "Primary barometer not operational.");
}
failed = true;
}
Expand All @@ -761,7 +761,7 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, bool checkSensors, bool check
if (checkRC) {
if (rc_calibration_check(mavlink_log_pub, reportFailures, isVTOL) != OK) {
if (reportFailures) {
mavlink_log_critical(mavlink_log_pub, "RC calibration check failed");
mavlink_log_critical(mavlink_log_pub, "RC calibration check failed.");
}
failed = true;
}
Expand Down
Loading