A ROS package for multiple UAVs Simulation in Gazebo simulator.
- Provide 3D simulation using Gazebo, ROS, MAVROS and PX4 firmware;
- Include a ROS Node to control each UAV use simple MAVROS commands;
- Include a ROS Node to control multiple UAVs in formation;
- The UAV model was set up with a camera;
- It is possible to visualize the UAV camera in RVIZ;
Following the steps above you are able to perform a simple setup of a Multi UAV simulation.
This tutorial install on Ubuntu 20.04, the ROS Noetic version and current multi_uav package version.
Run on terminal:
mkdir -p ~/drone_simulator_ws/srcRun on terminal:
cd ~/drone_simulator_ws/src
git clone https://github.com/maikbasso/multi_uav.git multi_uav
sh ~/drone_simulator_ws/src/multi_uav/scripts/install/install.shIn the installation, the script can request your Linux user password and other user inputs.
Run on terminal:
source ~/drone_simulator_ws/src/multi_uav/scripts/init/init_ws.sh
roslaunch multi_uav multi_uav.launchOptional parameters:
- worldName: the name of the world in worlds folder;
- modelType: xacro or sdf;
- vehicle: iris, iris_fpv_camera, iris_depth_camera, solo, solo_fpv_camera, solo_depth_camera (only if using sdf model type);
- numberUAVs: the number of drones (0 to N drones). N increases until your PC supports;
Example:
roslaunch multi_uav multi_uav.launch vehicle:=solo modelType:=sdf numberUAVs:=5 worldName:=emptyWith the simulation running, run in a new terminal:
source ~/drone_simulator_ws/src/multi_uav/scripts/init/init_ws.shThen, run a example:
roslaunch multi_uav offboard_local_control.launch
or
roslaunch multi_uav offboard_global_control.launch- Run on terminal:
sh ~/drone_simulator_ws/src/multi_uav/scripts/run/run_qgroundcontrol.sh- Click on QGroundControl Icon;
- Click on "Comm Links";
- Click in Add;
- Insert all informations following the image bellow:
- Click on OK;
- A connection link appears on "Comm Links" tab, as in the image below:
- Close and open a ground station again. If a simulation is running the ground station connects automatically in each UAV.
Firstly, you need to increase the virtual memory:
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfileNow, install the additional ros packages:
sudo apt install ros-<version>-gazebo-*Then, compile the project:
cd catkin_ws
catkin_makeFirst remove the following packages:
sudo apt remove libgstreamer1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly -yThen, install the packages again:
sudo apt install libgstreamer1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly -y
