Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast-DDS-monitor ros2 FOXY #153

Open
ghost opened this issue Apr 27, 2022 · 8 comments
Open

Fast-DDS-monitor ros2 FOXY #153

ghost opened this issue Apr 27, 2022 · 8 comments
Assignees
Labels
question Further information is requested

Comments

@ghost
Copy link

ghost commented Apr 27, 2022

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

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!

@ghost
Copy link
Author

ghost commented Apr 27, 2022

dds2

@jparisu jparisu self-assigned this Apr 28, 2022
@jparisu
Copy link
Contributor

jparisu commented Apr 28, 2022

Hi @GrozaGabriel

Fast DDS version

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 fastrtpsrepo 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.


Fast DDS compilation

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:

ROS Domain

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

@jparisu jparisu added the question Further information is requested label Apr 28, 2022
@EduPonz
Copy link

EduPonz commented Apr 28, 2022

However, it is possible to update the Fast DDS version by reinstalling ROS 2 from sources and updating the fastrtpsrepo 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.

@ghost
Copy link
Author

ghost commented Apr 29, 2022

Update: I installed ros2 galactic, DFASTDDS_STATISTICS=ON este true
worked twice, but then stopped displaying statistics again
dds poza

@ghost
Copy link
Author

ghost commented Apr 29, 2022

bag pl
@jparisu

@jparisu
Copy link
Contributor

jparisu commented Apr 29, 2022

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.

@ghost
Copy link
Author

ghost commented Apr 29, 2022

that a third statistical subject did not work

@jparisu
Copy link
Contributor

jparisu commented Apr 29, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants