Skip to content

Mixing best effort and reliable topics in the same node causes best effort topics to drop data. #854

@cwit-vcas

Description

@cwit-vcas

Generated by Generative AI

No

Operating System:

Linux ros2 6.14.0-35-generic #35~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Oct 14 13:55:17 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

ROS version or commit hash:

jazzy

RMW implementation (if applicable):

rmw_zenoh_cpp

RMW Configuration (if applicable):

No response

Client library (if applicable):

rclcpp

'ros2 doctor --report' output

No response

Steps to reproduce issue

  1. Create a talker node with a best effort and a reliable QoS publisher.
  2. Create a listener node with a best effort and reliable QoS subscriber to these topics.

I have attached an MWE here.

qos_issues_mwe.zip

Expected behavior

That both callbacks are processed equally at the same rate in the listener node.

Actual behavior

For publishing at 10 Hz I see the best effort topic dropping more than 9/10 messages. Very few messages get through, but notably some does make it.

If you run the MWE you will see messages like

[INFO] [1762433029.494035672] [qos_listener]: [best effort + volatile] Receive rate: 0.00 msg/s over 1.00 s (total=0) [INFO] [1762433029.494412061] [qos_listener]: [reliable + volatile] Receive rate: 9.99 msg/s over 1.00 s (total=10) [INFO] [1762433030.493976739] [qos_listener]: [best effort + volatile] Receive rate: 1.00 msg/s over 1.00 s (total=1) [INFO] [1762433030.494135978] [qos_listener]: [reliable + volatile] Receive rate: 10.00 msg/s over 1.00 s (total=20)

Showing that few messages get through on the best effort topic.
Changing the best effort publisher to reliable will make all messages get through at full rate.
Same goes for changing the reliable publisher to best effort.

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions