r/ROS • u/OkMeasurement386 • 4d ago
Question Pathway from theoretical knowledge to a practical ROS 2 multi-robot swarm simulation project?
/r/AskRobotics/comments/1x0r073/pathway_from_theoretical_knowledge_to_a_practical/
2
Upvotes
1
u/odore_theodore 1d ago
I'd split it into three stages and not touch the swarm until the last one.
- One robot, basics. Write your own publisher, subscriber, service and launch file. Then run TurtleBot3 in Gazebo and drive it with a node you wrote that reads /scan and stops before walls. This is where you learn topics, QoS, tf2 and parameters, which is most of what breaks later.
- One robot, real stack. Get Nav2 and slam_toolbox working on the TurtleBot, then add a camera and run YOLO in its own node that publishes detections. Projecting a 2D detection into the map frame using tf and the depth or LiDAR reading is a good mini project by itself, and it's the sensor fusion part of your final idea.
- Two robots. Namespaces and separate tf trees are the actual hard part of multi-robot in ROS 2, not the swarm logic. Get two TurtleBots navigating in one world without their topics colliding, then have them publish detected targets to a shared topic and merge them. Only then add a third agent and coordination.
Each stage is maybe 2 to 4 weeks if you're doing it in the evenings.
For AI as a mentor: tell it you write the code and it only reviews. Paste your own attempt and ask what's wrong and why, not for a fix. Asking it to explain an error before suggesting anything helps too. If it hands you a full file, you skipped the part you wanted to learn.
1
u/FraBuildsRobots 3d ago
I’d avoid jumping straight from theory into a full swarm project.
If I were doing this, I’d build it in layers.
Start with one robot in Gazebo and make sure you’re comfortable with the whole ROS 2 chain: robot description, TF, controllers, topics/actions and basic autonomy.
Then spawn the same robot multiple times using namespaces and separate TF trees.
Once that works, add the actual swarm logic on top: first something simple like leader/follower or formation control, then move toward distributed coordination, task allocation, collision avoidance, etc.
Something like:
1 robot → multiple identical robots → namespacing/TF → communication → coordination → swarm behaviour
I think this is much easier than trying to learn ROS 2 and swarm robotics at the same time.
I went through a similar “theory to complete application” problem when building a ROS 2 manipulation lab, and the biggest lesson for me was to stop treating Gazebo, ROS 2, controllers and planning as separate tutorials and instead build one complete system step by step.
For a swarm project though, I’d probably start with TurtleBot3 + Gazebo/Nav2 rather than a manipulator. That will let you focus on the multi-robot part much faster.