Skip to content
LSLab

How Does a Drone Use Its IMU, Barometer and GPS?

  • Basic
  • Article
  • Ages 14+
  • 6 min read
Editorial illustration of IMU, GPS and barometer in a drone system.

A drone does not measure “position” with one sensor. The IMU records motion of the body; a barometer measures air pressure; GPS provides position and velocity measurements. A state estimator combines measurements with different rates and errors into an estimate that the controller can use.

Contents
IMU, satellite navigation and barometer provide different measurement types; they do not fully replace one another.
  • IMU measuring motion
  • Satellite navigation
  • Barometer measuring pressure

Each measurement answers a different question

An IMU (inertial measurement unit) commonly includes a gyroscope and accelerometer. The gyroscope contributes changes in angle; the accelerometer contributes changes in velocity along the body axes. PX4 describes IMU input as delta-angle and delta-velocity data. The estimator accumulates these changes to predict attitude and velocity over short intervals. Because small errors accumulate, inertial prediction alone does not maintain an accurate absolute position indefinitely.

A barometer measures atmospheric pressure, and software uses pressure changes to estimate changes in height. It does not directly measure distance to the ground. Changes in ambient pressure can shift the height reference; airflow around the vehicle can also affect the measurement. “Barometric height” is therefore an observation source to compare with others, not a perfect absolute value.

PX4 supports GNSS receivers; in the EKF, global position is represented by latitude, longitude, and altitude. GPS/GNSS supplies position observations that can correct drift over time, but they can be noisy, obstructed, or delayed relative to IMU data. GPS also does not replace the IMU’s measurements of orientation and immediate motion.

How does the estimator combine measurements?

PX4 uses an EKF filter to process measurements and produce a state estimate. The filter first predicts state from IMU data, then compares the prediction with GPS, barometer, and other enabled height observations. The difference between prediction and measurement is called an innovation. If the difference is beyond configured consistency limits, the filter may reject that measurement instead of letting an unusual value pull the whole estimate away.

Consider a scenario: a drone is stationary in a simulator. The IMU continuously reports small angular and acceleration changes, and the filter updates predicted attitude and velocity. The barometer contributes a height trend, while GPS periodically reports geographic position. If GPS suddenly jumps far away while the IMU shows no corresponding motion, that observation conflicts with the prediction; the estimator can identify inconsistent GPS data and avoid using it immediately. When GPS becomes consistent again, newer observations can help correct the position estimate.

This is sensor fusion: each measurement contributes information within its limits. The software estimates the drone’s position; GPS does not provide error-free truth. PX4 documentation describes EKF outputs such as attitude, velocity, and position, and describes checking consistency between measurements.

Why use several sources, and where are the limits?

The IMU updates quickly but accumulates error; GPS provides global positioning but can be interrupted or noisy; the barometer provides a height signal but depends on pressure. Combining them lets one source compensate for some weaknesses of another. Fusion is useful only when sensors are configured correctly, measurement timing is suitable, and data are reliable. A faulty or mistimed source can make the estimate worse rather than better.

PX4 needs a minimum set of observations for a given estimator configuration; having GPS does not mean every mode or environment is supported. PX4 sensor documentation says GPS or another positioning system is needed for certain automatic modes, while EKF can use height sources such as GPS, barometer, range finder, or vision according to configuration. This describes specific software configuration, not a universal rule for every controller.

A common log-reading mistake

Hypothetical illustration, not an observed test result.

In a simulated log, the GPS trace jumps while the IMU velocity trace stays nearly unchanged. Do not conclude that the drone actually moved. Inspect the innovation, GPS check flags, and estimator state to see which measurement is suspect. If barometer and IMU data also diverge, inspect vibration, calibration, and the height reference. The goal is to identify the observation boundary: what the sensor measured, what the filter accepted, and which estimate it published.

Frequently asked questions

Does GPS directly measure drone height?

It can provide a height observation, but PX4 may use another height source such as a barometer or range finder. The result depends on estimator configuration.

Why is barometric height not a stable absolute value?

The barometer measures pressure; software infers height change from that measurement. Environmental changes and sensor characteristics can shift the reference.

Why not trust whichever sensor seems most accurate?

Each observation has different limits. The estimator compares them and can reject an inconsistent measurement instead of blindly trusting one source.

Summary

  • The IMU predicts short-term motion; the barometer contributes a height trend; GPS supports position.
  • The estimator combines predictions with observations and checks consistency.
  • Position is a conditional estimate, not an error-free reading from one sensor.

Terms in this article

English and Vietnamese terms, with the meanings used here. Hover, tap or Tab to a term with a dotted underline for an explanation as you read.

IMU
An inertial measurement unit with sensors that record vehicle-body motion.
state estimatorbộ ước lượng trạng thái
Software that combines sensor measurements to infer attitude, velocity, and position.
sensor fusionhợp nhất cảm biến
Using multiple measurements to form a shared state estimate.
innovationphần dư (innovation)
The difference between a filter prediction and the measurement it evaluates.

This article is not marked as viewed

Spotted something wrong or unsafe?

Tell the administrator by email. The message already has the article title and address.

Report this article
See all articles of the topic

Sources

These sources are written for older readers. If they feel hard, read them with an adult.