An obstacle avoidance inspection method, device and equipment of a UAV and a storage medium
By constructing environmental models and dynamic obstacle avoidance trajectories, the problems of positioning accuracy and obstacle avoidance capability of UAVs in complex environments have been solved, improving the inspection efficiency and safety of scenarios such as bridges and tunnels.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHAANXI DEXIN INTELLIGENT TECH CO LTD
- Filing Date
- 2026-02-03
- Publication Date
- 2026-05-19
AI Technical Summary
Existing drones suffer from poor positioning accuracy, insufficient obstacle avoidance capabilities, low waypoint setting efficiency, and poor module coordination in complex environments such as bridges and tunnels, resulting in poor inspection efficiency and high safety risks.
By acquiring configuration parameters, environmental data, and motion data, an environmental model is constructed to determine a static obstacle avoidance route. Combined with a real-time local environmental map and obstacle model, a dynamic obstacle avoidance trajectory is generated to control the drone to avoid obstacles and maintain hovering to collect data.
The optimized flight routes improve flight safety and the reliability of inspection data, making it suitable for complex scenarios such as bridges and tunnels. It also solves problems related to positioning accuracy, obstacle avoidance capabilities, and waypoint setting efficiency.
Smart Images

Figure CN121635456B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of unmanned aerial vehicle (UAV) inspection technology, and in particular to a method, apparatus, equipment and storage medium for obstacle avoidance inspection of UAVs. Background Technology
[0002] With the rapid development of UAV technology, its application in inspections of complex environments such as bridges, tunnels, and power facilities is becoming increasingly widespread, effectively replacing manual labor in high-risk and inefficient inspection work and meeting the engineering field's demand for automated inspections. However, the special environments of these complex inspection scenarios (such as the bottom of bridges and inside tunnels) place higher demands on the positioning accuracy, obstacle avoidance capabilities, and task coordination of UAVs. Existing UAV inspection methods have significant shortcomings: First, poor positioning reliability. GNSS signals in environments such as the bottom of bridges and tunnels are often attenuated or even lost due to obstruction or multipath effects, leading to a significant decrease in UAV positioning accuracy, which can cause flight interruption or loss of control in severe cases. Second, lack of obstacle avoidance capabilities. UAVs cannot dynamically identify static obstacles and are even less able to avoid sudden dynamic obstacles such as birds, posing significant safety hazards. Third, low efficiency in waypoint setting. A large number of inspection waypoints need to be manually set, which is labor-intensive and prone to missing key areas. Fourth, poor module coordination. Navigation and positioning, obstacle avoidance planning, and inspection data collection functions are mostly designed separately, resulting in redundant processes and poor inspection efficiency.
[0003] Therefore, how to optimize flight paths, improve obstacle avoidance capabilities, and enhance flight safety in complex inspection environments is an urgent problem to be solved. Summary of the Invention
[0004] In view of this, the obstacle avoidance inspection method, apparatus, device, and storage medium for unmanned aerial vehicles (UAVs) provided in this application embodiment can optimize flight paths, improve obstacle avoidance capabilities, and enhance flight safety in complex inspection environments. It is applicable to autonomous UAV inspection in complex environments such as bridges. The obstacle avoidance inspection method, apparatus, device, and storage medium for UAVs provided in this application embodiment are implemented as follows:
[0005] This application provides an obstacle avoidance and inspection method for unmanned aerial vehicles (UAVs), comprising:
[0006] Acquire configuration parameters, environmental data, and UAV motion data. The configuration parameters include inspection boundaries, obstacle boundaries, preset flight altitude, and preset flight path step size.
[0007] The environmental data, the motion data, and the inspection boundary are fused to obtain an environmental model.
[0008] A static obstacle avoidance route is determined based on the environment model, the obstacle boundary, the preset flight altitude, and the preset route step size. The static obstacle avoidance route includes preset waypoints.
[0009] The environmental data and the motion data are continuously fused to obtain an effective dataset including the real-time location information of the UAV.
[0010] The coverage area of the real-time local environment map is determined based on the real-time location information, obstacle avoidance warning distance, and flight speed of the UAV.
[0011] A real-time local environment map is generated based on the valid dataset and the coverage area.
[0012] Preset obstacle features are extracted from the real-time local environment map, and an obstacle model is determined based on the preset obstacle features;
[0013] Obtain the distance between the current flight path of the drone and the obstacles in the obstacle model;
[0014] When the distance is lower than a preset safety threshold, a dynamic obstacle avoidance trajectory is generated based on the drone's current position, current flight speed, and the static obstacle avoidance route, and the drone is controlled to avoid obstacles based on the dynamic obstacle avoidance trajectory;
[0015] When the drone reaches the preset waypoint, control the drone to hover at the preset flight altitude and acquire inspection data.
[0016] In some embodiments, determining a static obstacle avoidance path based on the environment model, the obstacle boundary, the preset flight altitude, and the preset path step size includes:
[0017] The effective inspection space is determined based on the inspection boundary and the environmental model, and the vertical position reference of the static obstacle avoidance route is determined based on the preset flight altitude.
[0018] A basic coverage route is generated within the effective inspection space based on the preset route step size and the vertical position reference.
[0019] Determine whether the basic coverage route includes the obstacle boundary. If the basic coverage route does not include the obstacle boundary, decompose the basic coverage route into a static obstacle avoidance route including a preset waypoint according to the preset route step size.
[0020] When the basic coverage route includes the obstacle boundary, it is determined whether there is an overlapping area between the basic coverage route and the area corresponding to the obstacle boundary. If there is an overlapping area, the overlapping area is adjusted to bypass the obstacle boundary, and the adjusted basic coverage route is decomposed into a static obstacle avoidance route including a preset waypoint according to the preset route step size.
[0021] In some embodiments, when the distance is below a preset safety threshold, generating a dynamic obstacle avoidance trajectory based on the drone's current position, current flight speed, and the static obstacle avoidance route, and controlling the drone to avoid obstacles based on the dynamic obstacle avoidance trajectory, includes:
[0022] Obtain the generation constraint framework of the dynamic obstacle avoidance trajectory, and determine the initial dynamic obstacle avoidance trajectory based on the current position, current flight speed, preset waypoint and generation constraint framework of the UAV;
[0023] The initial dynamic obstacle avoidance trajectory is subjected to collision detection processing based on the obstacle model. If there is a risk of collision, the initial dynamic obstacle avoidance trajectory is adjusted and optimized to obtain a dynamic obstacle avoidance trajectory.
[0024] Control the drone to switch from the static obstacle avoidance route to the dynamic obstacle avoidance trajectory, and control the drone to avoid obstacles according to the dynamic obstacle avoidance trajectory;
[0025] After the drone flies out of the obstacle's influence range and the distance between it and the obstacle returns to a safe threshold, the drone's route is switched to a static obstacle avoidance path.
[0026] In some embodiments, when the drone reaches the preset waypoint, controlling the drone to hover at the preset flight altitude and acquire inspection data includes:
[0027] The real-time location information of the UAV is compared with the location information of the preset waypoints in the static obstacle avoidance route. If the spatial distance is less than the preset distance threshold, it is determined that the UAV has reached the preset waypoint.
[0028] After the UAV reaches the preset waypoint, a hovering control command is generated based on the preset flight altitude to control the UAV to maintain the current preset flight altitude;
[0029] Trigger the drone's inspection data collection operation to collect inspection data.
[0030] In some embodiments, the fusion processing of the environmental data, the motion data, and the inspection boundary to obtain an environmental model includes:
[0031] The environmental data and the motion data are preprocessed respectively to obtain preprocessed environmental data and motion data;
[0032] The preprocessed environmental data and motion data are fused to obtain the initial dataset.
[0033] The initial dataset is filtered according to the inspection boundary to obtain a fused dataset;
[0034] An environment model is constructed based on the fused dataset. The environment model is used to characterize the terrain distribution, spatial structure, and obstacle location information within the inspection boundary.
[0035] This application provides an obstacle avoidance and inspection device for unmanned aerial vehicles, comprising:
[0036] The acquisition module is used to acquire configuration parameters, environmental data, and UAV motion data. The configuration parameters include inspection boundaries, obstacle boundaries, preset flight altitude, and preset flight path step size.
[0037] The processing module is used to fuse the environmental data, the motion data, and the inspection boundary to obtain an environmental model;
[0038] The determination module is used to determine a static obstacle avoidance route based on the environment model, the obstacle boundary, the preset flight altitude, and the preset route step size. The static obstacle avoidance route includes preset waypoints.
[0039] The processing module is also used to continuously fuse the environmental data and the motion data to obtain an effective dataset including the real-time location information of the UAV.
[0040] The determining module is also used to determine the coverage area of the real-time local environment map based on the real-time location information, obstacle avoidance warning distance and flight speed of the UAV;
[0041] The processing module is also used to generate a real-time local environment map based on the effective dataset and the coverage area;
[0042] The processing module is also used to extract preset obstacle features from the real-time local environment map and determine the obstacle model based on the preset obstacle features;
[0043] The acquisition module is also used to acquire the distance between the current flight path of the UAV and the obstacles in the obstacle model;
[0044] The determining module is further configured to generate a dynamic obstacle avoidance trajectory based on the current position and current flight speed of the UAV and the static obstacle avoidance route when the distance is lower than a preset safety threshold, and control the UAV to avoid obstacles based on the dynamic obstacle avoidance trajectory;
[0045] The acquisition module is also used to control the UAV to hover at the preset flight altitude when the UAV reaches the preset waypoint, and to acquire inspection data.
[0046] The computer device provided in this application includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements the method described in this application.
[0047] The computer-readable storage medium provided in this application embodiment stores a computer program thereon, which, when executed by a processor, implements the method described in this application embodiment.
[0048] This application provides a method, apparatus, device, and storage medium for obstacle avoidance and inspection of unmanned aerial vehicles (UAVs). It first acquires configuration parameters, point cloud environmental data, and motion data; then, through multi-source data fusion processing, it constructs an environmental model to accurately characterize the terrain and static obstacle positions in the inspection area, thereby determining a static obstacle avoidance flight path. Continuous fusion of environmental and motion data yields an effective dataset; combining obstacle avoidance warning distance and flight speed, it dynamically delineates the coverage area, generates a real-time local environmental map, and extracts features to construct an obstacle model, accurately identifying both static and dynamic obstacles. It calculates the path and obstacle distance in real time; when the distance is below a safety threshold, it generates a dynamic obstacle avoidance trajectory based on the UAV's current state and static flight path, smoothly reverting after obstacle avoidance; when the UAV reaches a preset waypoint, it hovers stably at a preset altitude to collect inspection data. This optimizes flight paths, significantly improves flight safety, ensures data reliability, and is applicable to complex scenarios such as bridges and tunnels, solving the technical problems mentioned in the background art. Attached Figure Description
[0049] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 A schematic diagram illustrating the implementation process of an obstacle avoidance and inspection method for a drone provided in this application embodiment;
[0051] Figure 2 A schematic diagram illustrating the implementation process of determining a static obstacle avoidance route, provided in an embodiment of this application;
[0052] Figure 3 This is a schematic diagram of the structure of an obstacle avoidance and inspection device for a drone provided in an embodiment of this application. Detailed Implementation
[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0054] The following description of some technologies involved in the embodiments of this application is provided to aid understanding and should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, some descriptions of well-known functions and structures are omitted in the following description.
[0055] Figure 1 This is a schematic diagram illustrating the implementation flow of an obstacle avoidance and inspection method for a drone provided in an embodiment of this application, including steps 101 to 107. Wherein, Figure 1 This is merely one execution order shown in the embodiments of this application and does not represent the only execution order for an obstacle avoidance and inspection method for UAVs. Where the final result can be achieved, Figure 1 The steps shown can be performed in parallel or in reverse order.
[0056] Step 101: Obtain configuration parameters, environmental data, and drone motion data.
[0057] In this embodiment, an obstacle avoidance and inspection method for unmanned aerial vehicles (UAVs) is applicable to autonomous inspection tasks in complex environments such as bridges and tunnels. Specifically, after the UAV is powered on, the onboard computer automatically starts and completes the initialization of various functional modules, including a multi-sensor data fusion module, a flight control module, a trajectory planning module, a mission payload control module, and a ground station communication module. After each module is initialized, it enters a standby state, wherein:
[0058] Sensors (such as lidar and inertial measurement units, IMUs) need to be pre-calibrated, and the communication module establishes a stable connection with the ground station via a wireless data link.
[0059] Based on the inspection mission requirements, the ground station sets and distributes configuration parameters to the airborne computer. These configuration parameters include:
[0060] Inspection boundary: Delineate the spatial scope of the inspection based on the coverage requirements of the inspection targets (such as bridges and tunnels).
[0061] Obstacle boundaries: Mark the spatial extent of known static obstacles within the inspection area.
[0062] Preset flight altitude: Set according to the structural characteristics of the inspection target (such as the height of the bridge bottom surface, the clearance of the tunnel) to avoid collisions between the drone and fixed structures.
[0063] Preset route step size: Used to control the distance between waypoints and the distribution density of adjacent routes to ensure that no inspection is missed.
[0064] Environmental data: collected continuously by sensors (such as lidar) carried by the drone before takeoff and during flight, which contains three-dimensional spatial information of the inspection area, reflecting the distribution of environmental terrain, fixed structures and potential obstacles.
[0065] Motion data: Collected in real time by the IMU, including the drone's angular velocity, linear acceleration, etc., to reflect the drone's real-time motion status and support positioning and data fusion.
[0066] Step 102: The environmental data, motion data, and inspection boundaries are fused to obtain the environmental model.
[0067] In this embodiment, a multi-sensor tightly coupled SLAM (Simultaneous Localization and Mapping) algorithm is employed to fuse environmental data, motion data, and inspection boundaries. Specifically, this includes data preprocessing: denoising and temporal synchronization of environmental and motion data to eliminate errors and biases in the original data. Spatial registration and fusion: establishing the correlation between environmental and motion data to generate an initial dataset containing environmental spatial information—the UAV's motion state. Range filtering and modeling: filtering invalid data based on inspection boundaries, retaining valid information within the inspection range, and constructing a 3D environmental model based on this valid information.
[0068] Step 103: Determine the static obstacle avoidance route based on the environment model, obstacle boundaries, preset flight altitude, and preset route step size. The static obstacle avoidance route includes preset waypoints.
[0069] In this embodiment, based on the environment model, obstacle boundaries, preset flight altitude, and preset route step size, the preset flight altitude is used as the vertical reference for the route to ensure the uniform vertical position of all waypoints. The preset route step size determines the waypoint spacing and the distribution density of adjacent routes. Within the effective inspection space of the environment model, a basic route (such as a zigzag route) covering the entire inspection area is generated.
[0070] If the basic route does not overlap with the obstacle boundary, the basic route is directly broken down into preset waypoints according to the preset route step size to form a static obstacle avoidance route.
[0071] If the basic route overlaps with the obstacle boundary, the obstacle avoidance algorithm plans a detour path along the obstacle boundary. After avoiding the obstacle, the route returns to the basic route direction and is then broken down into preset waypoints according to the preset route step size. Finally, a static obstacle avoidance route is formed and stored.
[0072] Step 104: Continuously fuse environmental data and motion data to obtain an effective dataset including the real-time location information of the UAV.
[0073] In this embodiment, an iterative Kalman filter framework is employed to continuously fuse environmental and motion data acquired in real time during flight. It continuously receives environmental data from the lidar (acquisition frequency adapted to sensor performance, such as 10-20Hz) and motion data from the IMU (acquisition frequency higher than point cloud data, such as 200Hz). Both types of data undergo real-time preprocessing. Environmental data is cleaned of noise points caused by rain, dust, etc. (retaining valid points with intensity above a preset threshold). Motion data undergoes zero-bias calibration (eliminating static drift errors). Timing synchronization of the two types of data is achieved based on a unified clock on the onboard computer (ensuring the same timestamp corresponds to the same flight state).
[0074] The preprocessed environmental and motion data are input into the iterative Kalman filter framework. Through the prediction-update loop of the filtering algorithm, the real-time position information (3D coordinates, including preset flight altitude) and flight attitude (pitch angle, roll angle, and heading angle) of the UAV are jointly estimated. At the same time, the environmental and motion data are spatially correlated with the estimated real-time position of the UAV, and the coordinates of each point cloud in the global coordinate system are marked. Finally, an effective dataset is formed that correlates the spatial coordinates of the point cloud, the real-time position of the UAV, and the flight attitude.
[0075] Step 105: Determine the coverage area of the real-time local environment map based on the drone's real-time location information, obstacle avoidance warning distance, and flight speed.
[0076] In this embodiment, the real-time location information of the UAV is used as the core benchmark, combined with the obstacle avoidance warning distance of the inspection scenario and the UAV's flight speed, to define the coverage area of the real-time local environment map. The current real-time position (3D coordinates) of the UAV is used as the spatial center of the coverage area, ensuring that the local map focuses on the core area around the UAV's flight path and avoids including irrelevant environmental data. The radius of the coverage area is determined based on the obstacle avoidance warning distance (a preset safe reaction distance, such as 1.5~3m, determined by the complexity of the inspection scenario) and the current flight speed of the UAV. The faster the flight speed, the larger the radius (e.g., a radius of 5m at 1m / s and 8m at 2m / s), ensuring that the UAV has sufficient time to respond to sudden obstacles. The shape of the coverage area is a spherical or cylindrical space centered on the current position of the UAV (the vertical range includes 1~2m above and below the preset flight height, adapting to the vertical obstacle risk of low-altitude flight).
[0077] Based on the defined coverage area, environmental and motion data outside the coverage area are filtered from the valid dataset, and only environmental and motion-related information within the coverage area is retained.
[0078] Step 106: Generate a real-time local environment map based on the valid dataset and coverage area.
[0079] In this embodiment, a real-time local environment map is constructed and dynamically updated based on an effective dataset and a defined coverage area. The specific implementation is as follows: A sparse incremental voxel map is used as the carrier of the real-time local environment map. The space within the coverage area is divided into discrete voxel units at a preset resolution (e.g., 0.1~0.2m). Each voxel unit is marked with its occupancy status based on filtered point cloud data (voxels containing point clouds are marked as occupied, and voxels without point clouds are marked as idle). During flight, as the UAV moves and new data is collected, the incremental voxel map is updated in real time: voxels corresponding to newly added environmental and motion data within the coverage area are marked as occupied, and voxels outside the original coverage area are gradually removed as the UAV moves, ensuring that the map always reflects the real-time environment surrounding the UAV, and that the computational load is concentrated only in a local area.
[0080] Step 107: Extract preset obstacle features from the real-time local environment map, and determine the obstacle model based on the preset obstacle features.
[0081] In this embodiment of the application, preset obstacle features are extracted from a real-time local environment map and integrated to form an obstacle model.
[0082] In response to the need for dynamic obstacle avoidance to identify sudden obstacles, the preset obstacle features include two categories. The first is spatial occupancy features: voxel clusters in the real-time local environment map that are occupied (such as continuous voxel areas with point cloud density higher than a preset threshold (such as 50 points / cubic meter), corresponding to sudden obstacles such as birds and temporary construction equipment); the second is distance anomaly features: areas where the distance between the voxel cluster and the current flight path of the UAV is less than the obstacle avoidance warning distance (i.e., potential collision risk areas).
[0083] Traverse the voxel units of the real-time local environment map, identify voxel clusters that meet the above preset characteristics, and mark the spatial range (three-dimensional coordinate boundary), contour shape (such as sphere, irregular shape) and real-time distance to the UAV for each voxel cluster.
[0084] Information on all identified obstacle areas is integrated to form a structured obstacle model. The obstacle model includes a unique identifier for each obstacle, its three-dimensional location, spatial extent, and relative distance to the drone.
[0085] Step 108: Obtain the distance between the current flight path of the drone and the obstacles in the obstacle model.
[0086] In this embodiment, a distance field model is constructed based on an obstacle model to calculate the static obstacle avoidance route, the distance between the UAV's current flight path and the obstacle in real time.
[0087] Step 109: When the distance is lower than the preset safety threshold, generate a dynamic obstacle avoidance trajectory based on the drone's current position, current flight speed, and static obstacle avoidance route, and control the drone to avoid obstacles according to the dynamic obstacle avoidance trajectory.
[0088] In this embodiment of the application, the initial dynamic trajectory is initialized using the current position and flight speed of the UAV as initial conditions and the subsequent waypoints of the static obstacle avoidance route as directional guidance.
[0089] By combining UAV dynamic constraints (such as speed and acceleration limits) with trajectory smoothness requirements, collision detection and adjustment optimization are performed on the initial trajectory to ensure that the trajectory avoids obstacles and meets flight performance requirements.
[0090] Switch the flight control target from the static obstacle avoidance path to the optimized dynamic obstacle avoidance trajectory to control the drone to avoid obstacles; after the drone leaves the obstacle's influence range and the distance recovers to above the safe threshold, smoothly switch back to the static obstacle avoidance path.
[0091] Step 1010: When the drone reaches the preset waypoint, control the drone to hover at the preset flight altitude to acquire inspection data.
[0092] In this embodiment, when the UAV approaches the preset waypoint of the static obstacle avoidance route, the distance between the current position of the UAV and the preset waypoint is compared in real time. If the distance meets the preset conditions, it is determined that the preset waypoint has been reached. Based on the preset flight altitude, a hovering command is generated to control the UAV to hover stably at the preset waypoint.
[0093] During hovering, the mission payload (such as the image acquisition unit) is triggered to perform inspection data acquisition operations. After the acquisition is completed, the data integrity is verified and the data is transmitted back to the ground station or local storage as needed.
[0094] Throughout the inspection process, the onboard computer maintains two-way data exchange with the ground station. The ground station receives real-time status information of the UAV (position, battery level, flight mode, etc.) and inspection data, and can issue parameter adjustment or emergency control commands (such as hovering or returning to home). After all preset waypoint tasks are completed, the ground station issues a landing command, and the UAV returns along the preset path and performs a landing. After landing, the flight control system performs a propeller lock operation, shuts down all functional modules, and completes the inspection task.
[0095] This application's embodiments first construct an environmental model based on environmental data, motion data, and inspection boundaries to determine static obstacle avoidance routes. Then, by combining real-time local environmental maps and obstacle models, the trajectory is dynamically adjusted. This ensures both the pre-planning of inspection routes and the ability to handle unexpected obstacles during flight, covering the full-scenario needs of UAV inspection from planning to execution. It explicitly controls the UAV to hover at a preset flight altitude to collect data when it reaches a preset waypoint, avoiding ambiguity in inspection data caused by position fluctuations and altitude changes during flight, ensuring the consistency and reliability of the collected inspection data. Deeply integrating environmental data, motion data, and inspection boundaries allows the constructed environmental model to accurately reflect the actual situation of the inspection area (such as terrain and obstacle distribution), providing a precise basis for static route planning. Furthermore, the local environmental map and obstacle model generated based on real-time data can update the UAV's perception of the surrounding environment in real time, ensuring the timeliness and accuracy of dynamic obstacle avoidance decisions.
[0096] In the above Figure 1 Based on the above, this application also provides a schematic diagram of the implementation process for determining a static obstacle avoidance route, as shown in the figure. Figure 2 As shown, steps 201 to 204 are included:
[0097] Step 201: Determine the effective inspection space based on the inspection boundary and the environmental model, and determine the vertical position reference of the static obstacle avoidance route based on the preset flight altitude.
[0098] In this embodiment, the inspection boundary is used as a spatial constraint, and invalid areas are filtered out by combining the environment model. For example, in bridge inspection, the inspection boundary is the coordinates of both ends of the bridge and the extended range on both sides (e.g., the total length of the bridge is 500m, and the extension range on both sides is 2m). Irrelevant point cloud data such as trees and ground buildings outside this range are removed from the environment model, and finally an effective inspection space that only covers the inspection task target is formed, ensuring that the subsequent route generation focuses on the bridge structure area that needs to be inspected.
[0099] The preset flight altitude is used as the sole vertical position reference for the static obstacle avoidance flight path. For example, based on the height of the bridge bottom (e.g., the bottom is 15m above the ground), the preset flight altitude is set to 10m. This means that the vertical coordinate (Z-axis) of all waypoints in the static obstacle avoidance flight path is fixed at 10m, thus avoiding collisions between the UAV and static structures such as the bridge bottom and supporting columns during flight.
[0100] Step 202: Generate a basic coverage route within the effective inspection space based on the preset route step length and vertical position reference.
[0101] In this embodiment of the application, a basic coverage route covering the entire inspection area is generated based on the above-mentioned effective inspection space and preset route step size.
[0102] The route pattern adopts a zigzag structure, extending along the length of the inspection target (such as the extension direction of a bridge). The horizontal spacing between adjacent routes is determined by the preset route step length (e.g., if the step length is set to 2m, then the horizontal spacing between adjacent zigzag routes is 2m).
[0103] The route generation logic is based on the complete coverage of the effective inspection space. For example, in bridge inspection, the zigzag route starts from one end of the bridge and covers the bottom surface of the bridge and the 2m area on both sides line by line to ensure that there are no blind spots in the inspection. The entire route is within the effective inspection space and does not exceed the inspection boundary.
[0104] Step 203: Determine whether the basic coverage route includes obstacle boundaries. If the basic coverage route does not include obstacle boundaries, decompose the basic coverage route into static obstacle avoidance routes including preset waypoints according to the preset route step size.
[0105] In this embodiment, the path coordinates of the basic coverage route are compared with the area coordinates corresponding to the obstacle boundaries by using obstacle location markers in the environment model. Whether the basic coverage route includes obstacle boundaries specifically refers to whether the path of the basic coverage route passes through the spatial area defined by the obstacle boundaries.
[0106] If the basic coverage route does not include obstacle boundaries (i.e., no path overlaps with obstacle areas), the basic coverage route is directly broken down into continuous preset waypoints according to the preset route step size. For example, if the step size is set to 2m, then a preset waypoint is set every 2m along the zigzag route. All waypoints are arranged in flight sequence to form a complete static obstacle avoidance route, which is then stored in the UAV's onboard computer for later use.
[0107] Step 204: If the basic coverage route includes the obstacle boundary, determine whether there is an overlapping area between the basic coverage route and the area corresponding to the obstacle boundary. If there is an overlapping area, adjust the overlapping area along the obstacle boundary and decompose the adjusted basic coverage route into a static obstacle avoidance route including preset waypoints according to the preset route step size.
[0108] In this embodiment of the application, if the basic coverage route includes obstacle boundaries, the overlapping section between the basic route and the obstacle boundary is determined by comparing the areas corresponding to the obstacle boundary through the environmental model (e.g., a certain section of the basic zigzag route passes through the coordinate range of the temporary support, and this section is the overlapping area).
[0109] An intelligent static obstacle avoidance strategy based on the Bug2 algorithm is adopted to adjust the overlapping areas. Using the original zigzag basic route as the ideal reference line, when the path enters the overlapping area, the control route detours along the outside of the obstacle boundary (leaving a safe distance, such as 0.5~1m) until the exit condition is found (i.e. the detour path extends to a non-overlapping area and the direction can return to the original basic route), and then continues to extend along the original basic route direction.
[0110] The basic coverage route after the detour adjustment is broken down into preset waypoints according to the preset route step size. For example, a waypoint is set every 2m along the detour section to ensure that the waypoints avoid obstacle areas (such as the waypoint corresponding to the temporary support is 1m away from the original route). The vertical coordinates of all waypoints remain at the preset flight altitude (10m), and finally a static obstacle avoidance route with static obstacle avoidance capability is formed and stored synchronously to the airborne computer and ground station.
[0111] This application's embodiments first determine the effective inspection space, preventing static routes from exceeding the inspection task range and ensuring the effectiveness of the routes. Simultaneously, by determining whether the basic coverage route includes obstacle boundaries and adjusting detours for overlapping areas, the impact of static obstacles on the route is directly avoided, ensuring that the static route itself possesses obstacle avoidance attributes, reducing flight risks from the source. The basic coverage route (or the adjusted basic coverage route) is decomposed into static obstacle avoidance routes containing preset waypoints according to a preset route step size. This transforms the abstract route into a precise sequence of waypoints that the UAV can execute, facilitating stable flight through point-by-point following and reducing flight deviations caused by the lack of clear route nodes. By fully considering obstacle boundaries and optimizing detours during the static route planning stage, the frequency of static obstacles triggering dynamic obstacle avoidance during flight is minimized, allowing the UAV to focus more on dealing with sudden dynamic obstacles and improving overall flight smoothness.
[0112] In some embodiments, when the distance is below a preset safety threshold, a dynamic obstacle avoidance trajectory is generated based on the current position, current flight speed, and static obstacle avoidance route of the UAV, and the UAV is controlled to avoid obstacles based on the dynamic obstacle avoidance trajectory, including: obtaining the generation constraint framework of the dynamic obstacle avoidance trajectory, and determining the initial dynamic obstacle avoidance trajectory based on the current position, current flight speed, preset waypoint, and generation constraint framework of the UAV.
[0113] Specifically, the constraint framework for generating dynamic obstacle avoidance trajectories must ensure the design principles of trajectory execution and low computational burden, and be determined in combination with the actual flight performance of the UAV, specifically including two types of core constraints.
[0114] Based on the drone's hardware parameters, including maximum flight speed, maximum acceleration / deceleration, and maximum turning radius, the generated trajectory is ensured to be within the range achievable by the drone's physical performance.
[0115] The trajectory should have no obvious inflection points and continuous curvature to avoid data acquisition ambiguity or flight instability caused by sudden changes in the drone's attitude.
[0116] The aforementioned constraint framework is pre-stored by the onboard computer and can be directly invoked when dynamic obstacle avoidance is triggered, without the need for real-time calculation, thus balancing low computational burden and real-time performance.
[0117] Based on the drone's current position, current flight speed, preset waypoints, and the generated constraint framework, the initial dynamic obstacle avoidance trajectory is generated according to the following logic:
[0118] The trajectory starts from the current position of the drone and the current flight speed (including magnitude and heading angle) is used as the initial motion state to ensure seamless connection between the trajectory start point and the real-time state of the drone, avoiding sudden speed changes during the transition.
[0119] The trajectory's endpoint direction is set at the next preset waypoint from the current position in the static obstacle avoidance path (rather than a fixed endpoint), ensuring that the original inspection route can be returned to after dynamic obstacle avoidance without interrupting the inspection task. For example, if the current position is waypoint A and the next preset waypoint is waypoint B, the initial trajectory extension direction is anchored to waypoint B to avoid deviating from the inspection path after obstacle avoidance.
[0120] The initial dynamic obstacle avoidance trajectory is constructed using a uniform B-spline curve. The starting point, the starting tangent (determined by the current velocity direction), and the intermediate control point of the anchoring direction (2-5m from the starting point, determined by the flight speed and obstacle avoidance warning distance) are used as key nodes. Combined with the constraint framework, the initial dynamic obstacle avoidance trajectory that meets the requirements of dynamic characteristics and smoothness is generated.
[0121] Furthermore, collision detection is performed on the initial dynamic obstacle avoidance trajectory based on the obstacle model. If there is a risk of collision, the initial dynamic obstacle avoidance trajectory is adjusted and optimized to obtain the dynamic obstacle avoidance trajectory.
[0122] Specifically, based on the obstacle model, collision detection and optimization are performed on the initial dynamic obstacle avoidance trajectory, as follows:
[0123] The path coordinates of the initial dynamic obstacle avoidance trajectory (discrete into multiple sampling points at 0.1m intervals) are spatially compared with the obstacle areas in the obstacle model (such as the spherical area corresponding to birds and the irregular area corresponding to temporary construction equipment) to determine whether there are any sampling points falling into the obstacle area. If so, the initial trajectory is determined to have a collision risk.
[0124] The control points of the initial B-spline curve are optimized based on the control point adjustment logic of the repulsion vector.
[0125] Identify the control point corresponding to the sampling point that overlaps with the obstacle, and calculate the repulsion vector of the control point pointing to the outside of the obstacle (the direction is the opposite direction of the line connecting the control point and the center of the obstacle, and the length is the safety threshold minus the current distance to ensure that the distance meets the standard after adjustment).
[0126] Move the corresponding control point along the repulsion vector so that all the adjusted trajectory sampling points are removed from the obstacle area.
[0127] After adjustment, the trajectory needs to be re-verified to ensure it meets the constraints of dynamic characteristics and trajectory smoothness. If the adjusted trajectory exceeds the maximum speed / acceleration limit or has a sudden change in curvature, the control point positions are further fine-tuned (e.g., shortening the repulsion vector length or adding intermediate control points) until the three objectives of collision-free dynamic compliance and smoothness are simultaneously met, ultimately resulting in a dynamic obstacle avoidance trajectory.
[0128] Furthermore, the drone can be controlled to switch from a static obstacle avoidance route to a dynamic obstacle avoidance trajectory, and the drone can be controlled to avoid obstacles according to the dynamic obstacle avoidance trajectory.
[0129] Specifically, the UAV flight controller module switches the flight control target from a static obstacle avoidance route to a dynamic obstacle avoidance trajectory. Through a USB to TTL interface and the MAVLink (Micro Air Vehicle Link) protocol, it transmits the real-time coordinates of the dynamic obstacle avoidance trajectory (updated at a frequency of 10Hz) to the flight control system.
[0130] Based on the received trajectory coordinates, the flight control system controls the drone's throttle, ailerons, elevators, and other actuators to adjust the drone's attitude (pitch angle, roll angle) and position, ensuring that the drone flies along a dynamic obstacle avoidance trajectory. For example, when encountering a bird obstacle, the system adjusts the roll angle to make the drone fly sideways away from the bird while maintaining a preset flight altitude, avoiding the risk of vertical collision.
[0131] Furthermore, after the drone flies out of the obstacle's influence range and the distance to the obstacle returns to a safe threshold, the drone's route is switched to a static obstacle avoidance path.
[0132] Specifically, after the drone flies along the dynamic obstacle avoidance trajectory to the point of being out of the obstacle's influence range, it switches back to the static obstacle avoidance route according to the following logic:
[0133] The distance between the drone and the obstacle is calculated in real time. When the distance recovers to the preset safety threshold + 0.5~1m of redundancy (e.g., if the safety threshold is 1.5m, it recovers to 2~2.5m), and the drone's flight direction can smoothly connect to the next preset waypoint of the static obstacle avoidance route, it is determined that the drone has escaped the obstacle's influence range.
[0134] The flight controller module gradually adjusts the endpoint of the dynamic obstacle avoidance trajectory to align it with the path of the next preset waypoint in the static obstacle avoidance route, thus avoiding sudden changes in trajectory. When the UAV flies to the junction of the dynamic trajectory and the static route, the control target is switched back to the static obstacle avoidance route to continue the inspection task, ensuring that the inspection process is continuous and uninterrupted.
[0135] This application's embodiments ensure that the initial dynamic obstacle avoidance trajectory conforms to the UAV's physical flight capabilities by acquiring a constraint framework, preventing the trajectory from exceeding the UAV's execution limits. Simultaneously, collision detection and adjustment optimization based on the obstacle model further eliminate potential collision risks in the initial trajectory, ensuring the safety of the dynamic trajectory. It is explicitly stated that once the UAV leaves the obstacle's influence range and the distance to the obstacle returns to a safe threshold, it switches back to a static obstacle avoidance route. This ensures the effectiveness of obstacle avoidance while preventing the UAV from deviating from its original inspection task after dynamic obstacle avoidance, ensuring the inspection task can be completed according to the preset plan, balancing obstacle avoidance requirements and task requirements. By collaboratively generating a dynamic trajectory using multiple parameters including current position, current flight speed, and the static obstacle avoidance route, dynamic obstacle avoidance not only avoids obstacles but also incorporates the UAV's current flight state and the original route target, avoiding flight chaos caused by obstacle avoidance for its own sake, enabling the UAV to maintain stable flight even in complex obstacle environments.
[0136] In some embodiments, when the UAV reaches a preset waypoint, the UAV is controlled to hover at a preset flight altitude to acquire inspection data, including: comparing the real-time position information of the UAV with the position information of the preset waypoint in the static obstacle avoidance route, and determining that the UAV has reached the preset waypoint when the spatial distance is less than a preset distance threshold. In this embodiment, the preset distance threshold can be 0.1m.
[0137] Specifically, the onboard computer compares the real-time location information of the UAV with the location information of preset waypoints in the static obstacle avoidance route.
[0138] The output is generated by an iterative Kalman filter framework and includes three-dimensional coordinates (X-axis: horizontal vertical, Y-axis: horizontal horizontal, Z-axis: vertical height), where the Z-axis coordinate is matched in real time with the preset flight altitude (e.g., 15m).
[0139] The preset waypoint location information is the waypoint coordinates that are decomposed when generating the static obstacle avoidance route. It also includes three-dimensional coordinates, and the Z-axis coordinate is completely consistent with the preset flight altitude (ensuring no deviation in the vertical direction).
[0140] Both types of data are based on the same global coordinate system, avoiding judgment errors caused by differences in coordinate systems.
[0141] Using the Euclidean distance formula, the three-dimensional spatial distance between the UAV's real-time position and the target preset waypoint is calculated in real time. If the calculated spatial distance is less than 0.1m and this state remains stable for 100ms (to avoid misjudgment due to instantaneous errors), the onboard computer determines that the UAV has reached the preset waypoint.
[0142] Furthermore, after the drone reaches the preset waypoint, a hovering control command is generated based on the preset flight altitude to control the drone to maintain the current preset flight altitude.
[0143] Specifically, after determining that the UAV has reached the preset waypoint, the preset flight altitude is used as the only vertical reference. Minor fluctuations in the Z-axis direction are ignored, and the Z-axis target value of the hovering control command is fixed at the preset flight altitude to avoid collisions with the inspection target caused by vertical adjustments.
[0144] By using real-time angular velocity and linear acceleration data collected by the IMU, the ailerons and rudder of the UAV are adjusted to keep the horizontal position (X and Y axes) stable within ±0.05m of the preset waypoint coordinates, thus avoiding drift.
[0145] The current altitude is monitored in real time by a barometric altimeter (auxiliary IMU data), and the throttle is adjusted to keep the Z-axis altitude stable within the preset flight altitude range of ±0.03m.
[0146] Ultimately, the drone can hover in three dimensions at a preset waypoint, maintaining a fixed altitude, attitude, and position. The duration of the hovering state can be set according to the inspection requirements.
[0147] Furthermore, it triggers the drone's inspection data collection operation to collect inspection data.
[0148] Specifically, after the UAV maintains a stable hover, the onboard computer triggers the mission payload control module to perform inspection data acquisition. The onboard computer sends an acquisition command to the mission payload control module, which includes the acquisition type (such as image acquisition or video acquisition, which is preset by the inspection mission) and acquisition parameters (image acquisition resolution is 1920×1080 pixels, video acquisition frame rate is 30fps). After receiving the command, the mission payload control module sends a PWM control signal to the image acquisition unit through the flight control system to start data acquisition.
[0149] After data acquisition is completed, the task load control module performs real-time integrity verification on the data. Image data is verified for clarity (grayscale variance greater than 100, excluding blurry images), and video data is verified for duration (ensuring the preset acquisition duration is met). If the verification passes, the data is marked as valid inspection data; if the verification fails, a re-acquisition is triggered (only one re-acquisition is performed to avoid delaying the inspection process).
[0150] Valid inspection data is named according to the waypoint number-collection time rule, and the data is transmitted back to the ground station in real time through the ground station communication module, realizing dual protection of local backup and remote storage to avoid data loss.
[0151] This application's embodiments compare the real-time location information of the UAV with the preset waypoint location information, using a spatial distance less than a preset distance threshold as the criterion for determining waypoint arrival, rather than simply relying on time or flight mileage. This accurately identifies whether the UAV has truly reached the target waypoint, avoiding problems such as false triggering of data collection when the waypoint is not reached or failure to trigger collection when the waypoint is reached due to flight speed fluctuations or airflow interference. After determining that the UAV has reached the waypoint, a dedicated hovering control command is generated based on a preset flight altitude, rather than relying on the UAV's own coarse hovering. This ensures that the UAV maintains a fixed altitude and position during data collection, avoiding inspection data deviations caused by altitude drift and position sway, and providing stable flight state support for high-quality inspection data collection. Through the fixed process of waypoint arrival-hovering-triggered collection, the triggering conditions for data collection are clear and can be automatically executed without manual intervention, reducing the delay and error of manual operation and improving the automation level and overall execution efficiency of the inspection task.
[0152] In some embodiments, environmental data, motion data, and inspection boundaries are fused to obtain an environmental model, including: preprocessing the environmental data and motion data respectively to obtain preprocessed environmental data and motion data.
[0153] Specifically, based on the characteristics of environmental data (LiDAR point cloud) and motion data (IMU data), preprocessing methods are used to eliminate errors and interference in the original data.
[0154] Based on the point cloud intensity threshold, low-intensity noise points caused by rain, dust, birds, and other interference are filtered out, while retaining effective point clouds that reflect the inspection targets (such as bridge structures and ground topography).
[0155] A voxel grid downsampling algorithm (with voxel resolution set to 0.05~0.1m) is used to reduce the amount of data while preserving the core features of the point cloud (such as the outline of bridge support columns and the texture of tunnel walls).
[0156] The point cloud data is converted to body coordinates consistent with the IMU.
[0157] In the static state before the drone takes off, the static output data of the IMU is collected (lasting 10~30 seconds), the zero bias values of angular velocity and linear acceleration are calculated, and the zero bias is subtracted from the raw data in real time to eliminate static drift error.
[0158] Based on the unified hardware clock of the airborne computer, the timestamps of IMU data and LiDAR point cloud data are aligned to ensure that the same timestamp corresponds to the same flight state of the UAV, avoiding fusion deviations caused by timing misalignment.
[0159] Furthermore, the preprocessed environmental data and motion data are fused together to obtain the initial dataset.
[0160] Specifically, a multi-sensor tightly coupled SLAM algorithm is used to establish the correlation between preprocessed point cloud data and IMU data, generating an initial dataset containing environment-motion correlation information.
[0161] The preprocessed IMU data is input into the front-end odometry module of the SLAM algorithm, and the instantaneous position (three-dimensional coordinates) and flight attitude (pitch angle, roll angle, and heading angle) of the UAV are estimated in real time through inertial navigation calculation.
[0162] The preprocessed lidar point cloud data is spatially registered with the UAV position and attitude estimated by the IMU. Using the UAV's instantaneous position as the origin and combining the flight attitude, the point cloud data in the body coordinate system is transformed to the global coordinate system, and the coordinates of each point cloud in the global coordinate system are marked.
[0163] The point cloud coordinates in the global coordinate system are associated and stored with the UAV's position and attitude at the corresponding timestamps to form an initial dataset. The initial dataset contains both the environmental spatial information (point cloud distribution) of the inspection area and the relative positional relationship between the UAV and the environment.
[0164] Furthermore, the initial dataset is filtered based on the inspection boundaries to obtain a fused dataset.
[0165] Specifically, the inspection boundary parameters issued by the ground station are converted into spatial range thresholds in the global coordinate system.
[0166] Iterate through each point cloud in the initial dataset and determine whether its global coordinates are within the spatial range of the inspection boundary. If the point cloud coordinates exceed the boundary (such as the point cloud of trees outside a bridge or ground building), remove it from the dataset; if they are within the boundary, retain the point cloud and its associated UAV motion state information.
[0167] The filtered valid point cloud-motion state correlation data are integrated to form a fused dataset. The fused dataset contains only valid information within the inspection boundary, eliminating irrelevant environmental interference, which reduces the computational load of subsequent modeling and ensures that the model focuses on the inspection task objective.
[0168] Furthermore, an environmental model is constructed based on the fused dataset. This environmental model is used to characterize the terrain distribution, spatial structure, and obstacle location information within the inspection boundary.
[0169] Specifically, the effective point clouds in the fused dataset are stitched together. The backend optimization module of the SLAM algorithm eliminates the accumulated errors of point clouds with different timestamps, forming a globally dense point cloud within the inspection boundary.
[0170] Based on global dense point clouds, the terrain distribution features (such as the undulation height of the ground under the bridge and the slope of the tunnel bottom) and spatial structure features (such as the spacing of the bridge support columns and the cross-sectional dimensions of the tunnel) of the inspection area are extracted. Then, through mesh rendering technology, the point cloud is converted into a visualized three-dimensional mesh model to intuitively reflect the environmental morphology.
[0171] Based on the obstacle boundaries (known static obstacle range), mark the spatial location of obstacles in the 3D mesh model. For example, mark the mesh areas corresponding to known obstacles such as temporary construction supports for bridges and pipelines in tunnels as obstacle areas, and store their coordinate range and outline dimensions.
[0172] The three-dimensional mesh model, which includes terrain distribution, spatial structure, and obstacle locations, is stored in the airborne computer and simultaneously transmitted back to the ground station via a communication link.
[0173] This application embodiment improves the reliability of the original data by preprocessing environmental and motion data separately, avoiding interference from poor-quality data in subsequent fusion results. Simultaneously, the initial dataset is filtered based on the inspection boundary, retaining only valid data within the inspection area and eliminating redundant data outside the area. This ensures the constructed environmental model focuses on the inspection task itself, avoiding model bloat or bias caused by irrelevant information. The environmental model clearly represents the terrain distribution, spatial structure, and obstacle location information within the inspection boundary, covering the core environmental parameters required for UAV static flight path planning. Terrain distribution determines whether the flight path needs to adapt to altitude changes, spatial structure determines the path selection, and obstacle location information determines whether obstacle avoidance is required. The combination of these three factors provides a comprehensive basis for static obstacle avoidance flight path planning, ensuring the scientific nature of the static flight path planning. Through a standardized process of preprocessing-fusion-filtering-modeling, the constructed environmental model is characterized by reliable data, comprehensive information, and accurate range, accurately reproducing the actual environment of the inspection area. This allows the subsequent static obstacle avoidance flight path determined based on this model to closely match the actual scenario, reducing flight path planning errors caused by model inaccuracies.
[0174] While this application provides the method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive labor. The order of steps listed in this embodiment is merely one possible execution order among many and does not represent the only execution order. In actual device or client product execution, the methods shown in this embodiment or the accompanying drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).
[0175] like Figure 3 As shown in the illustration, this application also provides an obstacle avoidance and inspection device 300 for unmanned aerial vehicles (UAVs). The device includes:
[0176] The acquisition module 301 is used to acquire configuration parameters, environmental data, and UAV motion data. The configuration parameters include inspection boundaries, obstacle boundaries, preset flight altitude, and preset flight path step length.
[0177] The processing module 302 is used to fuse environmental data, motion data and inspection boundaries to obtain an environmental model.
[0178] The determination module 303 is used to determine the static obstacle avoidance route based on the environment model, obstacle boundaries, preset flight altitude and preset route step size. The static obstacle avoidance route includes preset waypoints.
[0179] The processing module 302 is also used to continuously fuse environmental data and motion data to obtain an effective dataset including the real-time location information of the UAV.
[0180] The determination module 303 is also used to determine the coverage area of the real-time local environment map based on the UAV's real-time location information, obstacle avoidance warning distance, and flight speed.
[0181] The processing module 302 is also used to generate a real-time local environment map based on the valid dataset and coverage area.
[0182] The processing module 302 is also used to extract preset obstacle features from the real-time local environment map and determine the obstacle model based on the preset obstacle features.
[0183] The acquisition module 301 is also used to acquire the distance between the current flight path of the UAV and the obstacles in the obstacle model.
[0184] The determination module 303 is also used to generate a dynamic obstacle avoidance trajectory based on the current position, current flight speed and static obstacle avoidance route of the UAV when the distance is lower than a preset safety threshold, and to control the UAV to avoid obstacles based on the dynamic obstacle avoidance trajectory.
[0185] The acquisition module 301 is also used to control the UAV to hover at a preset flight altitude when the UAV reaches the preset waypoint, so as to acquire inspection data.
[0186] In some embodiments, the determining module 303 is further configured to determine the effective inspection space based on the inspection boundary and the environmental model, and to determine the vertical position reference of the static obstacle avoidance route based on the preset flight altitude.
[0187] The acquisition module 301 is also used to generate a basic coverage route within the effective inspection space based on the preset route step length and vertical position reference.
[0188] The determination module 303 is also used to determine whether the basic coverage route includes obstacle boundaries. If the basic coverage route does not include obstacle boundaries, the basic coverage route is decomposed into static obstacle avoidance routes including preset waypoints according to the preset route step size.
[0189] The determination module 303 is also used to determine whether there is an overlapping area between the basic coverage route and the area corresponding to the obstacle boundary when the basic coverage route includes the obstacle boundary. If there is an overlapping area, the overlapping area is adjusted to bypass the obstacle boundary, and the adjusted basic coverage route is decomposed into a static obstacle avoidance route including preset waypoints according to the preset route step size.
[0190] In some embodiments, the acquisition module 301 is further configured to acquire the generation constraint framework of the dynamic obstacle avoidance trajectory and determine the initial dynamic obstacle avoidance trajectory based on the current position of the UAV, the current flight speed, the preset waypoint and the generation constraint framework.
[0191] The processing module 302 is also used to perform collision detection processing on the initial dynamic obstacle avoidance trajectory based on the obstacle model, and to adjust and optimize the initial dynamic obstacle avoidance trajectory when there is a collision risk, so as to obtain the dynamic obstacle avoidance trajectory.
[0192] The processing module 302 is also used to control the UAV to switch from a static obstacle avoidance route to a dynamic obstacle avoidance trajectory, and to control the UAV to avoid obstacles according to the dynamic obstacle avoidance trajectory.
[0193] The processing module 302 is also used to control the drone's route to switch to a static obstacle avoidance route after the drone flies out of the obstacle's influence range and the distance between the drone and the obstacle returns to a safe threshold.
[0194] In some embodiments, the processing module 302 is further configured to compare the real-time location information of the UAV with the location information of the preset waypoints in the static obstacle avoidance route, and determine that the UAV has reached the preset waypoint when the spatial distance is less than the preset distance threshold.
[0195] The determination module 303 is also used to generate hovering control commands based on the preset flight altitude after the UAV reaches the preset waypoint, and control the UAV to maintain the current preset flight altitude.
[0196] The processing module 302 is also used to trigger the inspection data collection operation of the UAV and collect inspection data.
[0197] In some embodiments, the processing module 302 is further configured to preprocess the environmental data and motion data respectively to obtain preprocessed environmental data and motion data.
[0198] The processing module 302 is also used to fuse the preprocessed environmental data and motion data to obtain an initial dataset.
[0199] The processing module 302 is also used to filter the initial dataset according to the inspection boundary to obtain the fused dataset.
[0200] The determination module 303 is also used to build an environment model based on the fused dataset. The environment model is used to characterize the terrain distribution, spatial structure and obstacle location information within the inspection boundary.
[0201] Some modules in the apparatus described in this application can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0202] The apparatus or module described in the above embodiments can be implemented by a computer chip or physical entity, or by a product with a certain function. For ease of description, the above apparatus is described by dividing it into various modules according to their functions. When implementing the embodiments of this application, the functions of each module can be implemented in one or more software and / or hardware. Of course, a module that implements a certain function can also be implemented by combining multiple sub-modules or sub-units.
[0203] The methods, apparatus, or modules described in this application can be implemented in a computer-readable program code manner. The controller can be implemented in any suitable manner, such as a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of a memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code manner, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included within it for implementing various functions can also be considered as structures within the hardware component. Alternatively, the device used to implement various functions can be viewed as either a software module that implements the method or a structure within a hardware component.
[0204] This application also provides an apparatus, the apparatus comprising: a processor; a memory for storing processor-executable instructions; wherein, when the processor executes the executable instructions, it implements the method described in this application.
[0205] This application also provides a non-volatile computer-readable storage medium storing a computer program or instructions thereon, which, when executed, enables the method described in this application embodiment to be implemented.
[0206] Furthermore, in the various embodiments of the present invention, each functional module can be integrated into a processing module, or each module can exist independently, or two or more modules can be integrated into a single module.
[0207] The aforementioned storage media include, but are not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), Cache, Hard Disk Drive (HDD), or Memory Card. The memory can be used to store computer program instructions.
[0208] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary hardware. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, or it can be embodied in the process of data migration. The computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, mobile terminal, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0209] The various embodiments described in this specification are presented in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. All or part of this application can be used in numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, mobile communication terminals, multiprocessor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices, etc.
[0210] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of this application.
Claims
1. A method for obstacle avoidance and inspection of unmanned aerial vehicles (UAVs), characterized in that, include: Acquire configuration parameters, environmental data, and UAV motion data. The configuration parameters include inspection boundaries, obstacle boundaries, preset flight altitude, and preset flight path step length. The preset flight path step length is used to characterize the horizontal distance between adjacent inspection coverage routes and the interval distance between waypoints when the route is broken down. The environmental data, the motion data, and the inspection boundary are fused to obtain an environmental model. A static obstacle avoidance route is determined based on the environment model, the obstacle boundary, the preset flight altitude, and the preset route step size. The static obstacle avoidance route includes preset waypoints. The environmental data and the motion data are continuously fused to obtain an effective dataset including the real-time location information of the UAV. The coverage area of the real-time local environment map is determined based on the real-time location information, obstacle avoidance warning distance, and flight speed of the UAV. A real-time local environment map is generated based on the valid dataset and the coverage area. Preset obstacle features are extracted from the real-time local environment map, and an obstacle model is determined based on the preset obstacle features; Obtain the distance between the current flight path of the drone and the obstacles in the obstacle model; When the distance is lower than a preset safety threshold, a dynamic obstacle avoidance trajectory is generated based on the drone's current position, current flight speed, and the static obstacle avoidance route, and the drone is controlled to avoid obstacles based on the dynamic obstacle avoidance trajectory; When the drone reaches the preset waypoint, control the drone to hover at the preset flight altitude to acquire inspection data; The step of determining a static obstacle avoidance route based on the environment model, the obstacle boundary, the preset flight altitude, and the preset route step size includes: The effective inspection space is determined based on the inspection boundary and the environmental model, and the vertical position reference of the static obstacle avoidance route is determined based on the preset flight altitude. A basic coverage route is generated within the effective inspection space based on the preset route step size and the vertical position reference. Determine whether the basic coverage route includes the obstacle boundary. If the basic coverage route does not include the obstacle boundary, decompose the basic coverage route into a static obstacle avoidance route including a preset waypoint according to the preset route step size. When the basic coverage route includes the obstacle boundary, it is determined whether there is an overlapping area between the basic coverage route and the area corresponding to the obstacle boundary. If there is an overlapping area, the overlapping area is adjusted to bypass the obstacle boundary, and the adjusted basic coverage route is decomposed into a static obstacle avoidance route including a preset waypoint according to the preset route step length. When the distance is below a preset safety threshold, a dynamic obstacle avoidance trajectory is generated based on the drone's current position, current flight speed, and the static obstacle avoidance route. The drone is then controlled to avoid obstacles according to the dynamic obstacle avoidance trajectory, including: A dynamic obstacle avoidance trajectory generation constraint framework is obtained, which includes UAV dynamic constraints and trajectory smoothness constraints. The UAV dynamic constraints include the UAV's maximum flight speed, maximum acceleration, maximum deceleration, and maximum turning radius. The trajectory smoothness constraint is that the trajectory has no obvious inflection points and the curvature is continuous. The initial dynamic obstacle avoidance trajectory is determined based on the current position, current flight speed, preset waypoints, and generated constraint framework of the UAV. The initial dynamic obstacle avoidance trajectory is subjected to collision detection processing based on the obstacle model, including: discretizing the initial dynamic obstacle avoidance trajectory into multiple sampling points; comparing the spatial coordinates of the sampling points with the obstacle area in the obstacle model to determine whether there is a collision risk; if there is a collision risk, adjusting the control points of the initial dynamic obstacle avoidance trajectory based on the repulsion vector so that all the sampling points of the adjusted trajectory are removed from the obstacle area; verifying whether the adjusted trajectory conforms to the generated constraint framework until the trajectory simultaneously satisfies the requirements of no collision risk, conforms to UAV dynamics constraints, and trajectory smoothness, thus obtaining the dynamic obstacle avoidance trajectory; Control the drone to switch from the static obstacle avoidance route to the dynamic obstacle avoidance trajectory, and control the drone to avoid obstacles according to the dynamic obstacle avoidance trajectory; After the drone flies out of the obstacle's influence range and the distance between it and the obstacle returns to a safe threshold, the drone's route is switched to a static obstacle avoidance path.
2. The method according to claim 1, characterized in that, When the drone reaches the preset waypoint, the drone is controlled to hover at the preset flight altitude to acquire inspection data, including: The real-time location information of the UAV is compared with the location information of the preset waypoints in the static obstacle avoidance route. If the spatial distance is less than the preset distance threshold, it is determined that the UAV has reached the preset waypoint. After the UAV reaches the preset waypoint, a hovering control command is generated based on the preset flight altitude to control the UAV to maintain the current preset flight altitude; Trigger the drone's inspection data collection operation to collect inspection data.
3. The method according to claim 1, characterized in that, The process of fusing the environmental data, the motion data, and the inspection boundary to obtain the environmental model includes: The environmental data and the motion data are preprocessed respectively to obtain preprocessed environmental data and motion data; The preprocessed environmental data and motion data are fused to obtain the initial dataset. The initial dataset is filtered according to the inspection boundary to obtain a fused dataset; An environment model is constructed based on the fused dataset. The environment model is used to characterize the terrain distribution, spatial structure, and obstacle location information within the inspection boundary.
4. An obstacle avoidance and inspection device for unmanned aerial vehicles (UAVs), characterized in that, include: The acquisition module is used to acquire configuration parameters, environmental data, and UAV motion data. The configuration parameters include inspection boundaries, obstacle boundaries, preset flight altitude, and preset flight path step size. The processing module is used to fuse the environmental data, the motion data, and the inspection boundary to obtain an environmental model; The determination module is used to determine a static obstacle avoidance route based on the environment model, the obstacle boundary, the preset flight altitude, and the preset route step size. The static obstacle avoidance route includes preset waypoints. The processing module is also used to continuously fuse the environmental data and the motion data to obtain an effective dataset including the real-time location information of the UAV. The determining module is also used to determine the coverage area of the real-time local environment map based on the real-time location information, obstacle avoidance warning distance and flight speed of the UAV; The processing module is also used to generate a real-time local environment map based on the effective dataset and the coverage area; The processing module is also used to extract preset obstacle features from the real-time local environment map and determine the obstacle model based on the preset obstacle features; The acquisition module is also used to acquire the distance between the current flight path of the UAV and the obstacles in the obstacle model; The determining module is further configured to generate a dynamic obstacle avoidance trajectory based on the current position and current flight speed of the UAV and the static obstacle avoidance route when the distance is lower than a preset safety threshold, and control the UAV to avoid obstacles based on the dynamic obstacle avoidance trajectory; The acquisition module is also used to control the UAV to hover at the preset flight altitude and acquire inspection data when the UAV reaches the preset waypoint; The determining module is further configured to determine a static obstacle avoidance route based on the environment model, the obstacle boundary, the preset flight altitude, and the preset route step size, wherein: The effective inspection space is determined based on the inspection boundary and the environmental model, and the vertical position reference of the static obstacle avoidance route is determined based on the preset flight altitude. A basic coverage route is generated within the effective inspection space based on the preset route step size and the vertical position reference. Determine whether the basic coverage route includes the obstacle boundary. If the basic coverage route does not include the obstacle boundary, decompose the basic coverage route into a static obstacle avoidance route including a preset waypoint according to the preset route step size. When the basic coverage route includes the obstacle boundary, it is determined whether there is an overlapping area between the basic coverage route and the area corresponding to the obstacle boundary. If there is an overlapping area, the overlapping area is adjusted to bypass the obstacle boundary, and the adjusted basic coverage route is decomposed into a static obstacle avoidance route including a preset waypoint according to the preset route step length. The processing module is further configured to, when the distance is below a preset safety threshold, generate a dynamic obstacle avoidance trajectory based on the drone's current position, current flight speed, and the static obstacle avoidance route, and control the drone to avoid obstacles based on the dynamic obstacle avoidance trajectory, including: A dynamic obstacle avoidance trajectory generation constraint framework is obtained, which includes UAV dynamic constraints and trajectory smoothness constraints. The UAV dynamic constraints include the UAV's maximum flight speed, maximum acceleration, maximum deceleration, and maximum turning radius. The trajectory smoothness constraint is that the trajectory has no obvious inflection points and the curvature is continuous. The initial dynamic obstacle avoidance trajectory is determined based on the current position, current flight speed, preset waypoints, and generated constraint framework of the UAV. The initial dynamic obstacle avoidance trajectory is subjected to collision detection processing based on the obstacle model, including: discretizing the initial dynamic obstacle avoidance trajectory into multiple sampling points; comparing the spatial coordinates of the sampling points with the obstacle area in the obstacle model to determine whether there is a collision risk; if there is a collision risk, adjusting the control points of the initial dynamic obstacle avoidance trajectory based on the repulsion vector so that all the sampling points of the adjusted trajectory are removed from the obstacle area; verifying whether the adjusted trajectory conforms to the generated constraint framework until the trajectory simultaneously satisfies the requirements of no collision risk, conforms to UAV dynamics constraints, and trajectory smoothness, thus obtaining the dynamic obstacle avoidance trajectory; Control the drone to switch from the static obstacle avoidance route to the dynamic obstacle avoidance trajectory, and control the drone to avoid obstacles according to the dynamic obstacle avoidance trajectory; After the drone flies out of the obstacle's influence range and the distance between it and the obstacle returns to a safe threshold, the drone's route is switched to a static obstacle avoidance path.
5. A computer device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 3.