Simulation setup for multi-drone surveillance using ROS 2 and the Gazebo simulator.
This project assumes the following ROS 2 workspace layout:
~/ros2_ws/
├── src/
│ └── Military_Drones/
├── build/
├── install/
└── log/
If you do not already have a workspace:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws
colcon build-
military_drones_description- URDF/SDF drone models and mesh files. -
military_drones_gazebo- Gazebo Sim plugins and world configurations. -
military_drones_application- Holds ros2 specific code and configurations. -
military_drones_bringup- Holds launch files and high level utilities.
| Component | Version |
|---|---|
| OS | Ubuntu 22.04 LTS |
| ROS 2 | Humble Hawksbill |
| Gazebo | Harmonic (8.10.0) |
| Python | 3.10.x |
Using other versions may require modifications.
cd ~/ros2_ws/src
git clone https://github.com/Manohara-Ai/Military_DronesAll commands below must be run from the workspace root:
cd ~/ros2_ws
source /opt/ros/humble/setup.bashInitialize rosdep (only once per system):
sudo rosdep init
rosdep updateInstall dependencies:
rosdep install --from-paths src --ignore-src -r -i -y --rosdistro humblesudo apt update
sudo apt install -y python3-colcon-common-extensionsROS 2 Humble does not default to Gazebo Harmonic.
Ensure Gazebo Harmonic is installed.
Export the version before building or launching:
export GZ_VERSION=harmonic(Optional) Add to your ~/.bashrc:
echo "export GZ_VERSION=harmonic" >> ~/.bashrccd ~/ros2_ws
source /opt/ros/humble/setup.bash
colcon buildIf build issues occur:
cd ~/ros2_ws
rm -rf build/ install/ log/
colcon buildEvery new terminal must run:
cd ~/ros2_ws
source /opt/ros/humble/setup.bash
source install/setup.bash(Optional) Add to ~/.bashrc:
echo -e "source /opt/ros/humble/setup.bash\nsource ~/ros2_ws/install/setup.bash" >> ~/.bashrcros2 launch military_drones_bringup military_drones.launch.pyros2 launch military_drones_bringup military_drones.launch.py rviz:=trueAfter modifying any package:
cd ~/ros2_ws
colcon build
source install/setup.bashGazebo may hang at:
Requesting world names
Possible causes:
- Stale build artifacts
- Plugin load timing issue
- Corrupted install space
Recommended fix:
cd ~/ros2_ws
rm -rf build/ install/ log/
colcon build
source install/setup.bashThen relaunch the simulation.
- Fork the repository
- Create a feature branch:
git checkout -b feature/AmazingFeature
- Commit changes:
git commit -m "Add AmazingFeature" - Push branch:
git push origin feature/AmazingFeature
- Open a Pull Request
Developed by Manohara & Vibhashree.