Repository navigation
fix(ars408): fix latency and thread safety issues in the radar driver - #8
Merged
Merged
Conversation
added 5 commits
November 12, 2026 09:40
Signed-off-by: Skyler <skye@polymathrobotics.com>
…tdown Signed-off-by: Skyler <skye@polymathrobotics.com>
Signed-off-by: Skyler <skye@polymathrobotics.com>
Signed-off-by: Skyler <skye@polymathrobotics.com>
Signed-off-by: Skyler <skye@polymathrobotics.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Publish each ARS408 object list when its last frame arrives, instead of one radar cycle later when the next list starts.
The driver held every list until the next
Obj_0_Status, so eachRadarTracksmessage reached its consumers about one cycle late.This PR also fixes two thread-safety bugs in the same path and moves the driver to C++20.
RadarStatetells the driver from the quality and extended-info flags. A list that loses a frame is still published when the next one starts.Obj_0_Statusframe, falling back to the node clock under sim time or when the frame has no receive time.RadarTracksfirst and byunique_ptr, and send the delete-all marker and the track markers in oneMarkerArray.vehicle_odometry_with a mutex, because the executor writes it and the CAN reception thread reads it.ament_target_dependenciesso that the driver builds on lyricalBenchmark
Synthetic traffic on
vcan0: 4 radars on a 72 ms cycle, frames 250 µs apart, every object a 4 × 2 m box with quality and extended info on.The driver runs composed with four
radar_tracks_to_pointcloudconverters in onecomponent_container_events_cbg_isolatedwith intra-process comms.Latency is the time from the last CAN frame of a list to the
PointCloud2for that list arriving on/<link>/points.3 runs of 20 s per cell, alternating before and after, 940 lists per run after warm-up, no lists lost in any run.
Cells are the median over runs, with the range in parentheses.
mainthe wait for the next list is the cycle minus the time the list takes on the bus, which is why the 30-object lists wait less.collision_monitor'sbase_shift_correctionandsource_timeoutsee.On
mainthe stamp is the publish time, so the age is about 0 and the hold is invisible.With this PR the stamp is when the radar started the list, so the age includes the time the list took to arrive (7.6 ms and 22.7 ms here) and is no longer hidden.
Limits: vcan on a desktop, synthetic traffic, no radar hardware.
The receiver is rclpy, so a few tens of µs of its wake-up are in every number, before and after alike.
Migration Guide
None.
Consumers see
RadarTracks,ObjectListand marker header stamps that are older than before by the time a list takes to arrive. The stamps now mark when the radar started the list rather than when the driver published it.