How ark-electronics/tracktor-beam works
Project Type and Purpose
• This is a full-stack robotics application built on ROS2 and PX4. It integrates a simulated drone (PX4 SITL in Gazebo) with OpenCV-based ArUco marker detection and ROS2-based precision landing logic. The goal is to detect fiducial markers in real time and command the PX4 autopilot to perform centimeter-level landings.
File Structure Analysis
• Top-level scripts & services
• install_opencv.sh, Makefile (PX4 SITL launch target), systemd unit files under services/ (usb_cam, dds-agent, aruco_tracker)
• src/
• aruco_tracker/ — ROS2 package: subscribes to camera topics, runs OpenCV ArUco detection, publishes marker pose
• precision_land/ — ROS2 package: subscribes to marker pose, computes landing setpoints, commands PX4 via ROS2 topics
• px4-ros2-interface-lib, px4_msgs, vision_opencv — support libraries and message definitions
• Launch & config
• launch/*.launch.py and cfg/params.yaml per package for parameterization
• CMakeLists.txt & package.xml define build and dependencies
README Insights
• Shows the run sequence:
1) make px4_sitl gz_x500_mono_cam_down_aruco
2) MicroXRCEAgent for PX4 <-> ROS2 bridging
3) ros_gz_bridge for camera and camera_info topics
4) ros2 run aruco_tracker / precision_land (or launch files)
5) QGroundControl for monitoring & mode switching
• Key technologies: ROS2 Humble, Micro XRCE-DDS, ROS_GZ Bridge, Gazebo, PX4 SITL, OpenCV 4.10
a. Main Components
• Simulation Block: Gazebo world with downward-facing camera + ArUco marker + PX4 SITL autopilot
• Middleware Layer:
– Micro XRCE-DDS Agent (UDP bridge to PX4)
– ros_gz_bridge (bridges Gazebo topics to ROS2 DDS)
– ROS2 DDS network
• ROS2 Nodes:
– usb_cam (real USB camera node or sim camera stub)
– aruco_tracker (image subscriber → OpenCV → publishes marker pose)
– precision_land (pose subscriber → landing controller → publishes setpoints to PX4)
• Ground Station: QGroundControl (MAVLink telemetry)
• Storage/Config: Params loaded from cfg/params.yaml, launch files
b. Relationships & Data Flow
1) Gazebo publishes /camera and /camera_info → ros_gz_bridge → ROS2 topics
2) aruco_tracker subscribes → CV detection → publishes /aruco_pose
3) precision_land subscribes /aruco_pose → computes setpoints → publishes to PX4 command topics
4) Micro XRCE-DDS Agent bridges ROS2 ↔ PX4 SITL (state, setpoints)
5) QGroundControl ↔ PX4 SITL via MAVLink
c. Architectural Patterns
• Publisher/Subscriber (ROS2 DDS) decoupling perception and control
• Layered: Simulation → Middleware → Perception → Control → Autopilot → Ground Station
• Modular ROS2 packages for reusability and unit testing
d. Key Technologies & Libraries
• ROS2 Humble (rclcpp, launch system)
• OpenCV ArUco module
• Micro XRCE-DDS for lightweight DDS
• ros_gz_bridge for Gazebo-ROS2 integration
• PX4 SITL (gazebo)