In this paper, an autonomous system is developed for drone racing. On account of their vast consumption of computing resources, the methods for visual navigation commonly employed are discarded, such as visual-inertial odometry (VIO) or simultaneous localization and mapping (SLAM). A series of navigation algorithms for autonomous drone racing, which can operate without the aid of the information on the external position, are proposed: one for lightweight gate detection, achieving gates detection with a frequency of 60 Hz; one for direct collision detection, seeking the maximum passability in-depth images. Besides, a velocity planner is adopted to generate velocity commands according to the results from visual navigation, which are enabled to perform a guidance role when the drone is approaching and passing through gates, assisting it in avoiding obstacles and searching for temporarily invisible gates. The approach proposed above has been demonstrated to successfully help our drone passing-through complex environments with a maximum speed of 2.5 m/s and ranked first at the 2022 RoboMaster Intelligent UAV Championship.