Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
Chris Lalancette a437435c4e | 3 years ago | |
---|---|---|
.. | ||
scripts | 3 years ago | |
README.md | 6 years ago | |
__init__.py | 6 years ago |
The demo is written using the rclpy
Python client library.
Please note that the rclpy
client library API is currently under heavy development and likely to change.
Some launch files are provided for comparing different QoS policies.
To start one such publisher, assuming you have already installed ROS 2 and sourced your setup file, run:
ros2 run topic_monitor data_publisher -- critical
This will start a ROS 2 publisher on the topic critical_data
that will use the default QoS profile, which includes “reliable” reliability settings.
A message will be sent periodically, with incrementing values that act as sequence numbers.
When the topic monitor receives one of these messages, it will maintain an internal counter that is used to keep track of what value should be being received from the publisher.
This enables the “reception rate” of the topic to be calculated based on how many of the expected values have been received from the publisher.
To start a publisher with “best effort” reliability settings, run:
ros2 run topic_monitor data_publisher -- sensor --best-effort
This will start a ROS 2 publisher on the topic sensor_data_best_effort
that will use the “best effort” setting for the QoS reliability policy.
This publisher will not check if sent data is acknowledged by any subscriptions, and therefore the reception rate may drop below 100% if the network is congested or there is a poor connection between the monitor and the publisher.
When the data publisher script is terminated with Ctrl + C
, the publisher will attempt to send -1
as a “last breath” message that signals the topic monitor that it is going offline gracefully.
Otherwise, if the topic monitor doesn't receive a message from a publisher for a pre-determined amount of time, it will consider the topic "stale".
For a full list of options for the data publisher, type ros2 run topic_monitor data_publisher -- --help
.
To start the topic monitor, run:
ros2 run topic_monitor topic_monitor
This will start a topic monitor that will subscribe to any ROS 2 topics that match the structure “_data” or “_data_best_effort”, where can be something such as “topic1”.
It will subscribe to the topics with matching QoS settings (best effort in the case of best effort, and vice-versa).
Monitored topics have the following properties monitored:
The status: “Alive” if a message has been received from the topic in the last stale-time
(s
) seconds, otherwise it is “Stale”.
If a message of -1
is received, the topic is considered “Offline” which represents that the topic has been gracefully disconnected as opposed to lost.
The reception rate: If a topic is not “Offline”, its reception rate will be calculated based on the last window-size
(n
) values that are expected to have been received.
The expected values are a sequence of increasing numbers every expected-period
(t
) seconds.
To account for latency, allowed-latency
(l
) seconds are allowed between expected and received values.
The reception rate is calculated every stats-calc-period
(c
) seconds.
The properties of the topic monitor can be modified from the command line. Run topic_monitor --help
for details.
No Description
C++ Python Text C Markdown other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》