ros2 / rmw

The ROS Middleware (rmw) Interface.
Apache License 2.0
95 stars 69 forks source link

Warning about history depth of 0 even while using system default QoS #341

Closed bijoua29 closed 1 year ago

bijoua29 commented 1 year ago

Bug report

Required Info:

Steps to reproduce issue

pub_ = this->create_publisher<geometry_msgs::msg::Pose>("/pose", rclcpp::SystemDefaultsQoS());

Expected behavior

No QoS warning

Actual behavior

[node-7] [WARN] [1673487873.053699528] [rclcpp]: A zero depth with KEEP_LAST doesn't make sense; no data could be stored.This will be interpreted as SYSTEM_DEFAULT

Additional information

This warning was recently added. I would expect that if I use rclcpp::SystemDefaultsQoS() that I would not see any warning or error for QoS. I realize that the depth was probably always set to zero for the default and it was corrected by the rmw to 1 and only now the warning has been posted. But regardless, the expectation for a user is that the system default QoS would not generate a warning.

Secondarily, the warning itself is not very useful when my application has several publishers and subscriptions. It's probably not practical given the architecture of the code but I would find the warning message a lot more useful if the topic name was included.

clalancette commented 1 year ago

Yes, you are absolutely right; this should not warn. However, I'm pretty sure that this is a problem at the rmw layer, so I'm going to move this ticket there.

fujitatomoya commented 1 year ago

closing in favor of https://github.com/ros2/rclcpp/pull/2082