mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-08 14:00:35 +08:00
sensors: add accel/gyro current priority to sensors_status_imu
- later the sensor priorities (user configurable) can be factored into the estimator selection criteria
This commit is contained in:
@@ -305,3 +305,21 @@ uint32_t DataValidatorGroup::get_sensor_state(unsigned index)
|
||||
// sensor index not found
|
||||
return UINT32_MAX;
|
||||
}
|
||||
|
||||
uint8_t DataValidatorGroup::get_sensor_priority(unsigned index)
|
||||
{
|
||||
DataValidator *next = _first;
|
||||
unsigned i = 0;
|
||||
|
||||
while (next != nullptr) {
|
||||
if (i == index) {
|
||||
return next->priority();
|
||||
}
|
||||
|
||||
next = next->sibling();
|
||||
i++;
|
||||
}
|
||||
|
||||
// sensor index not found
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user