mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 11:00:35 +08:00
VTOL transition switch parameter checking (#5545)
* VTOL transition switch parameter checking * Code style
This commit is contained in:
committed by
Lorenz Meier
parent
bd922e4eed
commit
c4eabbd083
@@ -383,7 +383,7 @@ static bool gnssCheck(orb_advert_t *mavlink_log_pub, bool report_fail)
|
||||
}
|
||||
|
||||
bool preflightCheck(orb_advert_t *mavlink_log_pub, bool checkMag, bool checkAcc, bool checkGyro,
|
||||
bool checkBaro, bool checkAirspeed, bool checkRC, bool checkGNSS, bool checkDynamic, bool reportFailures)
|
||||
bool checkBaro, bool checkAirspeed, bool checkRC, bool checkGNSS, bool checkDynamic, bool isVTOL, bool reportFailures)
|
||||
{
|
||||
|
||||
#ifdef __PX4_QURT
|
||||
@@ -524,7 +524,7 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, bool checkMag, bool checkAcc,
|
||||
|
||||
/* ---- RC CALIBRATION ---- */
|
||||
if (checkRC) {
|
||||
if (rc_calibration_check(mavlink_log_pub, reportFailures) != OK) {
|
||||
if (rc_calibration_check(mavlink_log_pub, reportFailures, isVTOL) != OK) {
|
||||
if (reportFailures) {
|
||||
mavlink_and_console_log_critical(mavlink_log_pub, "RC calibration check failed");
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace Commander
|
||||
* true if the GNSS receiver should be checked
|
||||
**/
|
||||
bool preflightCheck(orb_advert_t *mavlink_log_pub, bool checkMag, bool checkAcc,
|
||||
bool checkGyro, bool checkBaro, bool checkAirspeed, bool checkRC, bool checkGNSS, bool checkDynamic, bool reportFailures = false);
|
||||
bool checkGyro, bool checkBaro, bool checkAirspeed, bool checkRC, bool checkGNSS, bool checkDynamic, bool isVTOL, bool reportFailures = false);
|
||||
|
||||
const unsigned max_mandatory_gyro_count = 1;
|
||||
const unsigned max_optional_gyro_count = 3;
|
||||
|
||||
@@ -1572,7 +1572,7 @@ int commander_thread_main(int argc, char *argv[])
|
||||
// sensor diagnostics done continuously, not just at boot so don't warn about any issues just yet
|
||||
status_flags.condition_system_sensors_initialized = Commander::preflightCheck(&mavlink_log_pub, true, true, true, true,
|
||||
checkAirspeed, (status.rc_input_mode == vehicle_status_s::RC_IN_MODE_DEFAULT),
|
||||
!can_arm_without_gps, /*checkDynamic */ false, /* reportFailures */ false);
|
||||
!can_arm_without_gps, /*checkDynamic */ false, is_vtol(&status), /* reportFailures */ false);
|
||||
set_tune_override(TONE_STARTUP_TUNE); //normal boot tune
|
||||
}
|
||||
|
||||
|
||||
@@ -1100,7 +1100,7 @@ int preflight_check(struct vehicle_status_s *status, orb_advert_t *mavlink_log_p
|
||||
|
||||
bool preflight_ok = Commander::preflightCheck(mavlink_log_pub, true, true, true, true,
|
||||
checkAirspeed, (status->rc_input_mode == vehicle_status_s::RC_IN_MODE_DEFAULT),
|
||||
!can_arm_without_gps, true, reportFailures);
|
||||
!can_arm_without_gps, true, status->is_vtol, reportFailures);
|
||||
|
||||
if (!status_flags->circuit_breaker_engaged_usb_check && status_flags->usb_connected && prearm) {
|
||||
preflight_ok = false;
|
||||
|
||||
Reference in New Issue
Block a user