ros2 communication ai_generated true

ROS2 subscriber receives no messages from publisher despite both running with no errors

ID: ros2/qos-incompatible-silent-drop

Also available as: JSON · Markdown
90%Fix Rate
92%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
any active

Root Cause

ROS2 QoS (Quality of Service) settings must be compatible between publisher and subscriber. A RELIABLE publisher and BEST_EFFORT subscriber work, but BEST_EFFORT publisher + RELIABLE subscriber silently drops all messages with no error by default.

generic

Workarounds

  1. 95% success Use compatible QoS: publisher reliability >= subscriber reliability
    pub_qos = QoSProfile(reliability=RELIABLE); sub_qos = QoSProfile(reliability=BEST_EFFORT)  # RELIABLE pub -> BEST_EFFORT sub is OK
  2. 90% success Use QoSProfile.sensor_data for all sensor topics consistently
    from rclpy.qos import qos_profile_sensor_data; pub = node.create_publisher(Image, 'camera', qos_profile_sensor_data)
  3. 88% success Use 'ros2 topic info -v /topic' to debug QoS mismatches
    ros2 topic info -v /camera/image  # shows publisher and subscriber QoS profiles side by side

Dead Ends

Common approaches that don't work:

  1. Use default QoS for both publisher and subscriber 88% fail

    Default QoS is RELIABLE+VOLATILE for most message types but BEST_EFFORT+VOLATILE for sensor data. Mixing sensor publishers with standard subscribers silently fails.

  2. Set both publisher and subscriber to RELIABLE 75% fail

    Works but RELIABLE over lossy networks (WiFi, multi-robot) causes message queuing and latency spikes. Sensor data becomes stale.