We want to demonstrate a decentralized algorithm for a team of mobile robots (~ 10 robots). We have WiFi adapters on each robot. It is not clear how we can do peer-to-peer communication between robots. We do not want to have a centralized router for communication. How can such a system be implemented? I couldn't find anything in the ROS2 documentation. The fast-DDS discovery server was the best I could find. But it seems we would need a centralized server for this as well. Maybe each robot acts as a discovery server.


  1. Mobile robots are moving in the environment. So, there will be a loss of communication and a change in the network topology.
  2. One possible solution we were considering was that each robot alternately broadcasts its message and receives a broadcast message. I am not sure if this is the best solution and how to implement it in ROS2.

P.S.: I understand that this might be a vague question at the moment. I will improve it as I get more concrete information.


1 Answer 1


ROS2 is inherently decentralized as it uses DDS. So as long as the controller hostnames are known to eachother (via a private network/VPN or some other goofy networking if not on the same router), these controllers are all seen as being in the same ROS2 ecosystem when configured correctly and can publish/subscribe to topics.

I did this with ROS1 using husarnet VPN because it's lightweight and pretty much plug and play (and it has good documentation with ROS). Good luck!

  • $\begingroup$ Thanks. Husarnet seems to have a solution for ROS2 as well. The robots do not have a centralized router. So, I guess we will need some "other goofy networking". But that's what I am trying to figure out. $\endgroup$
    – Marvin
    Commented Oct 8, 2023 at 22:21
  • $\begingroup$ Do all robots have access to the internet? If so, husarnet will be your solution. Little additional networking required. It creates a virtual network that would pretty much act as if the controller's were on the same central router (hostnames and IP's will be discoverable to eachother) $\endgroup$
    – Chase
    Commented Oct 10, 2023 at 4:11
  • $\begingroup$ We can have internet access during setup. However, in practice, we do not want to have internet access, as it would no longer be a decentralized system. $\endgroup$
    – Marvin
    Commented Oct 10, 2023 at 17:44
  • $\begingroup$ Interesting what is going to be the communication medium then? $\endgroup$
    – Chase
    Commented Oct 12, 2023 at 3:12
  • $\begingroup$ Each robot has a WiFi adapter. They should be able to communicate with each other directly without needing something else, isn't it? Don't know how, especially when we have moving robots. $\endgroup$
    – Marvin
    Commented Oct 12, 2023 at 22:57

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.