Conversation
Greptile SummaryThis PR fixes two related timestamp bugs in the GO2 lidar pipeline:
Confidence Score: 5/5Safe to merge — the change is a well-scoped, well-tested fix to a hardware timestamp quirk with no impact on unrelated subsystems. The fix is narrow and correct: sensor stamps are now used as the authoritative source and a stateful forward-extrapolation operator repairs the rare stale frames. The three new unit tests cover the normal path, a single stale frame, and consecutive stale frames. In-place mutation of item.ts inside the map is safe here because pointcloud2_from_webrtc_lidar creates a fresh PointCloud2 object for every frame before it reaches repair_stale_ts, so no shared references exist upstream. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[raw_lidar_stream\nWebRTC frames] --> B[ops.map\npointcloud2_from_webrtc_lidar\nuses data stamp]
B --> C[repair_stale_ts\nops.map _repair]
C --> D{item.ts <= prev_good?}
D -- No\nmonotonic --> E[prev_good = item.ts\nemit unchanged]
D -- Yes\nstale stamp --> F[item.ts = prev_good + 130ms\nlog warning\nprev_good = item.ts\nemit repaired item]
E --> G[backpressure\ndownstream consumers]
F --> G
Reviews (2): Last reviewed commit: "logger fix" | Re-trigger Greptile |
GO2 webrtc stream has a bug with bizzare timestamps occasionally attached to lidar frames
this very simple hack corrects timestamps that are non monotonic because we know the expected lidar frequency