Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
PX4 + ROS 2 Offboard Control in Gazebo, Measured
New

PX4 + ROS 2 Offboard Control in Gazebo, Measured

Fly a simulated PX4 drone from ROS 2 code: heartbeat, setpoints, a square, a failsafe, and measured tracking error.
Last updated 11/2026
English
English

What you'll learn

  • Build and verify a PX4 1.16 plus ROS 2 Jazzy simulation container with a check script.
  • Connect PX4 to ROS 2 with the uXRCE-DDS agent and list the topics it exposes.
  • Fix a topic that looks silent by matching the best_effort QoS.
  • Convert between PX4 NED and ROS ENU frames without sign mistakes.
  • Send the heartbeat and setpoints PX4 needs, arm, and take off from a Python node.
  • Fly position, velocity and square trajectories and measure the tracking error.
  • Reproduce a heartbeat loss and read the failsafe in the flight log.

Course content

4 sections • 19 lectures • 1h 58m total length
  • 1.1 Your first autonomous flight: what you will build6:03
  • 1.2 Set up the simulator container once, and check it works6:10
  • 1.3 Read the flight log: what PX4 wrote down about your flight7:06

Requirements

  • Python basics and a terminal.
  • Linux with Docker and about 15 GB free disk (the course container is built from the included Dockerfile).
  • Some ROS 2 knowledge helps: topics and nodes.

Description

This course contains the use of artificial intelligence.

The narration is a synthetic voice; every number and output on screen comes from a real run you can repeat.

19 lectures, about 119 minutes, one working skill: flying a PX4 drone in simulation from a ROS 2 Jazzy node. Lectures show the real terminal, the code and the real output of PX4 1.16 SITL with Gazebo running inside a container, and every section has a download with the lab code and a check script.

Sections: first flight and a container setup with a verify script; the bridge (the uXRCE-DDS agent, px4_msgs topics, finding message types and fields, the best_effort QoS trap that makes a topic look silent, NED versus ENU frames); reading the flight log (ULog); and offboard control (the heartbeat and setpoints PX4 requires, arming and takeoff in code, position versus velocity setpoints, flying a square, landing and a full mission scored by a check script, what PX4 does when the heartbeat stops, and tuning with a measured result); and a debugging section (why PX4 will not arm, a sign bug that flies the wrong way, and a check that catches it).

Numbers in the course come from the test runs: a takeoff to 5 m, a 10 m square with a measured cross-track error, and a heartbeat loss that switched PX4 into failsafe about two seconds after the stream stopped. One run is a measurement, not a statistic. In the tuning lecture only one leg improved, and the course says so.

What it does not cover: real hardware, QGroundControl or the Gazebo window (the labs run headless in the container and you read the terminal output), cameras, landing targets, or MAVSDK. You need Linux with Docker and about 15 GB of free disk. The Dockerfile builds PX4 from source, which takes a long time on a laptop.

Who this course is for:

  • Robotics developers who want to command a PX4 drone from ROS 2.
  • ROS 2 users moving from MAVROS ideas to the native PX4 bridge.
  • Not for complete beginners to ROS 2 or Python.