Learning the ArduPilot Codebase¶
The ArduPilot code base is quite large (about 700k lines for the core ardupilot git tree) and can be quite intimidating to a new user. This page is meant to give some suggestions on how to come up to speed on the code quickly. It assumes you already are familiar with the key concepts of C++ and the many of the examples currently assume you will be exploring the code on a Linux system.
This page and the pages linked below are designed to be used as a tutorial. You should work through each page step by step, trying things for yourself as you go. If you think some important information is missing or could be improved then please open an issue for the wiki and we will try to get to it when we can.
Tutorial steps¶
- Introduction
- Library Description
- Library Example Sketches
- Sensor Drivers
- Threading
- UARTs and the Console
- RC Input and Output
- Storage and EEPROM management
- Filesystems
- EKF
- Copter - Vehicle Code introduction
- Copter - Attitude Control
- Copter - Adding Parameters
- Copter - Adding a new flight mode
- Copter - Scheduling your new code to run intermittently
- Copter - Motors Library
- Copter - PosControl and Navigation
- Copter - Object Avoidance
- Copter - Adding Custom Attitude Controller
- Rover - Adding a new drive mode
- Rover - L1 navigation controller
- Plane - Architecture overview
- Adding a new Log message
- Adding a new MAVLink message
- Adding a new MAVLink Gimbal
Note
There are currently five vehicles in ArduPilot (Copter, Plane, Rover, Sub, and Antenna Tracker) and while there are a lot of common elements between different vehicle types, they are each different. For now we only have a detailed description of the code structure for the Copter code.
Other Tutorials¶
Although not strictly part of ArduPilot this tutorial may also be useful