mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 11:23:34 +08:00
commander: don't impose additional timeouts in sensor checks
- the sensors hub is responsible for sensor timeouts
This commit is contained in:
@@ -49,15 +49,15 @@ bool PreFlightCheck::gyroCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s &
|
||||
{
|
||||
const bool exists = (orb_exists(ORB_ID(sensor_gyro), instance) == PX4_OK);
|
||||
bool calibration_valid = false;
|
||||
bool gyro_valid = false;
|
||||
bool valid = false;
|
||||
|
||||
if (exists) {
|
||||
|
||||
uORB::SubscriptionData<sensor_gyro_s> gyro{ORB_ID(sensor_gyro), instance};
|
||||
|
||||
gyro_valid = (hrt_elapsed_time(&gyro.get().timestamp) < 1_s);
|
||||
valid = (gyro.get().device_id != 0) && (gyro.get().timestamp != 0);
|
||||
|
||||
if (!gyro_valid) {
|
||||
if (!valid) {
|
||||
if (report_fail) {
|
||||
mavlink_log_critical(mavlink_log_pub, "Preflight Fail: no valid data from Gyro #%u", instance);
|
||||
}
|
||||
@@ -80,11 +80,11 @@ bool PreFlightCheck::gyroCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s &
|
||||
}
|
||||
|
||||
if (instance == 0) {
|
||||
set_health_flags(subsystem_info_s::SUBSYSTEM_TYPE_GYRO, exists, !optional, calibration_valid && gyro_valid, status);
|
||||
set_health_flags(subsystem_info_s::SUBSYSTEM_TYPE_GYRO, exists, !optional, calibration_valid && valid, status);
|
||||
|
||||
} else if (instance == 1) {
|
||||
set_health_flags(subsystem_info_s::SUBSYSTEM_TYPE_GYRO2, exists, !optional, calibration_valid && gyro_valid, status);
|
||||
set_health_flags(subsystem_info_s::SUBSYSTEM_TYPE_GYRO2, exists, !optional, calibration_valid && valid, status);
|
||||
}
|
||||
|
||||
return calibration_valid && gyro_valid;
|
||||
return calibration_valid && valid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user