Skip to content

Add "ring" queue mode for ROS2 bridge and serde_bytes#914

Merged
gbin merged 2 commits into
copper-project:masterfrom
NRdrgz:nico/improv_ros2_bridge
Mar 9, 2026
Merged

Add "ring" queue mode for ROS2 bridge and serde_bytes#914
gbin merged 2 commits into
copper-project:masterfrom
NRdrgz:nico/improv_ros2_bridge

Conversation

@NRdrgz

@NRdrgz NRdrgz commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

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

  • Closes #

Changes

Testing

  • just fmt
  • just lint
  • just test
  • optional full just std-ci (if std/runtime paths are impacted)
  • optional full just nostd-ci (if embedded/no_std paths are impacted)
  • Other (please specify):

pro-tip: just with no parameters in the root defaults to just fmt, just lint, and just test.

Checklist

  • I have updated docs or examples where needed
  • I have added or updated tests where needed
  • I have considered platform impact (Linux/macOS/Windows/embedded)
  • I have considered config/logging changes (if applicable)
  • This change is not a breaking change (or I documented it below)

Breaking changes (if any)

None, Fifo stays the default for the bridge

Additional context

@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown

Hi! Thanks for opening this pull request.

Because this is your first time contributing to this repository, please read our contributor guide:
https://github.com/copper-project/copper-rs/blob/master/CONTRIBUTING.md

@gbin gbin added enhancement New feature or request include in changelog labels Mar 9, 2026

@gbin gbin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense thanks

@gbin gbin merged commit c5e55c9 into copper-project:master Mar 9, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants