Gazebo Drone | Advanced ArduPilot SITL Simulation
If you don’t know already, SITL drones are a very powerful tool in the drone development space. Basically they are simulated drones that run right on your computer.
A basic SITL instance can be spun up in both ArduPilot and PX4, and provide robust testing capabilities right out of the box.
However, some drone applications need a more advanced form of drone simulation. One downfall of the vanilla SITL instance offered by the popular open source projects is they don’t offer visualization of the drone, and it can be difficult to simulate sensors like cameras.
Enter the Gazebo simulator, which takes a SITL instance and wraps it in their advanced DARPA funded project. Thanks to the work of ArduPilot developers, ArduPilot can now be tested in Gazebo.
Gazebo SITL Capabilities
The first obvious feature of gazebo simulation is the visualization. In the conventional SITL instances, the only visualization is on a ground control map. Here, we can actually see how the drone behaves due to the Gazebo physics generator.
Secondly, Gazebo can emulate popular sensors in its simulated world. For example, a camera feed. This camera feed can then be accessed with in openCV applications, right on your computer.
That’s right.
Computer vision testing right on your computer. That is what we did in our taco delivery mission, where we needed the drone to precision land on an aruco marker array.
We first wrote the code and proved it out in the simulated world. This allowed us to RAPIDLY debug the openCV taco delivery script. I honestly estimate the time to complete this project would have been 100x if the openCV drone testing had to be done exclusively on the actual drone.
Once the script was working on the Gazebo drone, it was ported over to the actual drone and get this.. it worked!
Watch this video to see the Gazebo precision landing, followed by the actual drone performing the same script.
And we are just scratching the surface of Gazebo testing capabilities.
Final Thoughts
If you want to learn more about the drone programming that is the foundation to this more advanced testing, check out this post.