Unmanned aerial vehicle return control method and system based on sparse map

CN122172806APending Publication Date: 2026-06-09PRODRONE TECH (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
PRODRONE TECH (SHENZHEN) CO LTD
Filing Date
2026-02-10
Publication Date
2026-06-09

Smart Images

  • Figure CN122172806A_ABST
    Figure CN122172806A_ABST
Patent Text Reader

Abstract

This invention relates to a method and system for UAV return-to-home control based on a sparse map, comprising the following steps: constructing a sparse grid map; determining candidate positioning points during the UAV's flight along the return trajectory; performing UAV relocalization based on interior points during feature point matching; determining the position information of the candidate positioning point corresponding to the scene image with the most interior points as the optimal matching image position at the moment of successful UAV relocalization; calculating the corrected precise pose and error transformation amount based on the optimal matching image position and the UAV pose at the moment of successful UAV relocalization; and continuously correcting the current pose estimate based on the error transformation amount. This invention enables precise UAV return-to-home control in an environment without a positioning module, possessing the advantages of low power consumption and lightweight design. It also effectively solves the problem of accumulated errors in VIO systems during long-distance flight, ensuring that the UAV can still return accurately even after the positioning module fails.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of unmanned aerial vehicle (UAV) technology, and in particular to a UAV return-to-home control method and system based on sparse maps. Background Technology

[0002] In existing technologies, the flight navigation and control of drones heavily rely on positioning modules such as GPS and BeiDou to provide real-time location information. However, if these positioning modules fail, the drone will lose its most important source of global location data. To address this situation, there are currently two main solutions:

[0003] 1. By fusing data from airborne cameras and IMUs (Inertial Measurement Units) using VIO (Visual Inertial Odometry), the relative motion of a drone over a short period of time can be estimated. However, VIO is a relative positioning technology, and its positioning error accumulates continuously with time and flight distance, and cannot be eliminated. This eventually leads to a huge deviation between the calculated position and the actual position (this deviation can reach hundreds of meters), making it impossible to achieve subsequent tasks such as accurate return to base.

[0004] 2. Based on SLAM (Simultaneous Localization and Mapping), environmental maps are built in real time in unknown environments, and accumulated errors are eliminated through techniques such as loop closure detection to achieve high-precision positioning. However, in order to ensure high accuracy and map integrity, traditional SLAM systems usually require a large amount of onboard computing resources (CPU / RAM), which places high demands on the hardware platform and makes it difficult to deploy them widely on cost- and power-sensitive consumer-grade or lightweight industrial drones. Summary of the Invention

[0005] The purpose of this invention is to provide a method and system for UAV return-to-home control based on sparse maps, which can achieve precise return-to-home control of UAVs with extremely low resource consumption in an environment without a positioning module. It has the advantages of low power consumption and lightweight design, and can effectively solve the problem of cumulative error in VIO systems during long-distance flights. It ensures that the UAV can still accurately return to the HOME point after the positioning module fails, thus achieving precise return-to-home.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] On the one hand, a method for UAV return-to-home control based on sparse maps is provided, which includes the following steps:

[0008] A sparse grid map corresponding to the UAV's flight space is constructed. During the UAV's flight along its outbound path, the positioning point P(L0,F,X) is selectively stored in the grid of the sparse grid map, where L0 is the position coordinate of the positioning point, and L0=L / d, d is the resolution of the sparse grid map; F is the image feature of scene image I, denoted as reference image feature; X is the three-dimensional coordinate of each reference image feature point in reference image feature F in the sparse grid map.

[0009] During the flight of the UAV along the return flight path, candidate localization points are determined using the current pose estimation value L_vio of the UAV.

[0010] UAV relocation is performed by matching interior points with feature points based on the current real-time image and the scene image of candidate localization points.

[0011] When the UAV successfully repositions itself, feature point matching will be performed with the current real-time image to obtain the position information L of the candidate positioning point corresponding to the scene image with the most interior points, which will be determined as the best matching image position L_best.

[0012] Based on the best matching image position L_best and the UAV pose ΔT when the UAV relocalization is successful, the corrected accurate pose L_corrected of the current UAV and the error transformation E_vio between the current pose estimate L_vio and the accurate pose L_corrected are calculated.

[0013] Furthermore, the current pose estimate L_vio is continuously corrected based on the error transformation E_vio until the UAV reaches the area above the landing point.

[0014] On the other hand, there is also a drone return-to-home control system based on sparse grid maps, which includes:

[0015] The map building module is used to construct a sparse grid map corresponding to the drone's flight space.

[0016] The positioning module, which is mounted on the drone, is used to obtain the drone's location information L in real time;

[0017] The camera, mounted on the drone, is used to acquire scene image I in real time while the drone is flying along the outbound flight path, and to acquire the current real-time image I_current while the drone is flying along the return flight path;

[0018] The feature extraction module is used to extract image features from the scene image I and the current real-time image I_current, and the extracted image features are denoted as reference image feature F and current image feature F_current, respectively.

[0019] A positioning point storage module is used to selectively store positioning points P(L0,F,X) in the grid of the sparse grid map M;

[0020] The VIO system is used to output the current pose estimate L_vio of the UAV in real time during the UAV's flight along the return path;

[0021] The candidate localization point extraction module is used to determine the sparse grid map grid corresponding to the current pose estimation value L_vio based on L_vio / d, and extract all localization points P in the neighborhood grid of that grid as candidate localization points;

[0022] The feature point matching module is used to perform feature point matching between the current image feature F_current and the reference image feature F of each candidate positioning point, so as to obtain the preliminary feature matching point pairs when performing feature point matching between the current image feature F_current and the reference image feature F of each candidate positioning point, and to construct an initial matching set based on the preliminary feature matching point pairs.

[0023] The inlier determination module is used to determine whether each initial feature matching point pair in each initial matching set is an inlier and to construct the inlier matching dataset corresponding to each initial matching set.

[0024] The pose estimation module processes the total matching dataset based on the PnP algorithm to obtain the relative pose of the UAV relative to the candidate localization points ΔT=[R|t];

[0025] The pose correction module calculates the corrected pose L_corrected and the error transformation E_vio between the current pose estimate L_vio and the correct pose L_corrected based on the best matching image position L_best and the UAV pose ΔT when the UAV repositions successfully. It then continuously corrects the current pose estimate L_vio based on the error transformation E_vio until the UAV reaches the area above the landing point HOME.

[0026] In summary, the present invention has the following advantages compared with the prior art:

[0027] This invention, through its lightweight sparse grid map design and selective storage of positioning points, reduces the computational requirements of airborne equipment to far less than those of traditional SLAM. The relevant hardware can be easily deployed on various cost- and power-sensitive drones, achieving precise return-to-home control of drones with extremely low resource consumption in environments without positioning modules. It has the advantages of low power consumption and lightweight design, while also possessing positioning accuracy and reliability comparable to SLAM.

[0028] Furthermore, this invention ensures the accuracy of positioning calculations through rigorous geometric verification based on RANSAC+PnP. At the same time, it effectively solves the problem of accumulated errors in the VIO system during long-distance flight by using a VIO system and a periodic closed-loop correction mechanism, ensuring that the UAV can still accurately return to the HOME point after the positioning module fails, thus achieving precise return to home. Attached Figure Description

[0029] Figure 1 This is a flowchart of the steps of the UAV return-to-home control method based on sparse grid map in this invention;

[0030] Figure 2 This is a schematic diagram of the sparse grid map in this invention;

[0031] Figure 3 This is a schematic diagram of the UAV return-to-home control system based on sparse grid maps in this invention. Detailed Implementation

[0032] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0033] Example 1

[0034] like Figure 1 As shown, this embodiment provides a UAV return-to-home control method based on a sparse grid map, which includes the following steps:

[0035] S1. Control the UAV to fly along the outbound flight path and perform the corresponding flight path task (i.e., outbound flight) during the flight, such as inspection, and at the same time construct a sparse grid map M corresponding to the UAV's flight space. During the UAV's flight along the outbound flight path, the positioning point P(L0,F,X) is selectively stored in the grid of the sparse grid map M.

[0036] Specifically, such as Figure 2 As shown, constructing a sparse grid map M corresponding to the UAV's flight space includes the following steps:

[0037] The flight space of the UAV is divided into several grids, and each grid has the same resolution, such as 10m×10m×10m grids, thus obtaining the sparse grid map M.

[0038] Furthermore, selectively storing the location point P(L0,F,X) in the grid of the sparse grid map M includes the following steps:

[0039] S11. During the flight of the UAV along the outbound flight path, the UAV obtains the UAV's position information L (i.e., the UAV's latitude, longitude and altitude) in real time based on the positioning module mounted on the UAV, and collects scene images I in real time based on the camera mounted on the UAV (downward camera).

[0040] In this embodiment, the location information L can be obtained by a single positioning module (such as a GPS positioning module, a Beidou positioning module, etc.) or by the result of multi-sensor data fusion (such as the result of GPS and IMU data fusion).

[0041] S12. Use a deep learning model (such as XFeat) to extract image features from scene image I. The extracted image features are denoted as reference image features F, and a localization point P(L0,F,X) is constructed. Each reference image feature F of scene image I contains several scene image feature points, denoted as reference image feature points pt. At the same time, based on the UAV's flight altitude and camera intrinsic parameters, using the ground plane assumption (or directly obtained through a depth sensor), each reference image feature point pt is back-projected into three-dimensional space to obtain the three-dimensional coordinates X of each reference image feature point pt in the sparse grid map M.

[0042] Where L0 is the location coordinate of the positioning point, and L0 = L / d, d is the resolution of the sparse grid map M (which can be preset); thus, each positioning point P includes position information L, and a scene image I, a reference image feature F, and the three-dimensional coordinates X of each reference image feature point pt in the sparse grid map M that uniquely corresponds to the position information L.

[0043] S13. Determine the sparse grid map index corresponding to the current location point P based on the location coordinates L0 of the current location point P, and determine whether the location point P has been stored in the grid corresponding to the index. If the grid is empty (i.e. no location point has been stored), and the distance between the current location point P and the previous location point stored in the grid is greater than the preset distance threshold D_insert, store the current location point P in the grid, thereby ensuring the lightweight nature of the sparse grid map M.

[0044] Therefore, since the positioning point P only contains the quantized positioning point coordinates L0 and image features F, and the positioning point P is only stored in the grid under the premise of meeting the preset conditions, it can be ensured that even for long-distance routes, the total volume of the sparse grid map M can be controlled at the megabyte (MB) level, which can greatly compress the map volume to obtain a lightweight sparse map.

[0045] S2. After the UAV completes its flight path mission, it initiates the UAV return-home procedure, causing the UAV to fly along the return flight path towards the predetermined landing point HOME. In this embodiment, the landing point HOME can be the UAV's takeoff point. In this embodiment, the outbound flight path and the return flight path are the same flight path.

[0046] Furthermore, during the return flight path, if the GNSS signal is unstable or to improve autonomy, the UAV can be repositioned using the VIO system and sparse grid map M without relying on positioning modules (such as various GNSS positioning modules including GPS positioning modules and Beidou positioning modules).

[0047] Specifically, UAV relocalization is performed using the VIO system and a sparse grid map M, including the following steps:

[0048] S21. During the flight of the UAV along the return flight path, the current pose estimation value L_vio of the UAV is output in real time based on the VIO system on the UAV. At the moment of outputting the current pose estimation value L_vio, the current real-time image I_current is acquired based on the camera on the UAV.

[0049] Due to the cumulative drift in the VIO system, the deviation between the pose estimate L_vio and the true position will gradually increase over time.

[0050] S22. Determine the sparse grid map corresponding to the current pose estimate L_vio based on L_vio / d, and extract all the localization points P in the neighborhood grid of this grid as candidate localization points. The neighborhood grid refers to N×N grids centered on this grid (including the central grid), where N is a positive integer and the value range of N is [3,5]. Since only a few localization points are extracted as candidate localization points in this step, the computational amount of subsequent matching calculation can be greatly reduced.

[0051] In addition, the image features of the current real-time image I_current are extracted using a deep learning model (such as XFeat), denoted as the current image feature F_current, and the current image feature F_current contains several current image feature points pt_current;

[0052] S23. Perform feature point matching between the current image feature F_current and the reference image feature F of each candidate localization point to obtain preliminary feature matching point pairs when performing feature point matching between the current image feature F_current and the reference image feature F of each candidate localization point. This specifically includes the following steps:

[0053] S231. For the current image feature point pt_current_i in the current image feature F_current, a traversal search is performed in the reference image feature F of the current candidate location point to calculate the distance (such as Euclidean distance) between the feature descriptor of the current image feature point pt_current_i and the feature descriptor of each reference image feature point pt in the reference image feature F of the current candidate location point. The reference image feature point pt with the smallest distance to the current image feature point pt_current_i is determined as the nearest neighbor matching point pt_j of the current image feature point pt_current_i, so as to establish a preliminary feature matching point pair (pt_current_i, pt_j).

[0054] S232. Repeat step S231 above, traversing each current image feature point pt_current to obtain all preliminary feature matching point pairs when matching the current image feature F_current with the reference image feature F of the current candidate localization point.

[0055] And construct an initial matching set {(pt_current_i, pt_j)} when performing feature point matching between the current image feature F_current and the reference image feature F of the current candidate localization point. The initial matching set contains all the above preliminary feature matching point pairs, where pt_current_i is the i-th current image feature point pt_current, pt_j is the j-th reference image feature point pt, and the reference image feature point pt is the nearest neighbor matching point of pt_current_i.

[0056] S233. Repeat step S232 above to obtain the initial matching set when matching the current image feature F_current with the reference image feature F of each candidate localization point.

[0057] S24. Due to changes in the visual environment or texture repetition, the initial matching set inevitably contains mismatched points (i.e., outliers). Therefore, it is necessary to filter the initial matching set. Thus, this step uses a geometric constraint algorithm to determine whether each preliminary feature matching point pair in each initial matching set is an inlier, and constructs an inlier matching dataset corresponding to each initial matching set. Specifically, it includes the following steps:

[0058] S241. Input the coordinate data of each preliminary feature matching point pair (pt_current_i, pt_j) in the current initial matching set into the USAC (Universal RANSAC) framework for geometric consistency verification.

[0059] Specifically, the coordinates of the current image feature point pt_current_i are pixel coordinates, denoted as points1. The coordinates of the nearest neighbor matching point pt_j can be pixel coordinates or three-dimensional coordinates X in the sparse grid map M, denoted as points2. Points1 and points2 are input into the USAC framework.

[0060] The USAC framework is based on the MAGSAC (Marginalizing Sample Consensus) equal probability optimization algorithm. Through iterative sampling and model validation, it outputs a mask vector inliers_mask with the same length as the current initial matching set. If the value of inliers_mask[i] is 1, then the i-th preliminary feature matching point pair in the current initial matching set is determined to meet the geometric constraints and is an inlier. If the value of inliers_mask[i] is 0, then the i-th preliminary feature matching point in the current initial matching set is determined to be an outlier.

[0061] S242. Based on the geometric consistency verification results output by the USAC framework, extract all preliminary feature matching point pairs that are determined to be interior points in the current initial matching set, and construct the interior point matching data (pt_current_i, X_j) for each interior point, as well as the interior point matching dataset {(pt_current_i, X_j)} containing all interior point matching data, to serve as the interior point matching dataset corresponding to the current initial matching set; where X_j is the three-dimensional coordinate of the nearest neighbor matching point pt_j in the sparse grid map M;

[0062] S243. Repeat steps S241-S242 above to obtain the inlier matching dataset corresponding to each initial matching set, and construct the total matching dataset containing all inlier matching datasets.

[0063] S25. Process the total matching dataset based on the PnP (Perspective N Points) algorithm to obtain the relative pose ΔT=[R|t] of the UAV relative to the candidate localization points. The specific steps include the following:

[0064] Determine the initial relative pose T_init = [R_init|t_init], where R_init and t_init are the initial rotation matrix and the initial translation vector, respectively;

[0065] Starting from the initial relative pose T_init, non-linear optimization is performed on the inlier matching data in the total matching dataset based on the PnP algorithm, and the total reprojection error of all inlier matching data is minimized based on minimizing the objective function:

[0066] The minimization objective function is as follows:

[0067]

[0068] Where K is the camera intrinsic parameter; R and t are the rotation matrix and translation vector of the current relative pose to be optimized [R|t], respectively; proj(K,R,t,X_j) is the pixel obtained by projecting the three-dimensional coordinates of the nearest neighbor matching point pt_j in the sparse grid map M onto the current real-time image I_current based on the relative pose to be optimized [R|t] and the camera intrinsic parameter K. Represents the square of the L2 norm;

[0069] S26. If the number of inliers is greater than or equal to a preset threshold, and the output relative pose ΔT=[R|t] satisfies the preset pose condition when the total reprojection error is minimized, then the UAV repositioning is considered successful, and step S3 is executed; otherwise, return to step S21; where the value range of the inlier number threshold is [total number of inliers]. 0.5, total number of interior points 0.9] The pose preset conditions can be set pose angle thresholds, etc.;

[0070] S3. At the moment when the UAV is successfully repositioned, count the number of interior points in the initial matching set when matching the current image feature F_current of the current real-time image I_current with the reference image feature F of each candidate positioning point.

[0071] The position information L of the candidate localization point corresponding to the initial matching set with the largest number of interior points is determined as the best matching image position L_best.

[0072] S4. Based on the best matching image position L_best and the UAV pose ΔT when the UAV relocalization is successful, calculate the current corrected UAV pose L_corrected and the error transformation E_vio between the current pose estimate L_vio and the correct pose L_corrected.

[0073] Among them, L_corrected=L_best⊕ΔT, E_vio=L_corrected-L_vio;

[0074] S5. Correct the current pose estimate L_vio based on the error transformation amount E_vio to reduce the cumulative error of the current pose estimate L_vio and improve the accuracy of the positioning result.

[0075] S6. Repeat step S2, “Use the VIO system and sparse grid map M to reposition the UAV without relying on a positioning module (such as various GNSS positioning modules including GPS positioning module and Beidou positioning module),” and steps S3-S5, to continuously correct the current pose estimation value L_vio until the UAV reaches the area above the landing point HOME and executes the UAV landing control program so that the UAV lands on the landing point HOME.

[0076] Therefore, this embodiment provides an ideal solution between VIO system and full-featured SLAM. Through lightweight sparse grid map design and selective storage of positioning points, it reduces the computing power requirements of airborne equipment to a much lower level than traditional SLAM. The relevant hardware can be easily deployed on various cost- and power-sensitive drones. It can achieve precise return-to-home control of drones with extremely low resource consumption in environments without positioning modules. It has the advantages of low power consumption and lightweight design, while having positioning accuracy and reliability comparable to SLAM.

[0077] Furthermore, this embodiment uses the XFeat model for feature extraction to ensure feature point matching capability under complex lighting conditions. It also uses rigorous geometric verification based on RANSAC+PnP to ensure the accuracy of positioning calculation. At the same time, through the VIO system + periodic closed-loop correction (i.e., step S6) mechanism, it effectively solves the problem of accumulated error of VIO system under long-distance flight, which can keep the positioning accuracy of the UAV at the meter level. This ensures that the UAV can still accurately return to the HOME point after the positioning module fails, achieving accurate return.

[0078] Example 2:

[0079] This embodiment provides a UAV return-to-home control system based on a sparse grid map, which can implement the UAV return-to-home control method described in Embodiment 1, such as... Figure 3 As shown, the UAV return-to-home control system includes:

[0080] Map building module 1 is used to build a sparse grid map M corresponding to the UAV's flight space, and its process is the same as step S1.

[0081] Positioning module 2, which is mounted on the drone, is used to acquire the drone's location information L in real time;

[0082] Camera 3, which is mounted on the drone, is used to acquire scene image I in real time while the drone is flying along the outbound flight path, and to acquire the current real-time image I_current while the drone is flying along the return flight path;

[0083] Feature extraction module 4 uses a deep learning model (such as XFeat) to extract image features from scene image I and current real-time image I_current, and the extracted image features are denoted as reference image feature F and current image feature F_current, respectively.

[0084] The positioning point storage module 5 is used to selectively store positioning points P(L0,F,X) in the grid of the sparse grid map M, and the process is the same as step S1.

[0085] The VIO system 6 is used to output the current pose estimate L_vio of the UAV in real time during its return flight path.

[0086] The candidate localization point extraction module 7 is used to determine the sparse grid map grid corresponding to the current pose estimation value L_vio based on L_vio / d, and extract all localization points P in the neighboring grid of the grid as candidate localization points. The process is the same as step S22.

[0087] The feature point matching module 8 is used to perform feature point matching between the current image feature F_current and the reference image feature F of each candidate positioning point, so as to obtain the preliminary feature matching point pairs when performing feature point matching between the current image feature F_current and the reference image feature F of each candidate positioning point, and to construct an initial matching set based on the preliminary feature matching point pairs. The process is the same as step S23.

[0088] The inlier determination module 9 is used to determine whether each preliminary feature matching point pair in each initial matching set is an inlier and to construct the inlier matching dataset corresponding to each initial matching set. The process is the same as step S24.

[0089] The pose estimation module 10 processes the total matching dataset based on the PnP (Perspective N Points) algorithm to obtain the relative pose ΔT=[R|t] of the UAV relative to the candidate positioning points. The process is the same as step S25.

[0090] The pose correction module 11 calculates the corrected pose L_corrected and the error transformation E_vio between the current pose estimate L_vio and the corrected pose L_corrected based on the best matching image position L_best and the UAV pose ΔT when the UAV repositioning is successful. It then continuously corrects the current pose estimate L_vio based on the error transformation E_vio until the UAV reaches the area above the landing point HOME. The process is the same as steps S4-S6.

[0091] And, landing control module 12, which is used for the drone landing control program to control the drone to land at the landing point HOME.

[0092] In summary, this invention, through its lightweight sparse grid map design and selective storage of positioning points, reduces the computational requirements of airborne equipment to far less than those of traditional SLAM. The relevant hardware can be easily deployed on various cost- and power-sensitive drones, achieving precise return-to-home control of drones with extremely low resource consumption in environments without positioning modules. It has the advantages of low power consumption and lightweight design, while also possessing positioning accuracy and reliability comparable to SLAM.

[0093] Furthermore, this invention ensures the accuracy of positioning calculation based on rigorous geometric verification using RANSAC+PnP. At the same time, through the mechanism of VIO system + periodic closed-loop correction (i.e., step S6), it effectively solves the problem of cumulative error of VIO system under long-distance flight, which can maintain the positioning accuracy of UAV at the meter level. This ensures that even after the positioning module fails, the UAV can still accurately return to the HOME point, achieving precise return to home.

[0094] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for UAV return-to-home control based on sparse maps, characterized in that, Includes the following steps: A sparse grid map corresponding to the UAV's flight space is constructed. During the UAV's flight along its outbound path, the positioning point P(L0,F,X) is selectively stored in the grid of the sparse grid map, where L0 is the position coordinate of the positioning point, and L0=L / d, d is the resolution of the sparse grid map; F is the image feature of scene image I, denoted as reference image feature; X is the three-dimensional coordinate of each reference image feature point in reference image feature F in the sparse grid map. During the flight of the UAV along the return flight path, candidate localization points are determined using the current pose estimation value L_vio of the UAV. UAV relocation is performed by matching interior points with feature points based on the current real-time image and the scene image of candidate localization points. When the UAV successfully repositions itself, feature point matching will be performed with the current real-time image to obtain the position information L of the candidate positioning point corresponding to the scene image with the most interior points, which will be determined as the best matching image position L_best. Based on the best matching image position L_best and the UAV pose ΔT when the UAV relocalization is successful, the corrected accurate pose L_corrected of the current UAV and the error transformation E_vio between the current pose estimate L_vio and the accurate pose L_corrected are calculated. Furthermore, the current pose estimate L_vio is continuously corrected based on the error transformation E_vio until the UAV reaches the area above the landing point.

2. The UAV return-to-home control method as described in claim 1, characterized in that, Selectively storing the location point P(L0,F,X) in the grid of the sparse grid map includes the following steps: Acquire the drone's location information L and the scene image I; Extract the image features of scene image I, denoted as reference image feature F, and construct the localization point P(L0,F,X). Each reference image feature F of scene image I contains several scene image feature points, denoted as reference image feature points pt; X is the three-dimensional coordinate of each reference image feature point pt in the sparse grid map. The sparse grid map index corresponding to the current location point P is determined based on the location coordinates L0 of the current location point, and it is determined whether the location point P has been stored in the grid corresponding to the index. If the grid is empty and the distance between the current location point P and the previous location point stored in the grid is greater than the preset distance threshold D_insert, the current location point P is stored in the grid.

3. The UAV return-to-home control method as described in claim 1, characterized in that, During the UAV's flight along the return path, candidate localization points are determined using the UAV's current pose estimation value L_vio, including the following steps: During the UAV's flight along the return trajectory, the current pose estimate L_vio of the UAV is output based on the VIO system; The sparse grid map corresponding to the current pose estimate L_vio is determined based on L_vio / d, and all localization points P in the neighboring grids of this grid are extracted as candidate localization points.

4. The UAV return-to-home control method as described in claim 1, characterized in that, UAV relocalization based on inlier points during feature point matching using the current real-time image and scene image of candidate localization points includes the following steps: At the moment of outputting the current pose estimate L_vio, the current real-time image I_current is acquired based on the camera mounted on the UAV, and the image features of the current real-time image I_current are extracted and denoted as the current image feature F_current, and the current image feature F_current contains several current image feature points pt_current; The current image feature F_current is matched with the reference image feature F of each candidate localization point to obtain the corresponding initial matching set. Each initial matching set includes all the preliminary feature matching point pairs when the current image feature F_current is matched with the reference image feature F of the current candidate localization point. Determine whether each initial feature matching point pair in each initial matching set is an inlier, construct the inlier matching dataset corresponding to each initial matching set, and construct the total matching dataset containing all inlier matching datasets. The PnP algorithm is used to process the total matching dataset to obtain the relative pose of the UAV relative to the candidate positioning points ΔT=[R|t]; If the number of inliers is greater than or equal to the preset threshold, and the total reprojection error is minimized, the output relative pose ΔT=[R|t] satisfies the pose preset condition, then the UAV repositioning is considered successful.

5. The UAV return-to-home control method as described in claim 4, characterized in that, The current image feature F_current is matched with the reference image feature F of each candidate localization point to obtain the corresponding initial matching set, including the following steps: For the current image feature point pt_current_i, a traversal search is performed in the reference image features F of the current candidate localization point to calculate the distance between the feature descriptor of the current image feature point pt_current_i and the feature descriptor of each reference image feature point pt in the reference image features F of the current candidate localization point. The reference image feature point pt with the smallest distance to the current image feature point pt_current_i is determined as the nearest neighbor matching point pt_j of the current image feature point pt_current_i, so as to establish a preliminary feature matching point pair (pt_current_i, pt_j). Repeat the above steps, traversing each current image feature point pt_current, to obtain all preliminary feature matching point pairs when matching the current image feature F_current with the reference image feature F of the current candidate localization point. Construct an initial matching set {(pt_current_i, pt_j)} when performing feature point matching between the current image feature F_current and the reference image feature F of the current candidate localization point; Repeat the above steps to obtain the initial matching set when performing feature point matching between the current image feature F_current and the reference image feature F of each candidate localization point.

6. The UAV return-to-home control method as described in claim 5, characterized in that, Determining whether each initial feature matching point pair in each initial matching set is an interior point includes the following steps: Input the coordinate data of each preliminary feature matching point pair (pt_current_i, pt_j) in the current initial matching set into the USAC framework for geometric consistency verification; Determine whether the preliminary feature matching point is an interior point based on the geometric consistency verification results output by the USAC framework.

7. The UAV return-to-home control method as described in claim 4, characterized in that, The PnP algorithm is used to process the total matching dataset to obtain the relative pose ΔT=[R|t] of the UAV relative to the candidate localization points. The steps include the following: Determine the initial relative pose T_init = [R_init|t_init], where R_init and t_init are the initial rotation matrix and the initial translation vector, respectively; Starting from the initial relative pose T_init, nonlinear optimization is performed on the matching data of each inlier in the total matching dataset based on the PnP algorithm, and the total reprojection error of all inlier matching data is minimized based on minimizing the objective function: The minimization objective function is as follows: ; Where K is the camera intrinsic parameter; R and t are the rotation matrix and translation vector of the current relative pose to be optimized [R|t], respectively; proj(K,R,t,X_j) is the pixel obtained by projecting the three-dimensional coordinates of the nearest neighbor matching point pt_j in the sparse grid map M onto the current real-time image I_current based on the relative pose to be optimized [R|t] and the camera intrinsic parameter K. This represents the square of the L2 norm.

8. The UAV return-to-home control method as described in claim 7, characterized in that, The precise pose L_corrected = L_best⊕ΔT, and the error transformation E_vio = L_corrected - L_vio.

9. The UAV return-to-home control method as described in claim 7, characterized in that, The range of the threshold value for the number of interior points is [total number of interior points]. 0.5, total number of interior points 0.9].

10. A UAV return-to-home control system based on a sparse grid map, characterized in that, include: The map building module is used to construct a sparse grid map corresponding to the drone's flight space. The positioning module, which is mounted on the drone, is used to obtain the drone's location information L in real time; The camera, mounted on the drone, is used to acquire scene image I in real time while the drone is flying along the outbound flight path, and to acquire the current real-time image I_current while the drone is flying along the return flight path; The feature extraction module is used to extract image features from the scene image I and the current real-time image I_current, and the extracted image features are denoted as reference image feature F and current image feature F_current, respectively. A positioning point storage module is used to selectively store positioning points P(L0,F,X) in the grid of the sparse grid map M; The VIO system is used to output the current pose estimate L_vio of the UAV in real time during the UAV's flight along the return path; The candidate localization point extraction module is used to determine the sparse grid map grid corresponding to the current pose estimation value L_vio based on L_vio / d, and extract all localization points P in the neighborhood grid of that grid as candidate localization points; The feature point matching module is used to perform feature point matching between the current image feature F_current and the reference image feature F of each candidate positioning point, so as to obtain the preliminary feature matching point pairs when performing feature point matching between the current image feature F_current and the reference image feature F of each candidate positioning point, and to construct an initial matching set based on the preliminary feature matching point pairs. The inlier determination module is used to determine whether each initial feature matching point pair in each initial matching set is an inlier and to construct the inlier matching dataset corresponding to each initial matching set. The pose estimation module processes the total matching dataset based on the PnP algorithm to obtain the relative pose of the UAV relative to the candidate localization points ΔT=[R|t]; The pose correction module calculates the corrected pose L_corrected and the error transformation E_vio between the current pose estimate L_vio and the correct pose L_corrected based on the best matching image position L_best and the UAV pose ΔT when the UAV repositions successfully. It then continuously corrects the current pose estimate L_vio based on the error transformation E_vio until the UAV reaches the area above the landing point HOME.