Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
Marco A. Gutierrez 0f3071f88c | 1 week ago | |
---|---|---|
.. | ||
doc | 7 years ago | |
launch | 1 year ago | |
resource | 6 years ago | |
test | 4 years ago | |
topic_monitor | 2 years ago | |
CHANGELOG.rst | 1 week ago | |
README.md | 11 months ago | |
package.xml | 1 week ago | |
setup.cfg | 3 years ago | |
setup.py | 1 week ago |
This demo uses a “topic monitor” that can be used to visualize the statistics of ROS 2 topics that are publishing sequential data.
Please read the About Quality of Service Settings page for background information about the Quality of Service settings available in ROS 2.
To visualize the reception rate, we will use a “topic monitor” that periodically calculates the reception rate of topics with publishers of periodic, sequential data.
If you have the Python3 matplotlib
and tkinter
packages installed, you can use the --display
option to plot the reception rate of topics:
ros2 run topic_monitor topic_monitor --display
For all invocations that follow make sure the same ROS_DOMAIN_ID
has been set to the same value on the respective machines.
You will need two machines with ROS 2: one mobile and one stationary.
ros2 launch topic_monitor reliability_demo_launch.py
executable on the stationary machine.ros2 run topic_monitor topic_monitor --display --allowed-latency 5
to account for any latency that may occur re-sending the reliable messages.You should see that the "reliable" topic has a reception rate that is almost always either 0 or 100%, while the "best effort" topic has a reception rate that fluctuates based on the strength of the connection.
Here’s an example plot:
The behavior shown here is comparable to the difference between that of TCPROS and UDPROS.
One difference is that even the “reliable” reliability in ROS 2 uses UDP underneath, which allows for a range of behavior in between that of TCP and UDP.
Another key difference is that UDPROS has currently only been implemented in the C++ ROS 1 client library, and is not an option for ROS 1 nodes written in Python.
By contrast, the QoS settings available in ROS 2 are implemented in a core library that language-specific client libraries then make use of, meaning that these features only have to be implemented once and then just exposed through the different language interfaces.
See ROS 2 Client Libraries for more information.
Repeat the previous demo with a lower allowed latency on the topic monitor.
That is, in step 2, run ros2 run topic_monitor topic_monitor --display --allowed-latency 1
.
You should see that the “best effort” reception rate is unaffected, while the “reliable” reception rate drops sooner when the machines are going out of range of each other.
This is because a “reliable” message may be re-sent multiple times in order to be delivered.
As you saw in the previous demo, “reliable” data can take a while to be successfully sent if the network connection is not robust.
If calls to publish
are being made faster than the data can be acknowledged by the subscriber, the queue depth comes into play.
A queue depth of 10 (the default) means that 10 messages will be kept in the publisher’s buffer before they get overwritten.
If the 10th latest message has not been successfully acknowledged by the time the next message is published, it will be overwritten and the subscriber will not receive it, causing the reception rate to decline.
You will need two machines with ROS 2: one mobile and one stationary.
ros2 launch topic_monitor depth_demo_launch.py
executable on the stationary machine.ros2 run topic_monitor topic_monitor --display
.You should see that the reception rate of the publishers with the higher depth is better than those with the depth of 1, because messages are less likely to get overwritten when data is taking longer to be acknowledged.
The maximum message size in UDP (the underlying transport for ROS 2) is 64KB, after which messages get fragmented into smaller parts and sent individually.
Larger message requires multiple fragments to be sent, and unless all fragments are received, the reception rate of the data declines.
For connections with "reliable" reliability policy, lost fragments will be re-sent.
For connections with "best effort" reliability, the loss of any fragment causes the whole message to be discarded by the subscriber.
You will need two machines running ROS 2: one stationary and one mobile.
Warning: this demo causes a lot of network traffic.
You should not use the Fast RTPS ROS middleware implementation for this part.
See DDS and ROS Middleware Implementations for instructions on how to change the vendor.
ros2 launch topic_monitor fragmentation_demo_launch.py
executable on the stationary machine.ros2 run topic_monitor topic_monitor --display --expected-period 4
on the mobile machine.You should see that the difference between the reception rate of the small and medium message sizes not the same as that for the medium and large message sizes.
The large message requires two fragments to send it (the xlarge message three), and unless both fragments are received, the reception rate goes down.
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》