tasks: motion: improve error messages

This commit is contained in:
2026-03-09 10:11:24 +01:00
parent 3479fd1bf8
commit 6c43d9f2b7

View File

@@ -17,11 +17,11 @@ pub async fn motion_task(src: DynamicReceiver<'static, Measurement>, prediction_
match next_measurement { match next_measurement {
Measurement::IMU { accel, gyro } => { Measurement::IMU { accel, gyro } => {
states.insert_imu(accel, gyro); states.insert_imu(accel, gyro);
states.commit(&prediction_sink).with_timeout(TIMEOUT).await.expect("Could not commit IMU data in time"); states.commit(&prediction_sink).with_timeout(TIMEOUT).await.expect("Could not commit IMU data in time. Is the prediction bus stalled?");
}, },
Measurement::GPS(Some(gps_pos)) => { Measurement::GPS(Some(gps_pos)) => {
states.insert_gps(gps_pos); states.insert_gps(gps_pos);
states.commit(&prediction_sink).with_timeout(TIMEOUT).await.expect("Could not commit GPS data in time"); states.commit(&prediction_sink).with_timeout(TIMEOUT).await.expect("Could not commit GPS data in time. Is the prediction bus stalled?");
}, },
Measurement::GPS(None) => { Measurement::GPS(None) => {
states.has_gps_fix.set(false); states.has_gps_fix.set(false);
@@ -29,7 +29,7 @@ pub async fn motion_task(src: DynamicReceiver<'static, Measurement>, prediction_
// FIXME: This needs harmonized with the automatic data timeout from above, somehow? // FIXME: This needs harmonized with the automatic data timeout from above, somehow?
Measurement::SensorHardwareStatus(source, state) => { Measurement::SensorHardwareStatus(source, state) => {
warn!("Sensor {source:?} reports {state:?}!"); warn!("Sensor {source:?} reports {state:?}!");
prediction_sink.publish(Prediction::SensorStatus(source, state)).with_timeout(TIMEOUT).await.expect("Could not update sensor status in time"); prediction_sink.publish(Prediction::SensorStatus(source, state)).with_timeout(TIMEOUT).await.expect("Could not update sensor status in time. Is the prediction bus stalled?");
}, },
Measurement::SimulationProgress(source, duration, pct) => debug!("{source:?} simulation time: {} {} / 255", duration.as_secs(), pct), Measurement::SimulationProgress(source, duration, pct) => debug!("{source:?} simulation time: {} {} / 255", duration.as_secs(), pct),
Measurement::Annotation => () Measurement::Annotation => ()