mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 03:23:35 +08:00
Subsystem_info status flags & checks: Moved the set_health_flags helper functions out of the /lib/ folder and into the module/commander folder because they are actually only needed there
This commit is contained in:
committed by
Beat Küng
parent
bd2af289f5
commit
302cb0a285
@@ -51,5 +51,4 @@ px4_add_module(
|
||||
drivers__device
|
||||
git_ecl
|
||||
ecl_validation
|
||||
health_flags
|
||||
)
|
||||
|
||||
@@ -920,17 +920,17 @@ bool VotedSensorsUpdate::check_failover(SensorData &sensor, const char *sensor_n
|
||||
// reduce priority of failed sensor to the minimum
|
||||
sensor.priority[failover_index] = 1;
|
||||
|
||||
// Update the subsystem_info uORB given that a sensor failed
|
||||
PX4_ERR("Sensor %s #%i failed. Reconfiguring sensor priorities.", sensor_name, failover_index);
|
||||
|
||||
int ctr_valid = 0;
|
||||
|
||||
for (uint8_t i = 0; i < sensor.subscription_count; i++) {
|
||||
if (sensor.priority[i] > 1) { ctr_valid++; }
|
||||
|
||||
PX4_WARN("FAILOVER event (idx=%u)! Sensor %s: Nr. %u Priority: %u", failover_index, sensor_name, i, sensor.priority[i]);
|
||||
PX4_WARN("Remaining sensors after failover event %u: %s #%u priority: %u", failover_index, sensor_name, i,
|
||||
sensor.priority[i]);
|
||||
}
|
||||
|
||||
PX4_ERR("%s sensor switch from #%i", sensor_name, failover_index);
|
||||
|
||||
if (ctr_valid < 2) {
|
||||
if (ctr_valid == 0) {
|
||||
// Zero valid sensors remain! Set even the primary sensor health to false
|
||||
|
||||
Reference in New Issue
Block a user