mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-07 09:13:32 +08:00
voted_sensors_update: don't report failover if previous index is invalid
This commit is contained in:
@@ -872,8 +872,12 @@ bool VotedSensorsUpdate::check_failover(SensorData &sensor, const char *sensor_n
|
||||
uint32_t flags = sensor.voter.failover_state();
|
||||
|
||||
if (flags == DataValidator::ERROR_FLAG_NO_ERROR) {
|
||||
//we switched due to a non-critical reason. No need to panic.
|
||||
PX4_INFO("%s sensor switch from #%i", sensor_name, sensor.voter.failover_index());
|
||||
int failover_index = sensor.voter.failover_index();
|
||||
|
||||
if (failover_index != -1) {
|
||||
//we switched due to a non-critical reason. No need to panic.
|
||||
PX4_INFO("%s sensor switch from #%i", sensor_name, failover_index);
|
||||
}
|
||||
|
||||
} else {
|
||||
mavlink_log_emergency(&_mavlink_log_pub, "%s #%i fail: %s%s%s%s%s!",
|
||||
|
||||
Reference in New Issue
Block a user