ros2 / rviz

ROS 3D Robot Visualizer
BSD 3-Clause Clear License
274 stars 207 forks source link

[WARN] New subscription discovered on topic '/scan', requesting incompatible QoS #1122

Open hsd-dev opened 6 months ago

hsd-dev commented 6 months ago

Setup: Ubuntu 22.04, ROS humble

I am writing a ROS driver for a laser scanner and want to view the scan data in RViz. I have used SensorDataQoS while creating the publisher

scan_publisher_ = node_->create_publisher<sensor_msgs::msg::LaserScan>(scan_topic, rclcpp::SensorDataQoS());

and have also set the QoS values in .rviz as well

      Topic:
        Depth: 5
        Durability Policy: Volatile
        Filter size: 10
        History Policy: Keep Last
        Reliability Policy: Best Effort
        Value: /scan

when I run the driver, I get the following warning

[ros_main-1] [WARN] [1700130825.414718492] [ros_main]: New subscription discovered on topic '/scan', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: RELIABILITY_QOS_POLICY

But I can still view the data in RViz. Also, following is verbose output for the scan topic info:

ros2 topic info /scan --verbose
Type: sensor_msgs/msg/LaserScan

Publisher count: 1

Node name: ros_main
Node namespace: /
Topic type: sensor_msgs/msg/LaserScan
Endpoint type: PUBLISHER
GID: 01.0f.25.3c.d6.25.3e.66.01.00.00.00.00.00.12.03.00.00.00.00.00.00.00.00
QoS profile:
  Reliability: BEST_EFFORT
  History (Depth): UNKNOWN
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

Subscription count: 1

Node name: rviz
Node namespace: /
Topic type: sensor_msgs/msg/LaserScan
Endpoint type: SUBSCRIPTION
GID: 01.0f.25.3c.da.25.19.b4.01.00.00.00.00.00.22.04.00.00.00.00.00.00.00.00
QoS profile:
  Reliability: BEST_EFFORT
  History (Depth): UNKNOWN
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

So the settings do actually match. Why am I getting the warning in that case? And this happens only on humble (galactic and foxy works). I can do a test with the latest rolling as well, just in case, to narrow down that the problem is in the humble version.

audrow commented 6 months ago

Hi @ipa-hsd, could you provide the full code for a minimal reproducible example? Also, which DDS are you using?

Thanks for making the issue.