Installation Guide
Installation process for simulation and execution in ROS and Gazebo

Developed by William Chamorro PhD. for the GI-ATA research group
ArduCopter and ArduPilot are two open-source projects for controlling autonomous vehicles. ArduPilot is the main project, encompassing a wide range of vehicles including planes, helicopters, rovers (land vehicles), and boats. ArduCopter, on the other hand, is a specific part of ArduPilot dedicated to controlling drones or multirotor aircraft such as quadcopters and hexacopters.
Both projects, ArduCopter and ArduPilot, offer open-source software and hardware that enables enthusiasts and developers to create and control their own autonomous vehicles. They provide navigation functions, flight control, mission planning, among others, allowing for extensive customization and adaptation to different types of vehicles and specific needs.
The following sections show what tested open source nodes to install in order to have a successful Arducopter - ROS integration
Installation of QGroundControl

QGroundControl is a ground control station software used to control and monitor unmanned vehicles, particularly drones and autonomous vehicles. It's an open-source application that provides a user-friendly interface for configuring vehicles, planning missions, monitoring telemetry data (like altitude, speed, and battery status), and controlling the vehicle during flight.
QGroundControl supports various types of vehicles and is compatible with different autopilot systems, including ArduPilot and PX4, offering a comprehensive set of tools for mission planning, flight control, and vehicle setup. It's a critical component in the operation of unmanned systems, allowing users to interact with and manage their vehicles efficiently and safely from the ground. Te following summarize how to install this app.
Create a folder and download QGroundControl
mkdir QGround && cd QGround
sudo usermod -a -G dialout $USER
sudo apt-get remove modemmanager
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/latest/QGroundControl.AppImage

Change permissions and execute for testing
chmod +x ./QGroundControl.AppImage
./QGroundControl.AppImage

Installing Gazebo and ArduPilot Plugin
Robot simulation is an essential tool in every roboticist's toolbox. A well-designed simulator makes it possible to rapidly test algorithms, design robots, perform regression testing, and train AI system using realistic scenarios. Gazebo offers the ability to accurately and efficiently simulate populations of robots in complex indoor and outdoor environments.
This plugin was aimed for Gazebo 11
Gazebo 11 installation
This section is intended in case we do not have installed Gazebo 11. Recall that Gazebo installs along ROS noetic in the desktop-full version.
Update packages before installing
sudo apt-get update
sudo apt-get upgrade
Setup your computer to accept software
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
Setup keys
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
Reload software list
sudo apt update
Install Gazebo
sudo apt-get install gazebo11 libgazebo11-dev
Gazebo plugin installation
Update packages before installing
sudo apt-get update
sudo apt-get upgrade
Download the APM plugin
cd ~
git clone https://github.com/khancyr/ardupilot_gazebo.git
Compile the package
cd ardupilot_gazebo
mkdir build
cd build
cmake ..
make -j4
sudo make install
Set up bashrc
echo 'source /usr/share/gazebo/setup.sh' >> ~/.bashrc
echo 'export GAZEBO_MODEL_PATH=~/ardupilot_gazebo/models' >> ~/.bashrc
. ~/.bashrc
If everything was done correctly we will be able to launch the plugin but it will not fly yet.
Terminal 1 type,
gazebo --verbose ~/ardupilot_gazebo/worlds/iris_arducopter_runway.world

Install Ardupilot and MAVProxy Ubuntu
MAVProxy stands for "MAVlink Proxy." It's a versatile command-line ground control station (GCS) used primarily with ArduPilot, which is a popular open-source autopilot software. MAVProxy acts as an intermediary communication system between the ground control station and the vehicle's autopilot, allowing users to interact with the vehicle using a command-line interface.
Clone ArduPilot
cd ~
sudo apt install git
git clone https://github.com/ArduPilot/ardupilot.git
cd ardupilot
Install dependencies
sudo apt-get update –y
sudo apt-get install -y python3-testresources
cd ardupilot
Tools/environment_install/install-prereqs-ubuntu.sh -y
If all dependencies were successfully installed you will see the following message.

Reload the profile
. ~/.profile
Checkout for the most stable version
git checkout Copter-4.0.4
git submodule update --init --recursive
If git submodule update fails
git config --global url.https://.insteadOf git://
Test installed dependencies
cd ~/ardupilot/ArduCopter
sim_vehicle.py -w

Install MAVROS
MAVROS stands for "MAVLink Robot Operating System." It's a middleware that acts as a bridge between MAVLink based autopilots, like the ones used in ArduPilot or PX4, and the Robot Operating System (ROS).
Install extras
sudo apt-get install ros-noetic-mavros ros-noetic-mavros-extras
Then install GeographicLib datasets
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
./install_geographiclib_datasets.sh
Install the ros node
Install python catkin tools
sudo apt-get install python-catkin-tools python-rosinstall-generator -y
Create the workspace
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin init
wstool init src
Install MAVROS
rosinstall_generator --rosdistro kinetic mavlink | tee /tmp/mavros.rosinstall
wstool merge -t src /tmp/mavros.rosinstall
wstool update -t src -j4
rosdep install --from-paths src --ignore-src -y
Install Geographic lib datasets
./src/mavros/mavros/scripts/install_geographiclib_datasets.sh
Clone simulation packages
cd ~/catkin_ws/src
git clone https://github.com/Intelligent-Quads/iq_sim.git
echo "GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:$HOME/catkin_ws/src/iq_sim/models" >> ~/.bashrc
Compile all packages
catkin build
Update global variables
source ~/.bashrc
If all packages were successfully compiled you will see this

prueba
roslaunch iq_sim runway.launch
/ardupilot/ArduCopter$ sim_vehicle.py -v ArduCopter -f gazebo-iris --console
Last updated