This project is a ROS 2-based software framework for controlling a PX4-powered UAV that autonomously tracks another aircraft using both GPS-based pursuit and vision-based PID control, culminating in a simulated 'hit' confirmation.
The system consists of multiple modules including mission management (FSM), tracking control, no-fly zone monitoring, image processing, and PX4 interface. Each component runs as an independent ROS 2 node and communicates via ROS 2 topics, services, and actions.
-
mission_manager_node: Manages the overall mission flow including takeoff, stabilization, tracking, and return. Implements the FSM logic.
-
tracking_manager_node: Manages GPS pursuit and visual tracking actions, handles transitions, and generates setpoints.
-
gps_pursuit_action_server: Executes the GPS-based approach, sending progress feedback.
-
follow_target_action_server: Starts a 4-second PID-based tracking phase when the target is detected by the camera.
-
image_processor_node: Runs target detection (e.g., YOLO), publishing
/target/relative_positionand/target/detection_alert. -
px4_interface_node: Interfaces with the PX4 flight stack, sends setpoints, and publishes odometry/status.
-
camera_feed_node: Captures and publishes raw camera frames.
-
gps_uav_server_node: Publishes positions of other UAVs and provides a UAV list service.
-
no_fly_zone_guard_node: Monitors potential no-fly zone intrusions and sends alerts when needed.
-
After takeoff and stabilization,
mission_manager_nodesignalstracking_manager_nodeto start GPS pursuit. -
tracking_manager_nodesends a goal togps_pursuit_action_server→ GPS-based pursuit begins. -
If the camera detects the target, GPS pursuit is canceled → a goal is sent to
follow_target_action_server→ 4-second PID tracking begins. -
On completion, the FSM transitions to the next mission phase.
- Topics:
/offboard/set_pos,/vehicle/odometry,/vehicle/status,/target/relative_position,/target/detection_alert - Services:
/get_uav_list - Actions:
/gps_pursuit,/follow_target
This architecture supports autonomous mission execution, task cancellation, and real-time feedback mechanisms.