How many DDS participants are currently used/allowed by RMW?

,

We’ve currently been running into some issues that look like reaching the maximum number of DDS entities (i.e. nodes are started without error, but do not appear in ros2 node list, neither do their topics appear). If we shut down a few other nodes, than the same node runs well.

Overflowing into other domains should not be an issue according to The ROS_DOMAIN_ID — ROS 2 Documentation: Galactic documentation (we don’t use any other domains than 0). We don’t yet have 120 nodes, but I guess we’ll get there.

However, with the changes from Switch to one participant per context by ivanpauno · Pull Request #189 · ros2/rmw · GitHub , I got a bit confused about the number of participants created and needed by ROS 2.

Now it should be the case that there is 1 DDS participant per Context. However, the explanation of what Context currently is is a bit vague.

Is it the case that the simple single-node process creates exactly 1 participant?

How is it with component container? Does it have 1 participant for the whole container, or does it have one per loaded component?

How is it with the weird transform_listener_impl_* nodes automatically created by TransformListener? Do they “eat” a participant?

And last - I guess the 120 participant limit is per PC, right? This isn’t directly mentioned in the design doc, but I think it follows from the design…

To resolve our current problem, I’ll try switching to discovery server, but I’d like to have a clear view on the other mentioned questions.

Thanks for ideas!

1 Like

A context in this … erm… context is an rmw_context_t. These are plumbed all the way out to the client libraries. So an rclcpp::Context has an rcl_context_t which has an rmw_context_t.

Related: When you call rclcpp::init(), you initialize the “global default context”. Many APIs will use the global default context when you don’t specify a context as a convenience.

A single node process would create one context, which means 1 participant for the DDS based RMW implementations.

A component container creates 1 context, meaning it also has 1 participant for the whole container.

2 Likes

We have seen the exact behavior you are describing when using fastDDS (Nodes not being listed / services not being found etc). We simply switched to cyclone and it was gone.
This is our cyclone config, perhaps it’s useful to you :

RMW_IMPLEMENTATION: "rmw_cyclonedds_cpp"
CYCLONEDDS_URI: 
  <General>
    <AllowMulticast>true</AllowMulticast>
    <Interfaces><NetworkInterface name="lo"/></Interfaces>
  </General>
  <Discovery>
    <ParticipantIndex>auto</ParticipantIndex>
    <MaxAutoParticipantIndex>1000</MaxAutoParticipantIndex>
  </Discovery>

1 Like