How hkust-aerial-robotics/falcon works
Main Components and Their Roles
• Exploration Manager Package:
• Contains the core exploration logic including a finite state machine (e.g., exploration_fsm, exploration_data).
• Loads configuration files for both maps and robot models.
• Interacts directly with the planner modules.
• Exploration Preprocessing and Utils:
• Compute the preliminary information such as frontier detection, grid representations, and connectivity graphs.
• Provide helper libraries (e.g., LKH TSP solver integration) used by the planner.
• Fast Planner & Pathfinding Modules:
• Use techniques such as A* search, coverage path guidance and optimization (e.g., using NLopt and bisection methods) to compute flight paths.
• Trajectory generation modules (B-spline, polynomial trajectories) that convert these paths into dynamically feasible trajectories.
• Voxel Mapping and Perception Utilities:
• Handle 3D mapping and environment representation (computing occupancy grids, ESDF/TSDF maps) that support real-time perception.
• Process the simulated sensor data and feed mapping and planning modules.
• UAV Simulator and Associated Sensor Packages:
• Various sub-packages for camera sensing (mesh and pointcloud renderers), map rendering, disturbance injection, and UAV dynamics simulation (SO3 control and quadrotor simulator).
• These packages mimic real sensor outputs and vehicle state feedback.
• Vehicle Control and Disturbance Generators:
• Provide low-level control nodes (e.g., so3_control, so3_disturbance_generator) that interface with trajectory outputs to command the UAV.
• Utility Packages:
• These include multi-map servers, visualization plugins for RViz, message definitions (quadrotor_msgs), pose and odometry utilities, and supporting scripts for deployment.
Relationships and Data Flow
• At the highest level, the autonomous exploration cycle begins with environment perception (camera sensors, pointcloud data from the simulated UAV sensor modules), which feed into the voxel mapping system.
• The mapping output is used by the exploration manager and the preprocessing modules to identify regions to explore (frontier detection, occupancy maps).
• Based on these inputs, the fast planner and pathfinding modules compute a coverage path which is then converted to a smooth trajectory by the trajectory generator.
• The trajectory is then fed into the control modules (SO3 control) that simulate vehicle dynamics (or interface with a real UAV on the UniQuad platform) via the UAV simulator.
• Feedback from the simulator (or real sensors on a UAV) is published via ROS topics to complete the control loop.
• In addition, RViz and other visualization utilities allow developers to monitor and debug the system by visualizing maps, planned paths, trajectories, and vehicle poses.
Architectural Patterns and Design Principles
• Modularity by ROS Package: Each subsystem (planning, mapping, simulation, control, utilities) is implemented as a ROS package and communicates via ROS topics, services, and messages.
• Separation of Concerns: The separation between perception/mapping, planning, and control ensures each module can be developed, tested, and maintained independently.
• Configuration-Driven: A significant amount of runtime behavior is controlled through YAML configuration files, allowing for flexible testing with different maps and robot models.
• Extensive Use of CMake and ROS Build Systems: The repository is structured with CMakeLists.txt in most modules, indicating that build and integration configurations are explicitly managed.