Add "ring" queue mode for ROS2 bridge and serde_bytes#914
Merged
Conversation
|
Hi! Thanks for opening this pull request. Because this is your first time contributing to this repository, please read our contributor guide: |
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.
Summary
Proposes 2 improvements for the ROS2 bridge:
The current mode for the ROS2 bridge Rx channel is "FIFO". It can be an issue when Copper task is slower than the ROS topic, in that case the Zenoh thread can get blocked because the channel is not being emptied fast enough. This PR brings in "Ring" mode where the created Zenoh channel has a buffer where oldest messages get dropped when the channel is full. Useful when Copper task is slower than the ROS topic and we want to consume the latest message.
Follows comments from Zenoh here:
https://github.com/eclipse-zenoh/zenoh/blob/main/zenoh/src/api/handlers/fifo.rs#L30
Brings in serde_bytes Serialization/Deserialization for Vec. I measured improvement on a ROS2 bridge subscribing to an 640 x 480 image, having a 40 ms latency without serde_bytes, to 3 ms with it.
Related issues
Changes
Testing
just fmtjust lintjust testjust std-ci(if std/runtime paths are impacted)just nostd-ci(if embedded/no_std paths are impacted)pro-tip:
justwith no parameters in the root defaults tojust fmt,just lint, andjust test.Checklist
Breaking changes (if any)
None, Fifo stays the default for the bridge
Additional context