0
$\begingroup$

Rosanswers logo

###Objective

Running a ROS2 node launches a background process which I imagine is the DDS implementation (FastRTPS). This process is then responsible for forwarding all messages over the middleware to any other ROS2 processes.

I'm trying to find out where exactly this happens. ROS2 is not a single executable, but uses a CLI program to handle commands and then appears to take care of launching the appropriate processes. However, I've not been able to pinpoint where the background process is launched. It may be that the executable node itself forks something when using the rclcpp (or rclpy) API calls.

Does anyone have some quick insight or resources about this? I find that trying to understand the source code of ROS2 is quite difficult because of so many templates and macros and abstract interfaces.


Originally posted by cxrandolph on ROS Answers with karma: 7 on 2020-04-10

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Running a ROS2 node launches a background process which I imagine is the DDS implementation (FastRTPS).

Are you referring to the ROS 2 daemon by any chance? See #q327348.

This process is then responsible for forwarding all messages over the middleware to any other ROS2 processes.

That process is not "the DDS implementation", and DDS is not forked or exec'd anywhere. That's not how things work.

The DDS libraries are used as any other library would: linked at runtime into the application binary which then calls functions provided by those libraries. In ROS 2, there are several (abstraction) layers of libraries between a node and the actual DDS implementation, but the general principle holds.

The terminology you use (ie: "forked or exec'd") implies you are assuming there are processes, but that's not the case (well, there are processes of course, but not as you imply they are used or setup).

Does anyone have some quick insight or resources about this? I find that trying to understand the source code of ROS2 is quite difficult because of so many templates and macros and abstract interfaces.

The ROS 2 Design site has some articles about the general (and detailed) architecture of ROS 2. Specifically the ROS 2 middleware interface article may be informative.

Another source of information about how things are implemented would be the Core Stack Developer Overview, specifically the Internal ROS Interfaces and further sections.


Originally posted by gvdhoorn with karma: 86574 on 2020-04-10

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by cxrandolph on 2020-04-10:
Thank you for this! It is very informative. It makes sense that since DDS is supposed to be distributive, assuming it would exist as a centralized process is illogical.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.