Ask Your Question
0

Where is DDS forked or exec'd in the ROS2 CLI?

asked 2020-04-10 07:55:14 -0500

cxrandolph gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-04-10 08:09:39 -0500

gvdhoorn gravatar image

updated 2020-04-10 08:58:27 -0500

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.

edit flag offensive delete link more

Comments

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.

cxrandolph gravatar image cxrandolph  ( 2020-04-10 08:57:09 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-04-10 07:55:14 -0500

Seen: 19 times

Last updated: Apr 10