mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-02 08:00:36 +08:00
Commander: Fix reporting in presence of no telemetry link
This commit is contained in:
@@ -382,9 +382,9 @@ int commander_main(int argc, char *argv[])
|
||||
if (!strcmp(argv[1], "check")) {
|
||||
int mavlink_fd_local = px4_open(MAVLINK_LOG_DEVICE, 0);
|
||||
int checkres = 0;
|
||||
checkres = preflight_check(&status, mavlink_fd_local, false);
|
||||
checkres = preflight_check(&status, mavlink_fd_local, false, true);
|
||||
warnx("Preflight check: %s", (checkres == 0) ? "OK" : "FAILED");
|
||||
checkres = preflight_check(&status, mavlink_fd_local, true);
|
||||
checkres = preflight_check(&status, mavlink_fd_local, true, true);
|
||||
warnx("Prearm check: %s", (checkres == 0) ? "OK" : "FAILED");
|
||||
px4_close(mavlink_fd_local);
|
||||
return 0;
|
||||
|
||||
@@ -743,12 +743,12 @@ bool set_nav_state(struct vehicle_status_s *status, const bool data_link_loss_en
|
||||
return status->nav_state != nav_state_old;
|
||||
}
|
||||
|
||||
int preflight_check(const struct vehicle_status_s *status, const int mavlink_fd, bool prearm)
|
||||
int preflight_check(const struct vehicle_status_s *status, const int mavlink_fd, bool prearm, bool force_report)
|
||||
{
|
||||
/*
|
||||
*/
|
||||
bool reportFailures = false;
|
||||
reportFailures = !status->condition_system_prearm_error_reported && status->condition_system_hotplug_timeout;
|
||||
bool reportFailures = force_report || (!status->data_link_lost &&
|
||||
!status->condition_system_prearm_error_reported && status->condition_system_hotplug_timeout);
|
||||
|
||||
bool checkAirspeed = false;
|
||||
/* Perform airspeed check only if circuit breaker is not
|
||||
|
||||
@@ -65,6 +65,6 @@ transition_result_t hil_state_transition(hil_state_t new_state, orb_advert_t sta
|
||||
|
||||
bool set_nav_state(struct vehicle_status_s *status, const bool data_link_loss_enabled, const bool mission_finished, const bool stay_in_failsafe);
|
||||
|
||||
int preflight_check(const struct vehicle_status_s *status, const int mavlink_fd, bool prearm);
|
||||
int preflight_check(const struct vehicle_status_s *status, const int mavlink_fd, bool prearm, bool force_report=false);
|
||||
|
||||
#endif /* STATE_MACHINE_HELPER_H_ */
|
||||
|
||||
Reference in New Issue
Block a user