Abstract:This paper proposes a solution for the autonomous obstacle avoidance of a hovering flapping-wing robot based on visual perception to meet the requirements of low-speed, safe, and long-endurance flight in obstacle-rich indoor environments. Firstly, inspired by birds′ visual information-based obstacle avoidance principle, a visual obstacle avoidance method based on optical flow detection is proposed to recognize both dynamic and static obstacles indoors. Secondly, a robot combining helium balloons with flapping wings is designed, utilizing helium buoyancy for primary lift and flapping wing motion for propulsion and secondary lift. A flight control method is designed to ensure stable flight and obstacle avoidance requirements. Finally, a robot prototype is fabricated, and its flight performance and autonomous obstacle avoidance capability are tested. Furthermore, a comparison is made between the proposed obstacle detection algorithm and another existing algorithm. The results indicate that the prototype exhibits a heading deviation of 5. 52° in straight-line flying and a turning speed of 23°/ s and achieves a 77% obstacle avoidance success rate with a single-frame detection time of 6. 1 ms. This demonstrates its capability to accomplish low-speed hovering flight and autonomous obstacle avoidance, laying the foundation for its execution of indoor exploration tasks.