Skip to the content
FixTheRobot Explore Robotics / UAV / Module 6 / M6-T2

UAV Systems Engineering · Module 6

M6-T2: Introduction to ArduPilot

ArduPilot and PX4 are both capable open-source autopilots. Choose on fit, licence and interface, and prototype in simulation first.

  • Lesson 2 of 16
  • UAV Software and Flight-Controller Integration
  • Implementation-specific
  • About 5 minutes to read

This course uses PX4 for its examples, but ArduPilot is equally widely deployed, and you will meet it in industry. The right question is rarely “which is better”; it is “which fits this vehicle, this team and this licence constraint”. The ideas in this module transfer directly: estimators, controllers, MAVLink, offboard control and logs exist in both.

Learning objectives

After this lesson, you should be able to:

  • Describe ArduPilot’s structure (vehicle code, libraries, HAL) and its vehicle types.
  • Compare ArduPilot and PX4 on licence, architecture, interfaces and tooling.
  • Map concepts between the two (modes, parameters, logs, companion links).
  • Choose between them with a documented, testable rationale.

Conceptual explanation

Implementation-specific Both projects change often and each has strengths in different areas. Statements here are general and based on the public documentation at the time of writing; check the current documentation of both projects before deciding. No performance ranking is claimed.

ArduPilot is an open-source autopilot with separate vehicle codebases (ArduCopter, ArduPlane, Rover, ArduSub, Blimp, Antenna Tracker) built on shared libraries and a hardware abstraction layer (AP_HAL) supporting several operating-system back ends (ChibiOS on most flight controllers, and Linux and others). It is licensed under the GPLv3, whereas PX4 uses a permissive BSD 3-clause licence. The licence matters if you plan to ship modified firmware in a closed product.

Differences that commonly matter in a project:

undefined
AspectArduPilotPX4
LicenceGPLv3 (copyleft)BSD 3-clause (permissive)
StructurePer-vehicle code on shared libraries and AP_HALModular stack, uORB bus, modules per function
Companion interfaceMAVLink; DDS interface available in recent versions; MAVROS widely usedMAVLink; uXRCE-DDS native ROS 2 bridge; MAVROS also used
ScriptingLua scripting on the flight controllerNo equivalent embedded scripting layer in the main stack (check current docs)
Ground stationMission Planner, QGroundControl, MAVProxyQGroundControl
ConfigurationParameters, many mode and failsafe optionsParameters, structured airframe configuration
Choosing an autopilotThe choice follows from the vehicle type, the licence and ecosystem constraints, the companion interface needed and the team’s experience, and should be confirmed with a short simulation prototype.Vehicle typesmultirotor, plane, roverLicenceGPLv3 vs BSDInterfacesMAVLink, DDS, ROSEcosystemhardware, toolsPrototypeSITL trialBoth are mature. The decision is about fit, not about which is “better”.
A decision flow. Finish with a prototype, not an opinion.
Animation of a sensitivity analysis of a weighted decision matrix for choosing an autopilot, using placeholder scores. Two bars show the weighted scores of two options. As the weights are perturbed randomly by up to 20 percent over and over, a running tally shows in what fraction of the trials each option wins, converging to a stable fraction, so the viewer sees whether the ranking is robust or marginal.
Compare options with explicit criteria, weights and evidence, then test the sensitivity: if small changes of the weights flip the winner, the decision is marginal and a prototype in simulation should decide. The scores here are PLACEHOLDERS to show the mechanics, not a statement about either autopilot. (Looping, about 6 seconds; drawn and computed for this course with illustrative values.)

Engineering intuition

The two projects arrived at similar solutions to the same problems: an EKF estimator, a cascaded controller, MAVLink, modes and failsafes. The practical differences are in the surroundings: licensing, the way the code is organised, how you script or extend it, and which hardware and tools your supplier supports. A team that has strong experience with one will be more effective with it than the ideal choice on paper.

For an autonomy project the stronger question is the interface to your software. Check, for the specific versions you will use, how setpoints are sent, how external position is fed in, what timestamps are expected and how failsafes behave when the companion goes silent. The details differ, and the safe integration depends on them.

Mathematical formulation

No new mathematics: both use the same estimation and control theory. A useful quantitative step is a decision matrix with weighted criteria, which makes the rationale explicit and reviewable:

Weighted decision matrix
score(option)=∑iwi si(option),∑iwi=1,si∈[0,5]\text{score}(\text{option}) = \sum_i w_i\,s_i(\text{option}), \qquad \sum_i w_i = 1, \qquad s_i \in [0, 5]

The weights wiw_{i} encode project priorities (licence constraints can be a hard gate rather than a weighted criterion), and each score sis_{i} should cite evidence: a documentation page, a simulation result or a test. A sensitivity check, varying each weight by ±20 %, shows whether the ranking is robust or an artefact of one assumption.

Architecture and data flow

The companion-computer data flow is the same shape for both: sensors → autopilot estimator → state out (MAVLink or DDS) → companion perception and planning → setpoints in (MAVLink or DDS) → autopilot controller. The differences are the message sets and conventions: for example the frame (ENU in ROS, NED in the autopilot) conversions, the message that carries external odometry, and the mode in which external setpoints are accepted (PX4 offboard; ArduPilot guided). Document these in the interface control document.

Real-world UAV applications

  • Selecting an autopilot for a new platform and recording the decision.
  • Porting a companion-computer application between the two.
  • Using ArduPilot’s Lua scripting for small on-board behaviours.
  • Comparing the two in SITL on the same mission as a sanity check.

Implementation example

A decision matrix as a small script so the weights and scores are versioned with the project. The numbers below are placeholders to show the mechanics, not a statement about either autopilot: fill in your own evidence.

import numpy as np
criteria = ['licence fits product', 'vehicle type supported', 'companion interface fit', 'team experience', 'supplier hardware support', 'tooling for tests']
w = np.array([0.25, 0.20, 0.20, 0.15, 0.10, 0.10])            # project priorities (sum to 1)
scores = {'option A': np.array([5, 4, 4, 3, 4, 4]), 'option B': np.array([3, 4, 5, 4, 4, 4])}   # PLACEHOLDERS: replace with evidence-based scores
for name, s in scores.items(): print(name, round(float(w @ s), 2))
rng = np.random.default_rng(0); wins = {k: 0 for k in scores}
for _ in range(2000):                                         # sensitivity: perturb weights by up to +-20 %
    wp = w * (1 + rng.uniform(-0.2, 0.2, w.size)); wp /= wp.sum()
    best = max(scores, key=lambda k: wp @ scores[k]); wins[best] += 1
print('ranking stability:', {k: v / 2000 for k, v in wins.items()})
assert abs(w.sum() - 1) < 1e-12
A weighted decision matrix with a sensitivity check. The scores are placeholders to be replaced with cited evidence.

Common engineering mistakes

Choosing from reputation

Decide from documented requirements and a prototype.

Ignoring the licence

A copyleft or permissive licence has product consequences: decide early with legal advice.

Assuming equivalent behaviour

Mode names, failsafe defaults and parameters differ; test the behaviour you rely on.

Mixing documentation

Parameter names from one project do not exist in the other.

No exit plan

Keep the autonomy software behind a thin interface so the autopilot can change.

Failure modes

Failure modes, symptoms and causes
Failure modeHow it shows upLikely cause
Porting surprisesBehaviour differs after switching autopilotFrame, timestamp or mode-semantic differences not tested
Unsupported hardwareBoard not supported by the chosen firmwareSupplier support not checked before purchase
Licence conflict found lateProduct plan blockedLicence not considered at selection
Wrong version documentationInstructions do not workDocs for a different release

Debugging approach

  1. Reproduce the same mission in SITL on both before deciding.
  2. Diff the parameter sets and failsafe behaviours for the same scenario.
  3. Check the exact firmware version against the documentation version.
  4. Keep a mapping table of concepts and parameter names for your project.

Practical exercises

  1. Make a decision matrix for a hypothetical inspection quadrotor with a ROS 2 companion, citing the documentation for each score.
  2. List the failsafe behaviours of both for loss of the companion link and compare them (read both documents).
  3. Write the interface description for external odometry for each autopilot.
  4. Identify the licence obligations for shipping a modified firmware under each.

Interview questions

Write an answer in your own words, then reveal the model answer. Nothing is sent anywhere.

Question 1

How would you choose between PX4 and ArduPilot?

Model answer

From requirements: vehicle type, licence constraints, companion interface, hardware and team experience, then confirm with a short SITL prototype of the actual mission. No blanket ranking.

Question 2

What licence difference matters most?

Model answer

ArduPilot is GPLv3 (copyleft) and PX4 is BSD 3-clause (permissive); distributing modified firmware in a closed product has different obligations under each, so it should be settled early with legal advice.

Question 3

What concepts transfer between them?

Model answer

EKF-based estimation, cascaded control, MAVLink, flight modes and failsafes, logging and external setpoints: names and parameters differ but the architecture and the debugging approach are the same.

References and further reading

Primary papers, official documentation and standards. Each claim above that is specific to a tool or version points here.

What’s next

Mark this lesson

Saved in this browser and synced to your account when you are signed in.

Next lesson

M6-T3: PX4 architecture

Describe the layers of the PX4 flight stack (drivers, estimators, controllers, commander) and the middleware that connects them.