ros2 / rviz

ROS 3D Robot Visualizer
BSD 3-Clause Clear License
307 stars 214 forks source link

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

Open hsd-dev opened 10 months ago

hsd-dev commented 10 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 10 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.

wltjr commented 3 days ago

I am experiencing this as well using pointcloud_to_laserscan, anytime I start Rviz2, it seems to be messing up the topic and pointcloud_to_laserscan stops publishing to the /scan topic. I am using what should be the latest available, ROS 2 Jazzy, Ubuntu Noble, packaged versions.

[pointcloud_to_laserscan_node-6] [WARN] [1732215357.520418540] [pointcloud_to_laserscan]: New subscription discovered on topic '/scan', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: RELIABILITY_QOS_POLICY
[pointcloud_to_laserscan_node-6] [INFO] [1732215357.523424432] [pointcloud_to_laserscan]: Got a subscriber to laserscan, starting pointcloud subscriber
[pointcloud_to_laserscan_node-6] [INFO] [1732215482.382114669] [pointcloud_to_laserscan]: No subscribers to laserscan, shutting down pointcloud subscriber

I definitely changed it in Rviz2 to be best effort, to match the rest, I have no idea where the reliability policy is coming from. Like the original report, when I look at the topic information under ros2, rviz2 is using best effort. It seems to be happening on initial connect or something else in Rviz2. I can see about providing additional information but not sure I can provide a reproducible example. Thank you!