mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 03:30:34 +08:00
commander remove gps receiver checks
This commit is contained in:
committed by
Lorenz Meier
parent
a6e863ac89
commit
4e45d7959c
@@ -448,42 +448,6 @@ out:
|
||||
return success;
|
||||
}
|
||||
|
||||
static bool gnssCheck(orb_advert_t *mavlink_log_pub, bool report_fail, bool &lock_detected)
|
||||
{
|
||||
bool success = true;
|
||||
lock_detected = false;
|
||||
int gpsSub = orb_subscribe(ORB_ID(vehicle_gps_position));
|
||||
|
||||
//Wait up to 2000ms to allow the driver to detect a GNSS receiver module
|
||||
px4_pollfd_struct_t fds[1];
|
||||
fds[0].fd = gpsSub;
|
||||
fds[0].events = POLLIN;
|
||||
|
||||
if (px4_poll(fds, 1, 2000) <= 0) {
|
||||
success = false;
|
||||
|
||||
} else {
|
||||
struct vehicle_gps_position_s gps;
|
||||
|
||||
if ((OK != orb_copy(ORB_ID(vehicle_gps_position), gpsSub, &gps)) ||
|
||||
(hrt_elapsed_time(&gps.timestamp) > 1000000)) {
|
||||
success = false;
|
||||
} else if (gps.fix_type >= 3) {
|
||||
lock_detected = true;
|
||||
}
|
||||
}
|
||||
|
||||
//Report failure to detect module
|
||||
if (!success) {
|
||||
if (report_fail) {
|
||||
mavlink_log_critical(mavlink_log_pub, "PREFLIGHT FAIL: GPS RECEIVER MISSING");
|
||||
}
|
||||
}
|
||||
|
||||
orb_unsubscribe(gpsSub);
|
||||
return success;
|
||||
}
|
||||
|
||||
static bool ekf2Check(orb_advert_t *mavlink_log_pub, bool optional, bool report_fail, bool enforce_gps_required)
|
||||
{
|
||||
bool success = true; // start with a pass and change to a fail if any test fails
|
||||
@@ -779,14 +743,6 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, bool checkSensors, bool check
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- Global Navigation Satellite System receiver ---- */
|
||||
if (checkGNSS) {
|
||||
bool lock_detected = false;
|
||||
if (!gnssCheck(mavlink_log_pub, reportFailures, lock_detected)) {
|
||||
failed = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- Navigation EKF ---- */
|
||||
// only check EKF2 data if EKF2 is selected as the estimator and GNSS checking is enabled
|
||||
int32_t estimator_type;
|
||||
|
||||
Reference in New Issue
Block a user