ROS (Robot Operating System) can be used with Ardupilot and the Gazebo simulator. It uses the MAVROS MAVLink node to communicate with Ardupilot.
The ROS/Gazebo integration with Ardupilot follows the pattern in the generic Ardupilot simulation environment. Ardupilot communicates with the simulator (e.g. Gazebo) to receive sensor data from the simulated world and send motor and actuator values. It communicates with the GCS and an Offboard API (e.g. ROS) to send telemetry from the simulated environment and receive commands.
![](https://s2.save4k.ru/pic/8DAmQF_gQn4/mqdefault.jpg)