Better handle missed IMU messages in localizer
Increase the max dt to better handle dropped messages.
Also, more explicitly track the reasons why different messages were
dropped. The current main culprits seem to be (a) messages missing
entirely and (b) Pi <-> PICO checksum failures.
Change-Id: I882b29a304fb0a673722d9dc37184a87e0a27a0d
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/y2022/localizer/localizer_plotter.ts b/y2022/localizer/localizer_plotter.ts
index 239d2cb..bcd8894 100644
--- a/y2022/localizer/localizer_plotter.ts
+++ b/y2022/localizer/localizer_plotter.ts
@@ -268,10 +268,34 @@
const timingPlot =
aosPlotter.addPlot(element, [DEFAULT_WIDTH, DEFAULT_HEIGHT]);
- timingPlot.plot.getAxisLabels().setTitle('Timing');
+ timingPlot.plot.getAxisLabels().setTitle('Fault Counting');
timingPlot.plot.getAxisLabels().setXLabel(TIME);
timingPlot.addMessageLine(localizer, ['model_based', 'clock_resets'])
.setColor(GREEN)
.setDrawLine(false);
+
+ timingPlot
+ .addMessageLine(
+ localizer, ['imu_failures', 'imu_to_pico_checksum_mismatch'])
+ .setColor(BLUE)
+ .setDrawLine(false);
+
+ timingPlot
+ .addMessageLine(
+ localizer, ['imu_failures', 'pico_to_pi_checksum_mismatch'])
+ .setColor(RED)
+ .setDrawLine(false);
+
+ timingPlot
+ .addMessageLine(
+ localizer, ['imu_failures', 'other_zeroing_faults'])
+ .setColor(CYAN)
+ .setDrawLine(false);
+
+ timingPlot
+ .addMessageLine(
+ localizer, ['imu_failures', 'missed_messages'])
+ .setColor(PINK)
+ .setDrawLine(false);
}