mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 08:40:30 +08:00
fix(sensors): stop reporting a missing gyro on every retry with SENS_IMU_MODE 2
Each IMU's angular velocity instance always filters its own gyro, so once that gyro stops publishing it retried the selection every 10 ms and logged "unable to find or subscribe to selected sensor" each time, flooding the console and the log for the rest of the flight. It now waits quietly until the gyro publishes again. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Andrea Bernasconi <andrea.bernasconi@auterion.com>
This commit is contained in:
1 parent
59ece7d571
commit
66ad4f8e28
1 file changed
+5
-2
@@ -268,11 +268,14 @@ bool VehicleAngularVelocity::SensorSelectionUpdate(const hrt_abstime &time_now_u
|
||||
|
||||
if (_imu_instance >= 0) {
|
||||
// always filter the same gyro, the selection only decides which instance publishes the median
|
||||
device_id = uORB::SubscriptionData<sensor_gyro_s> {ORB_ID(sensor_gyro), (uint8_t)_imu_instance} .get().device_id;
|
||||
const sensor_gyro_s gyro = uORB::SubscriptionData<sensor_gyro_s> {ORB_ID(sensor_gyro), (uint8_t)_imu_instance} .get();
|
||||
|
||||
if (device_id == 0) {
|
||||
// wait quietly while this gyro is missing instead of reporting it on every retry
|
||||
if ((gyro.device_id == 0) || (time_now_us > gyro.timestamp + 1_s)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
device_id = gyro.device_id;
|
||||
}
|
||||
|
||||
if ((_selected_sensor_device_id != device_id) || force) {
|
||||
|
||||
Reference in new issue
Block a user