Autonomous Vision-Guided Quadcopter Drone with PX4 & ROS 2
Build an autonomous multirotor UAV with PX4 autopilot, companion computer offboard control, optical flow, and target tracking.
Assemble a carbon-fiber quadcopter drone from scratch: brushless motors, 4-in-1 ESC, Holybro Pixhawk 6C / CUAV flight controller, companion Raspberry Pi 5 with camera, and offboard ROS 2 autonomous navigation.
Bill of Materials (BOM) & Components
| Component | Specifications | Qty | Estimated Cost |
|---|---|---|---|
| Carbon Fiber Quadcopter Frame (F450 / 250mm) | Rigid 3K carbon fiber arms with integrated PDB | 1 | $45 |
| 2212 920KV or 2207 1800KV Brushless Motors | Balanced high-efficiency outrunner brushless motors | 4 | $60 |
| 4-in-1 45A BLHeli_32 ESC | Supports DShot600 protocol and onboard current telemetry | 1 | $48 |
| Pixhawk 6C / Pixhawk Mini Flight Controller | Triple redundant IMU sensors with vibration dampening | 1 | $160 |
| PMW3901 Optical Flow & TFmini Plus LiDAR Rangefinder | Sub-centimeter indoor GPS-denied altitude and position hold | 1 | $55 |
| 4S 14.8V 3300mAh 60C LiPo Battery | High-discharge power pack providing 18-22 minute flight time | 1 | $45 |
Electrical & Architecture Summary
Flight controller runs PX4 Autopilot connected to 4 ESCs. Companion Raspberry Pi 5 connects via high-speed UART Telem port running micro-XRCE-DDS agent for ROS 2 offboard control.
Step-by-Step Assembly & Configuration
Frame Assembly & Soldering Motor ESCs
Mount brushless motors, solder ESC power leads to the central power distribution board, and ensure correct CW/CCW propeller rotational directions.
- Verify motor 1 & 4 rotate CCW, motors 2 & 3 rotate CW.
- Use heat-shrink tubing on all soldered high-current joints.
PX4 Calibration in QGroundControl
Calibrate accelerometer, 3-axis compass magnetometer, gyroscope, and radio transmitter failsafe channels in QGroundControl.
- Perform full 6-position orientation calibration away from metal objects.
- Configure battery low-voltage Return-to-Launch (RTL) safety thresholds.
Offboard ROS 2 Autonomous Mission Control
Implement a ROS 2 node that sends offboard position setpoints (`px4_msgs/msg/TrajectorySetpoint`) to execute autonomous 3D search patterns.
- Arm the drone in Offboard Mode via ROS 2 heartbeat stream.
- Execute smooth takeoff to 1.5m height and trace a 3m x 3m square trajectory.