2.1. ROS 2 network statistics inspection with ROS 2 Monitor¶
2.1.1. Background¶
Vulcanexus integrates ROS 2 Monitor, which is a useful tool for monitoring and studying a ROS 2 network as ROS 2 relies on the DDS specification to communicate the different nodes. The automatic discovery of entities in a local network enables to easily identify the different running Participants, their Endpoints, the Topics that each of them is using, and even the network interfaces they are employing to communicate with one another. Additionally, it is possible to receive statistical data from every endpoint in the network leveraging the ROS 2 Statistics Module. This data is very useful to analyze the DDS network performance and seek possible communication problems in it.
This tutorial provides step-by-step instructions to use Vulcanexus for monitoring a ROS 2 talker/listener demo.
2.1.2. Prerequisites¶
Ensure that the Vulcanexus installation includes Vulcanexus Tools (either vulcanexus-jazzy-desktop
, vulcanexus-jazzy-tools
, or vulcanexus-jazzy-base
).
Also, remember to source the environment in every terminal in this tutorial.
source /opt/vulcanexus/jazzy/setup.bash
2.1.3. Launch ROS 2 Monitor¶
Initiate ROS 2 Monitor running the following command:
fastdds_monitor
Once ROS 2 Monitor is launched, start a monitor in domain 0
(default domain).
2.1.4. Execute ROS 2 demo nodes with statistics¶
In order to activate the publication of statistical data, eProsima Fast DDS requires an environment variable specifying which kinds of statistical data are to be reported.
Consequently, before launching the ROS 2 nodes, remember to set FASTDDS_STATISTICS
environment variable.
Run the following commands in different terminals (remember to source the Vulcanexus environment):
export FASTDDS_STATISTICS="HISTORY_LATENCY_TOPIC;NETWORK_LATENCY_TOPIC;PUBLICATION_THROUGHPUT_TOPIC;\
SUBSCRIPTION_THROUGHPUT_TOPIC;RTPS_SENT_TOPIC;RTPS_LOST_TOPIC;\
HEARTBEAT_COUNT_TOPIC;ACKNACK_COUNT_TOPIC;NACKFRAG_COUNT_TOPIC;\
GAP_COUNT_TOPIC;DATA_COUNT_TOPIC;RESENT_DATAS_TOPIC;SAMPLE_DATAS_TOPIC;\
PDP_PACKETS_TOPIC;EDP_PACKETS_TOPIC;DISCOVERY_TOPIC;PHYSICAL_DATA_TOPIC"
ros2 run demo_nodes_cpp listener
export FASTDDS_STATISTICS="HISTORY_LATENCY_TOPIC;NETWORK_LATENCY_TOPIC;PUBLICATION_THROUGHPUT_TOPIC;\
SUBSCRIPTION_THROUGHPUT_TOPIC;RTPS_SENT_TOPIC;RTPS_LOST_TOPIC;\
HEARTBEAT_COUNT_TOPIC;ACKNACK_COUNT_TOPIC;NACKFRAG_COUNT_TOPIC;\
GAP_COUNT_TOPIC;DATA_COUNT_TOPIC;RESENT_DATAS_TOPIC;SAMPLE_DATAS_TOPIC;\
PDP_PACKETS_TOPIC;EDP_PACKETS_TOPIC;DISCOVERY_TOPIC;PHYSICAL_DATA_TOPIC"
ros2 run demo_nodes_cpp talker
2.1.5. Monitoring network¶
Now, the two new Participants are visible in the ROS 2 Monitor’s DDS Panel.
2.1.5.1. Alias¶
Participants in ROS 2 are named /
by default.
In order to differentiate them, it is possible to change the Participant’s aliases within the ROS 2 Monitor.
In this case, the vulcanexus-jazzy-talker
Participant would be the one with a writer, and the vulcanexus-jazzy-listener
Participant would be the one with a reader.
2.1.5.2. Physical data¶
In order to see the information of the host and the physical context where every node is running, go to the Explorer Pane and activate the Physical Panel. There, the host, user and process of each node are displayed.
2.1.5.3. Statistical data¶
To show statistical data about the communication between the vulcanexus-jazzy-talker
and the vulcanexus-jazzy-listener
, follow the steps to create dynamic series chart.
2.1.5.4. Introspect metatraffic topics¶
ROS 2 Monitor filters by default the topics used for sharing metatraffic, as well as the endpoints related to them, so users can inspect their network easily.
These topics are the ones that ROS 2 uses for discovery and configuration purposes, such as ros_discovery_info
, as well as those used by Fast DDS to report statistical data.
In order to see these topics in the monitor, click View->Show Metatraffic menu button. Now, these topics are shown in the logical panel. Furthermore, the Readers and Writers associated to them are now listed under their respective Participants.