← udacity portfolio
robotics nd · robotics ros · August 2019

Swarm Robotics Project

Multi-robot coordination in ROS — N TurtleBots converging to a formation pattern via decentralized reactive control.

What it did

Spawn N TurtleBots in a shared Gazebo world; each runs an identical decentralized controller that reads (a) its own pose, (b) nearest neighbors’ poses (via a shared TF tree), and (c) obstacle proximities from its own laser. Converge the swarm into a target formation (line, circle, V-shape) without any central coordinator.

The approach

Each robot computes a velocity command as a weighted sum of three “force” vectors:

A small saturation step clamps the resultant to the TurtleBot’s max linear + angular velocity. The whole control loop is ~30 LOC of Python.

What was actually tricky

What I’d do differently with hindsight

What it taught me

Decentralized control is appealing in theory and very hard in practice. The local rules are simple; the emergent behavior is what needs proofs. For a class project, “looks roughly right in Gazebo” is the bar; for anything real, you want theory backing the parameters you tuned.


Source archive: Shivam-Bhardwaj/swarm_robotics_project (archived)
Writeup last touched: 2026-05-22