UAV Systems Engineering · Capstone 3 of 4
ROS 2 + PX4 Autonomous UAV
The integration project: PX4 SITL, ROS 2, a bridge, an offboard mission and the logs that prove it worked.
This is where software meets the flight controller. You will bring up the whole stack in simulation, command the vehicle from ROS 2, feed it external odometry, fly a mission autonomously and analyse the log to find and fix what went wrong.
Mission and scope
Build and verify a stack in which a ROS 2 mission node flies a square waypoint mission in PX4 SITL using offboard control, while position comes from a simulated external odometry source through EKF2 (GNSS fusion disabled). Provide a flight-log analysis that demonstrates that vision fusion was active and quantifies the tracking error.
Everything in this capstone runs on your own machine: the site cannot check it for you. The acceptance criteria below are what you verify and report.
What you will implement
- PX4 SITL with a Gazebo vehicle and QGroundControl connected (lessons M6-T1, M6-T12, M6-T14).
- ROS 2 workspace with px4_msgs matching the firmware version and the XRCE Agent (lessons M6-T8, M6-T9).
- Odometry bridge converting ENU/FLU to NED/FRD with correct timestamps and variances (lesson M6-T10).
- Offboard mission node with a dedicated fixed-rate setpoint publisher, arming and mode handshake, and status monitoring (lesson M6-T11).
- An autonomous square mission with waypoint acceptance logic and a return-and-land at the end.
- Log analysis with ULog tools: estimator fusion flags, innovations, setpoint tracking and failure events (lesson M6-T13).
System architecture
Requirements
| ID | Requirement | Verification method |
|---|---|---|
| R1 | The ROS 2 bridge shall expose the PX4 topics and the odometry rate shall be within 10% of its nominal rate. | Test: ros2 topic hz |
| R2 | The mission node shall stream setpoints at a fixed rate with no gap longer than 100 ms. | Test: timestamp analysis of the setpoint topic |
| R3 | The vehicle shall enter offboard mode and fly the square with waypoint acceptance radius 0.5 m. | Test: simulation run and log |
| R4 | GNSS fusion shall be disabled and EKF2 shall fuse external position; this shall be demonstrated from the log. | Analysis: estimator status flags in the ULog |
| R5 | Tracking error (RMS) along the square shall be reported and compared with the configured speed. | Analysis |
| R6 | If the setpoint stream is interrupted for 2 s the vehicle shall exit offboard and follow the configured failsafe. | Test: deliberate stream interruption |
Bring-up checklist
- Start PX4 SITL and confirm the vehicle arms and flies in position mode from QGroundControl.
- Start the XRCE Agent and verify
/fmu/out/vehicle_statusand/fmu/out/vehicle_odometryarrive at a steady rate with the right QoS. - Run the offboard demo (hover at 5 m), then the square.
- Disable GNSS fusion with the EKF2 parameters of your PX4 version, enable external vision, run the odometry bridge, and verify fusion in the log.
Log analysis tasks
- Plot setpoint against local position for the square; compute RMS and maximum error.
- Plot EKF2 innovations for the external vision source and the fusion flags to show vision is accepted.
- Mark the mode changes (position, offboard, return, land) on the timeline.
- Find the cause of any oscillation or overshoot and propose a parameter or software change.
Use PX4’s flight-log analysis tools (Flight Review, PlotJuggler with ULog support, or pyulog).
Break it on purpose
Run these experiments and record the observed behaviour: (1) stop the setpoint stream; (2) publish odometry with a 100 ms stale timestamp; (3) publish ENU positions without conversion; (4) mismatched px4_msgs version. Each is a real failure mode from the lessons; record how it manifests in the log.
Deliverables
- A repository with launch files and a README that brings up the whole stack from a clean machine.
- The odometry bridge node with unit tests for frame conversion (lesson M6-T10).
- A log-analysis notebook or script that produces every figure in the report.
- A report with: architecture diagram, topic and frame table, the acceptance criteria results and the break-it experiments.
- A list of PX4 parameters changed from default with the reason for each.
Acceptance criteria and grading rubric
| Criterion | Acceptable | Strong |
|---|---|---|
| Bring-up | Stack runs; vehicle flies the square autonomously | Reproducible launch; version pinning |
| Offboard design | Streaming publisher independent of the mission logic | Failure and timeout behaviour tested |
| Odometry integration | EKF2 fuses external position per the log | Frame and timestamp tests; stale and wrong-frame experiments |
| Log analysis | Tracking error computed | Innovation and fusion analysis with conclusions |
| Parameter hygiene | Changed parameters listed | Each justified and verified |
Common failure points
- px4_msgs and firmware versions differ: topics exist but are empty.
- Setpoints published from inside a slow callback; offboard drops out.
- EKF2 parameter names from an older tutorial do not exist in your version: use the PX4 documentation for your release.
- Sim time and wall time confusion when stamping messages.
- Declaring success from the vehicle moving, without checking in the log that vision (not GNSS) was fused.
References
Record your progress
Capstones are assessed by you against the rubric above, so this records your own sign-off.