Slow startup of multiple PX4 SITL instances with Micro XRCE-DDS Agent (multi-drone setup)

I am working with PX4 in SITL and Micro XRCE-DDS Agent to simulate multiple drones simultaneously in Gazebo. The procedure is straightforward: I start the agent on port 8888 and, in separate terminals, I launch each PX4 instance with its own identifier (-i 1, -i 2, etc.) but using the same PX4_SYS_AUTOSTART=4001 since all drones are standard multicopters.

What I observe is the following: the first drone starts up fairly quickly, and in the agent’s terminal I immediately see the client creation and session establishment. After that, there is a flood of messages about topic, publisher, and subscriber creation, which I understand corresponds to the full uORB ↔ DDS mapping that PX4 enables by default. The issue appears when I launch the second drone: while the first one is still busy creating DDS entities, the second one takes a long time to establish its session. Sometimes this delay can be tens of seconds, and by the time all drones are running, the full startup process can take up to 20 minutes.

I have verified that this is not caused by external network blocking: the agent is running on localhost, port 8888 is open, and I have tested both UDP and TCP. I also avoid running PX4 with sudo to prevent permission issues with sockets under /tmp. In the logs, I see the MAVLink message saying it only broadcasts on localhost, but I believe this should not affect XRCE.

From what I can deduce, the bottleneck lies in the massive creation of DDS entities by PX4: while one instance is in that process, the others remain waiting before they can establish their connection. What I would like to know is whether this behavior is normal in multi-drone scenarios and, more importantly, if there is a way to reduce these startup times — for example, by limiting the published topics, using minimal XRCE profiles, or configuring entity creation differently so that new clients are not blocked.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.