-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
topic statistics doesn't publish "message_age" data if subscription's QoS is Keep last.
Expected Behavior
$ ros2 topic echo /topic_statistics # in another terminal
~~
metrics_source: message_age
~~
metrics_source: message_period
~~
metrics_source: message_age
~~
metrics_source: message_periodBoth message_age and message_period are published.
Actual Behavior
$ ros2 topic echo /topic_statistics # in another terminal
~~
metrics_source: message_period
~~
metrics_source: message_periodOnly message_period are published.
To Reproduce
I've implemented test case.
$ cd ~/ros2_ws/
$ git clone -b qos_history_1 https://github.com/hsgwa/intra_process_ping_latency_test.git src/intra_process_ping_latency_test
$ colcon build --packages-select intra_process_ping_latency_test
$ . ~/ros2_ws/install/local_setup.bash
$ ros2 run intra_process_ping_latency_test ping_test
$ ros2 topic echo /topic_statistics # in another terminalSystem
- OS: Ubuntu 20.04.1 LTS (Focal Fossa)
- ROS 2 Distro: Rolling
Additional context
As far as I read source code, this issues seems be caused by following reason.
- topic statistic's publisher takes over subscriber's QoS.
https://github.com/ros2/rclcpp/blob/master/rclcpp/include/rclcpp/create_subscription.hpp#L88 - publish_message() publishes "message_age" and then "message_period" almost simultaneously.
Here, second message (message_period) overwrites first message (message_age) if QoS depth = Keep Last.
https://github.com/ros2/rclcpp/blob/master/rclcpp/include/rclcpp/topic_statistics/subscription_topic_statistics.hpp#L152
--
I posted this issue to libsatistics_collector because this bug is related to topic statistics, but I probably should have published it to rclcpp.
If you have any comments, I will republish this issue to rclcpp.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working