A PyBullet-based simulation environment for Robile platform with multi-robot formation using PID based controller.
multi-robot-sim.mp4
https://github.com/user-attachments/assets/effdfa27-35e3-4c4b-8e42-0b26bda19312

It provides a complete simulation framework for Robile robotic platforms using the PyBullet physics engine with unit testcases and Github CI/CD setup. This package allows for the simulation of individual Robile robots as well as multiple robots in formation configurations such as a leader - follower pattern (V-formation).
The package is designed to be used within a ROS 2 workspace and serves as a lightweight alternative to Gazebo for testing multi robot control algorithms.
- Single Robot Simulation: Control and simulate individual Robile robots in a PyBullet environment
- Multi-Robot Formation Control: Simulate leader-follower formations with multiple Robile robots
- Omnidirectional Movement: Control robots with omnidirectional motion capabilities
- Realistic Physics: Integration with PyBullet's physics engine for realistic simulation
- ROS 2 Integration: Designed to work within a ROS 2 ecosystem
As detailed in the repository's commit history, I was responsible for architecting the core physics, kinematics, and multi-robot control algorithms:
-
Multi-Robot Formation Control: Designed and implemented the multi-robot simulation logic, including the
MultiRobileControllerandSimpleDistanceController. Developed the proportional (PID) control algorithms to maintain strict leader-follower configurations (e.g., V-formations). -
Kinematics & Movement: Engineered the differential drive movement logic to process commanded velocities (
$v_x$ ,$v_y$ ,$\omega$ ). - Physics & Environment Configuration: Configured PyBullet physics parameters to bridge the sim-to-real gap, including gravity modeling and realistic friction constraints for the robot chassis and wheels.
- Dynamic Spawning: Built the architecture allowing for the dynamic spawning of multiple individual robot entities within the simulated space.
This framework was built as a joint academic effort. While I focused on the physics, multi-robot coordination, and PID control architecture, CI/CD setup for multi robot usecase my co-contributor (Sunesh Praveen Raja Sundarasami) implemented the ROS 2 layers, including the odometry transforms, laser scan data publishing, command velocity subscribers & unit test cases and other co-contributor (Linta Maria Joy) for initial CI/CD setup for single robot usecase . Please refer to the commit history for full individual attribution.
- ROS 2 (tested on Humble)
- Python 3.6+
- PyBullet
-
Clone this repository into your ROS 2 workspace:
cd ~/ros2_ws/src git clone git@github.com:saiga006/Multi-Robot-Sim-Formation-Control.git
-
Install the required dependencies:
pip install pybullet numpy
-
Build the package:
cd ~/ros2_ws colcon build --packages-select robile_pybullet
-
Source the workspace:
source ~/ros2_ws/install/setup.bash
To run a basic simulation with a single Robile robot:
ros2 run robile_pybullet robile_simTo run a simulation with multiple Robile robots in a formation:
python3 ~/ros2_ws/src/robile_pybullet/robile_pybullet/multi_robot_sim.pyThis will start a simulation with one leader robot and four follower robots in a V-formation.
The MultiRobileController class handles the coordination of multiple Robile robots in formation. It provides methods for:
- Initializing robots in formation
- Controlling robot movement
- Maintaining formation using PID control
- Computing appropriate steering angles and wheel velocities
The SimpleDistanceController implements a PID controller for maintaining positions in formation.
Formations are defined as relative positions to a leader robot. For example, a V-formation is configured as:
formation_config = [
(-1.0, -1.0), # First follower position
(-1.0, 1.0), # Second follower position
(-2.0, -2.0), # Third follower position
(-2.0, 2.0), # Fourth follower position
]The robots can be controlled with three parameters:
vx: Velocity in the x-direction (forward/backward)vy: Velocity in the y-direction (left/right)omega: Angular velocity for rotation
Example:
controller.move_omnidirectional(0.5, 0, 0, robot_id) # Move forward
controller.move_omnidirectional(0, 0.5, 0, robot_id) # Move sideways
controller.move_omnidirectional(0, 0, 0.5, robot_id) # Rotate in place- multi_robot_sim.py: Implementation of multi-robot formation control
robile_sim.py: Single robot simulation interfacerobot_controller.py: Base robot controller implementationlaser_scanner.py: Simulated laser scanner for the robotstest_movement.py,test_movement_2.py: Example movement test scripts- robile.urdf, robile3_config.urdf: URDF model files for the Robile robot
This package contains components with various licenses:
- The Robile URDF models are provided under a dual-license: GNU Lesser General Public License LGPL 2.1 and BSD license
- The included PyBullet object models are under the LGPL 2.1 license
For more details, see the license information in the respective files.