Introduction

This section explains how to use ROS/Gazebo simulator as the external simulator for ArduCopter. The main characteristics of the simulation are:

  • Simulation stability and deterministic UAV response (step lock mechanism)
  • Simplified ROS/Gazebo simulation launch, fully configurable through arguments to the well-used SITL launch script, sim_vehicle.sh
  • Integration of the GPS sensor provided by Hector's plugin
  • Georeferenced overlay map image on MavProxy, to better assess the UAV position relative to its simulated environment

In order to begin it is required to arm. Some of the available features provided are:

  • Inertial measurement unit (IMU) which provides linear acceleration, angular velocity, atmospheric pressure and altitude
  • Compass which provides heading
  • GPS which provides longitude, latitude and altitude
  • Erle-Copter is equipped with 2 cameras, one front and one bottom, 2 sonar sensors, one front and one button and it's also possible to include a laser 2D or depth cameras.
  • It allows joystick manipulation

These applications publish data in the related ROS topics. It is compatible with ROS Indigo, which is the long time support (LTS) ROS version. This simulation includes the MAVROS (Micro Air Vehicle ROS) package. This package provides a communication driver for various autopilots with MAVLink communication protocol. In addition, it provides UDP MAVLink bridge for the ground control station. Using this protocol ROS can send specific commands to the UAV, which is essentially what this simulator is specialised for. Navigation commands can be sent directly to the flight controller produced by a robotics algorithm via MAVROS.

The step lock mechanism enforces a pause of the Gazebo simulation until it receives the next motor command from Ardupilot. It then steps forward the simulation by 2.5 ms (for the 400 Hz update rate) and sends back new sensor measurements to Ardupilot. Unlike many controller simulations on Gazebo, Ardupilot is the master of the simulation clock.

Many thanks to Alex Buyval for creating the initial Arducopter simulation on Gazebo. Also many thanks to Aurélien Roy and Maxime Lafleur to continue his work. and finally to the whole Ardupilot community!