Open ghost opened 2 years ago
Hi @GrozaGabriel
First of all, Fast DDS foxy version (v2.0.x) does not have Statistics module. So you will be unable to use it with an already installed ROS 2.
However, it is possible to update the Fast DDS version by reinstalling ROS 2 from sources and updating the fastrtps
repo to a newer version (the last release is v2.6.0 https://github.com/eProsima/Fast-DDS/releases/tag/v2.6.0)
EDIT:
As @EduPonz commented, it would be required to recompile the rmw_fastrtps
as well.
In order to use statistics, fastrtps
project must be compiled with statistics ON, using the following CMake option -DFASTDDS_STATISTICS=ON
.
Not related, but a comment:
I would say that ROS2 Domain is set with env var ROS_DOMAIN_ID
, not ROS2_DOMAIN_ID
. https://docs.ros.org/en/foxy/Concepts/About-Domain-ID.html
However, it is possible to update the Fast DDS version by reinstalling ROS 2 from sources and updating the
fastrtps
repo to a newer version (the last release is v2.6.0 https://github.com/eProsima/Fast-DDS/releases/tag/v2.6.0)
I'm afraid that solely this will not work, as Foxy's rmw_fastrtps uses the deprecated Fast RTPS API, which does not support statistics. To monitor statistics in Foxy, the rmw_fastrtps would need to be ported to the Fast DDS API. This work was done by @jparisu and other people for Galactic in ros2/rmw_fastrtps#518, but has not been backported.
Update: I installed ros2 galactic, DFASTDDS_STATISTICS=ON este true
worked twice, but then stopped displaying statistics again
@jparisu
Hi @GrozaGabriel , Glad to hear that you manage to use it. Still, I do not understand what do you mean with worked twice. That you executed two times the talker and listener and it worked and the third one didn't? That first talker and listener worked, and third not? That the third time you started the Monitor did not work? Or that a third statistics topic did not worked?
With those CMake options everything should work fine. And checking your screenshots may not be any problem. Please, be more specific in your problem case.
Aside Comment Using Fast DDS Monitor with ROS2 has a cool feature that allows you to display or hide "metatraffic" entities, in case you want to check it.
that a third statistical subject did not work
There are some statistics that work differently than others.
There are some topics that only work if the communication is done with a remote machine (if using intraprocess or interprocess communication they will not), for instance DATA_COUNT
.
There are some statistics that will commonly not retrieve data except in extreme scenarios (as the lost data ones), for instance RESENT_DATA
There are some that may only make sense depending on the entity that you choose to monitorize them, for instance RTPS_PACKETS_SENT
etc.
Please, check this Backend documentation in order to have a better undestanding on how these topics work: https://fast-dds-statistics-backend.readthedocs.io/en/latest/rst/statistics_backend/get_data.html
And if you still have any question or your example does not work as expected, please retrieve more information about the specific topic it is not working properly, and I can give you more accurate information.
HELLO, i want to compile ROS 2 foxy with statistics and monitor a ROS 2 talker and listener with Fast DDS Monitor with these commands:![dds](https://user-images.githubusercontent.com/79835978/165587778-b8585f8a-48f6-4838-8f9b-6e128a51708f.png)
export FASTDDS_STATISTICS=ON
first terminal export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
ROS2_DOMAIN_ID=1 ros 2 run demo_nodes_cpp talker
sec terminal export RMW_IMPLEMENTATION=rmw_fastrtps_cpp ROS2_DOMAIN_ID=1 ros 2 run demo_nodes_cpp listener
But the monitor doesn`t show statistics, can you help me ? Thank you for your attention and I am waiting with enthusiasm your response!