Obstacle avoidance method and device, unmanned aerial vehicle and storage medium
By using high-precision map data and detection equipment to detect obstacles during drone flight, the drone can transition to obstacle avoidance flight mode in advance, solving the problem of reduced flight speed caused by the activation of obstacle avoidance function, and achieving efficient and safe drone operation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU XAIRCRAFT TECH CO LTD
- Filing Date
- 2022-08-31
- Publication Date
- 2026-07-03
Smart Images

Figure CN117687419B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of unmanned aerial vehicles (UAVs), and more specifically, to an obstacle avoidance method, device, UAV, and storage medium. Background Technology
[0002] Current drone obstacle avoidance solutions rely on radar for obstacle detection. However, radar typically has a limited field of view and effective detection range. To ensure the drone has sufficient distance to avoid obstacles detected by radar, the drone's flight speed is limited when the obstacle avoidance function is activated.
[0003] In other words, although drones currently have obstacle avoidance capabilities, activating these capabilities reduces flight speed. For example, without obstacle avoidance, a drone's speed is 13.8 m / s, but with obstacle avoidance enabled, the speed is limited to 8 m / s. Therefore, users often avoid activating obstacle avoidance in pursuit of higher operational efficiency, which can easily lead to safety accidents. Summary of the Invention
[0004] The purpose of this application is to provide an obstacle avoidance method, device, drone, and storage medium that can perform efficient and safe operations regardless of whether the user enables the obstacle avoidance function.
[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0006] In a first aspect, embodiments of this application provide an obstacle avoidance method, the method comprising:
[0007] Obtain high-precision map data of the area to be flown;
[0008] Based on the high-precision map data, the presence of obstacles within the state adjustment distance is periodically detected; wherein, the state adjustment distance is the distance required for the UAV to transition from the current flight state to the obstacle avoidance flight state;
[0009] If an obstacle is detected within the state adjustment distance, the drone is controlled to transition to the obstacle avoidance flight state.
[0010] Optionally, the step of periodically detecting whether there are obstacles within the state adjustment distance based on the high-precision map data includes:
[0011] For each detection cycle, starting from the current position of the UAV, obstacle detection is performed using a sliding window of a set size based on the high-precision map data;
[0012] If an obstacle is detected within the current sliding window, then the state adjustment distance is determined to be within the obstacle.
[0013] If no obstacle is detected within the current sliding window, the sliding window continues to move until the detection of the state adjustment distance is completed.
[0014] Optionally, the step of detecting obstacles using a sliding window of a set size based on the high-precision map data includes:
[0015] Multiple sampling points are determined within the current sliding window using an equal-interval sampling method;
[0016] The height data of each sampling point is obtained from the high-precision map data;
[0017] Obstacle detection is performed on the current sliding window based on the height data of each sampling point.
[0018] Optionally, the step of performing obstacle detection on the current sliding window based on the height data of each of the sampling points includes:
[0019] Based on the height data of each sampling point, obtain the maximum and minimum height values within the current sliding window;
[0020] If the height difference between the maximum height and the minimum height is greater than or equal to the height jump threshold, and the maximum height is greater than or equal to the current flight altitude of the drone, then it is determined that there is an obstacle within the current sliding window.
[0021] Optionally, the method further includes:
[0022] After the drone transitions to the obstacle avoidance flight state, the actual position of the obstacle is determined by the detection device, and the drone is controlled to avoid the obstacle based on the actual position.
[0023] Optionally, the high-precision map data includes obstacle information within the area to be flown;
[0024] The step of periodically detecting whether there are obstacles within the state adjustment distance based on the high-precision map data includes:
[0025] For each detection cycle, the presence of an obstacle within the state adjustment distance is determined based on the obstacle information.
[0026] Optionally, if an obstacle is detected within the state adjustment distance, the reference position of the obstacle is determined based on the obstacle information;
[0027] When the drone is at a set distance from the reference position, a detection device is used to confirm whether there are obstacles at the reference position;
[0028] When an obstacle is confirmed at the reference location, the actual distance between the obstacle and the drone is determined by the detection device, and the drone is controlled to avoid the obstacle based on the actual distance.
[0029] Optionally, if no obstacle is detected within the state adjustment distance and the UAV has performed a state adjustment operation, then the UAV is controlled to revert from its current flight state to the flight state before the state adjustment operation; and / or,
[0030] If no obstacle is detected within the state adjustment distance and the UAV has not performed the state adjustment operation, then the UAV is controlled to maintain the current flight state and continue flying.
[0031] Optionally, obstacle detection within the state adjustment distance is performed on the current flight path of the UAV.
[0032] Optionally, the obstacle avoidance flight state includes an obstacle avoidance speed, which is obtained by:
[0033] The obstacle avoidance speed is determined based on at least one of the map resolution and map update time of the high-precision map data;
[0034] Wherein, the higher the map resolution, the closer the obstacle avoidance speed is to the first preset speed; the lower the map resolution, the closer the obstacle avoidance speed is to the second preset speed; the first preset speed is lower than the second preset speed;
[0035] The closer the map update time is to the time of the current flight of the drone, the closer the obstacle avoidance speed is to the first set speed; the further the map update time is from the time of the current flight of the drone, the closer the obstacle avoidance speed is to the second set speed.
[0036] Optionally, the obstacle avoidance flight state includes an obstacle avoidance speed, which is obtained by:
[0037] The initial obstacle avoidance speed is determined based on at least one of the map resolution and map update time of the high-precision map data;
[0038] Wherein, the higher the map resolution, the closer the initial obstacle avoidance speed is to the first preset speed; the lower the map resolution, the closer the initial obstacle avoidance speed is to the second preset speed; the first preset speed is lower than the second preset speed;
[0039] The closer the map update time is to the time of the current flight of the drone, the closer the initial obstacle avoidance speed is to the first set speed; the further the map update time is from the time of the current flight of the drone, the closer the initial obstacle avoidance speed is to the second set speed.
[0040] The initial obstacle avoidance speed is adjusted based on the detection distance of the detection device to obtain the obstacle avoidance speed, wherein the detection distance is positively correlated with the obstacle avoidance speed.
[0041] Secondly, embodiments of this application also provide an obstacle avoidance device, the device comprising:
[0042] The acquisition module is used to acquire high-precision map data of the area to be flown.
[0043] The detection module is used to periodically detect whether there are obstacles within the state adjustment distance based on the high-precision map data; wherein, the state adjustment distance is the distance required for the UAV to transition from the current flight state to the obstacle avoidance flight state;
[0044] The control module is used to control the drone to transition to the obstacle avoidance flight state if it detects an obstacle within the state adjustment distance.
[0045] Thirdly, embodiments of this application also provide a drone, including a processor and a memory, wherein the memory is used to store a program, and the processor is used to implement the obstacle avoidance method in the first aspect above when executing the program.
[0046] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the obstacle avoidance method described in the first aspect above.
[0047] Compared to existing technologies, the obstacle avoidance method, device, drone, and storage medium provided in this application, during drone flight, periodically detect the presence of obstacles within a state adjustment distance based on high-precision map data of the area to be flown. The state adjustment distance refers to the distance required for the drone to transition from its current flight state to an obstacle avoidance flight state. If an obstacle exists within the state adjustment area, the drone is controlled to transition to the obstacle avoidance flight state. In other words, during drone flight, obstacles ahead can be detected based on high-precision map data, and the drone can transition to the obstacle avoidance flight state in advance, preparing for obstacle avoidance. This allows for efficient and safe operation regardless of whether the user activates the obstacle avoidance function. Attached Figure Description
[0048] Figure 1 An example of an obstacle avoidance scenario provided in an embodiment of this application is shown. Figure 1 .
[0049] Figure 2 An example of an obstacle avoidance scenario provided in an embodiment of this application is shown. Figure 2 .
[0050] Figure 3 An example of an obstacle avoidance scenario provided in an embodiment of this application is shown. Figure 3 .
[0051] Figure 4 This application provides a flowchart illustrating an obstacle avoidance method according to an embodiment. Figure 1 .
[0052] Figure 5 An example of an obstacle avoidance method provided in an embodiment of this application is shown. Figure 1 .
[0053] Figure 6 This application provides a flowchart illustrating an obstacle avoidance method according to an embodiment. Figure 2 .
[0054] Figure 7 An example of an obstacle avoidance method provided in an embodiment of this application is shown. Figure 2 .
[0055] Figure 8 An example of an obstacle avoidance method provided in an embodiment of this application is shown. Figure 3 .
[0056] Figure 9 This application provides a flowchart illustrating an obstacle avoidance method according to an embodiment. Figure 3 .
[0057] Figure 10 This application provides a flowchart illustrating an obstacle avoidance method according to an embodiment. Figure 4 .
[0058] Figure 11 A block diagram of an obstacle avoidance device provided in an embodiment of this application is shown.
[0059] Figure 12 A block diagram of a drone provided in an embodiment of this application is shown.
[0060] Icons: 100 - Obstacle avoidance device; 101 - Acquisition module; 102 - Detection module; 103 - Control module; 10 - UAV; 11 - Processor; 12 - Memory; 13 - Bus. Detailed Implementation
[0061] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0062] In existing drone obstacle avoidance solutions, obstacle avoidance is achieved through radar (e.g., millimeter-wave radar). That is, the radar (e.g., millimeter-wave radar) performs obstacle detection within a limited field of view and a limited detection range. When the obstacle is not within the radar's field of view or effective detection range, the drone will not plan a safe flight path for the obstacle.
[0063] Therefore, the drone's speed is 13.8 m / s when flying at high speed. However, when the user activates the obstacle avoidance function, in order to ensure that the drone has enough distance to avoid obstacles when the radar detects them and to ensure flight safety during the obstacle avoidance process, the drone's flight speed will be limited, for example, to 8 m / s.
[0064] In other words, although drones currently have obstacle avoidance capabilities, activating these capabilities reduces flight speed, typically to 8 m / s. As a result, users are usually reluctant to activate obstacle avoidance in pursuit of higher operational efficiency, which can easily lead to safety accidents.
[0065] For example, if the obstacle avoidance function is not enabled, the following safety issues may occur:
[0066] In one possible scenario, please refer to Figure 1 Obstacles outside the plot boundary (such as tree branches) extend into the operation flight path, causing drones to scrape against the obstacles and crash when operating near the plot boundary.
[0067] In another possible scenario, please refer to Figure 2 There were obstacles within the plot of land, but the user did not mark the obstacles, causing the drone to collide with the obstacles and crash during normal operation.
[0068] In yet another possible scenario, please refer to Figure 3 There are obstacles within the plot of land, and the user has correctly marked them. However, due to accuracy issues or changes in the obstacles, the drone may crash unexpectedly when approaching the user-marked obstacles. Accuracy issues refer to discrepancies between the marked obstacle shape and its actual appearance. Changes in the obstacles refer to obstacles whose shape changes over time. For example, the outline of the obstacle corresponding to the fruit tree currently marked by the user may be correct, but after some time, the fruit tree may grow, causing the originally marked obstacle outline to become incorrect.
[0069] To address the aforementioned technical issues, this application's embodiments detect obstacles ahead based on high-precision map data during UAV flight and transition to obstacle avoidance flight mode in advance, preparing for obstacle avoidance. This ensures efficient and safe operation regardless of whether the user activates the obstacle avoidance function. A detailed description follows.
[0070] The drones in this application embodiment can be agricultural drones, forestry drones, aerial survey drones, etc. This application embodiment does not impose any limitations on them.
[0071] Please refer to Figure 4 , Figure 4 A flowchart illustrating an obstacle avoidance method provided in an embodiment of this application is shown. This obstacle avoidance method, applied to a drone, may include the following steps:
[0072] S101, acquire high-precision map data of the area to be flown.
[0073] Before the drone takes off, high-precision map data of the area to be flown is acquired. The area to be flown refers to the area where the drone will fly, including the flight operation area and the areas it will pass through during the onboard and return journeys.
[0074] S102, based on high-precision map data, periodically detects whether there are obstacles within the state adjustment distance; whereby the state adjustment distance is the distance required for the UAV to transition from the current flight state to the obstacle avoidance flight state.
[0075] In this embodiment, after the UAV takes off, it detects whether there are obstacles ahead based on high-precision map data. High-precision map data is offline data and typically provides global map information. Therefore, obstacle detection using high-precision map data occurs earlier than radar obstacle detection, thus enabling the use of high-precision map data to provide early warnings for obstacle avoidance. In other words, by detecting obstacles ahead based on high-precision map data, the system transitions to obstacle avoidance flight mode in advance, preparing for subsequent obstacle avoidance based on radar.
[0076] The current flight status can include the drone's current speed and current acceleration. The obstacle avoidance flight status can be an initial flight status based on radar-based obstacle avoidance; that is, if an obstacle is detected ahead based on high-precision map data, the drone is controlled to transition to obstacle avoidance flight status. Simultaneously, after transitioning to obstacle avoidance flight status, the drone is controlled to avoid obstacles based on the obstacles detected by the high-precision map data.
[0077] The obstacle avoidance flight state can include obstacle avoidance speed and obstacle avoidance acceleration. Given the current flight state (i.e., current speed and current acceleration) and the obstacle avoidance flight state (i.e., obstacle avoidance speed and obstacle avoidance acceleration), the distance required for the UAV to transition from the current flight state to the obstacle avoidance flight state can be calculated; that is, the state adjustment distance L. This is a conventional mathematical calculation process, which will not be elaborated upon in the embodiments of this application.
[0078] The process of determining the obstacle avoidance flight state is described below.
[0079] In practice, the obstacle avoidance flight state can be flexibly adjusted according to actual obstacle avoidance needs, and the embodiments of this application do not impose any restrictions.
[0080] In one possible implementation, obstacle avoidance flight status can be defined by the data quality of high-resolution map data. Data quality can be, but is not limited to, map resolution, map update time, etc. of the high-resolution map data.
[0081] Based on this, obstacle avoidance speed can be obtained in the following way:
[0082] Determine the obstacle avoidance speed based on at least one of the map resolution and map update time of the high-precision map data;
[0083] Among them, the higher the map resolution, the closer the obstacle avoidance speed is to the first set speed; the lower the map resolution, the closer the obstacle avoidance speed is to the second set speed; the first set speed is lower than the second set speed.
[0084] The closer the map update time is to the time of the drone's current flight, the closer the obstacle avoidance speed is to the first set speed; the further the map update time is from the time of the drone's current flight, the closer the obstacle avoidance speed is to the second set speed.
[0085] In other words, those skilled in the art should understand that the closer the map update time of the high-precision map data is to the time of the UAV's current flight, the higher the confidence level of obstacle detection based on the high-precision map data, and vice versa. Similarly, the higher the map resolution of the high-precision map data, the higher the confidence level of obstacle detection based on the high-precision map data, and vice versa. That is, the higher the quality of the high-precision map data, for example, the higher the map resolution of the high-precision map data, and / or the closer the map update time of the high-precision map data is to the time of the UAV's current flight, the more accurate the obstacles detected by the high-precision map data will be, and the greater the possibility of accurate obstacle avoidance in the future. Therefore, in this case, a relatively low obstacle avoidance speed can be set to ensure the safety of the UAV during the obstacle avoidance process.
[0086] For example, the obstacle avoidance speed is set according to a first set speed. The higher the quality of the high-precision map data, the closer the obstacle avoidance speed is to the first set speed. The first set speed can be 4 m / s.
[0087] Conversely, the lower the quality of the high-precision map data—for example, the lower the map resolution and / or the further back in time the map update was from the current flight of the drone—the more inaccurate the obstacle detection may be. For instance, it might mistakenly identify non-existent obstacles as present, leading to subsequent obstacle avoidance maneuvers based on these non-existent obstacles, thus impacting operational efficiency. Therefore, in such cases, a relatively high obstacle avoidance speed can be set to ensure the drone's operational efficiency. This relatively high obstacle avoidance speed can be set within a predetermined speed range, which can be from a first predetermined speed to a second predetermined speed. Furthermore, the lower the quality of the high-precision map data, the closer the obstacle avoidance speed should be to the second predetermined speed. For example, the second predetermined speed could be 6 m / s, and the corresponding speed range could be 4 m / s to 6 m / s.
[0088] Therefore, to ensure the safety of drone flight, obstacles detected based on high-precision map data can be further detected through other means (e.g., detection by detection equipment).
[0089] Defining obstacle avoidance speed by using high-precision map data quality can achieve a balance between safety and efficiency. This allows for relatively safe passage through obstacle areas while maintaining the original flight speed for extended periods, minimizing the impact on flight efficiency.
[0090] Meanwhile, to ensure obstacle avoidance safety, the obstacle avoidance acceleration of the drone is preferably 0 during the obstacle avoidance process. Therefore, the obstacle avoidance acceleration can be set to 0. In this way, after the drone transitions to obstacle avoidance flight mode, even if it cannot reach 0 completely, it will be close to 0, which is beneficial for the drone to avoid obstacles.
[0091] As can be seen from the foregoing, if the quality of the high-precision map is not high, obstacles can be further detected by other means (e.g., by using detection equipment) to further ensure flight safety. Based on this, an obstacle avoidance speed can be set first according to the data quality, and then the obstacle avoidance speed can be adjusted according to the detection distance of the detection equipment.
[0092] Therefore, in another possible implementation, the obstacle avoidance speed can also be determined in the following way:
[0093] Determine the initial obstacle avoidance speed based on at least one of the map resolution and map update time of the high-precision map data;
[0094] Among them, the higher the map resolution, the closer the initial obstacle avoidance speed is to the first set speed; the lower the map resolution, the closer the initial obstacle avoidance speed is to the second set speed; the first set speed is lower than the second set speed.
[0095] The closer the map update time is to the time of the drone's current flight, the closer the initial obstacle avoidance speed is to the first set speed; the further the map update time is from the time of the drone's current flight, the closer the initial obstacle avoidance speed is to the second set speed.
[0096] The initial obstacle avoidance speed is adjusted based on the detection range of the detection equipment to obtain the obstacle avoidance speed, where the detection range is positively correlated with the obstacle avoidance speed.
[0097] The process of setting the initial obstacle avoidance speed is similar to that of setting the actual obstacle avoidance speed, and will not be described again in this embodiment. The detection distance is positively correlated with the obstacle avoidance speed; that is, the farther the detection distance, the greater the obstacle avoidance speed, and the closer the detection distance, the smaller the obstacle avoidance speed.
[0098] S103, if an obstacle is detected within the state adjustment distance, the drone is controlled to transition to obstacle avoidance flight mode.
[0099] In this embodiment, if an obstacle is detected within the forward state adjustment distance L, the drone is controlled to transition to obstacle avoidance flight mode, thereby transitioning to obstacle avoidance flight mode in advance and preparing for subsequent obstacle avoidance.
[0100] The following is a detailed description of step S102.
[0101] In this embodiment, high-precision data is used to periodically detect whether there are obstacles within the forward state adjustment distance. That is, each detection cycle has its own corresponding state adjustment distance, which is calculated based on the current flight state and obstacle avoidance flight state of the UAV within that detection cycle. Since the current flight state of the UAV may be constantly changing, the state adjustment distance corresponding to different detection cycles may be different.
[0102] It should be noted that in this embodiment, the detection cycle is based on the state adjustment distance. After takeoff, the UAV flies along a pre-planned route, so its current position is constantly changing. Obstacle detection periodically checks for obstacles within the state adjustment distance in front of the UAV. That is, each detection uses the UAV's current position as a reference point to detect obstacles within the state adjustment distance in front of the UAV. Therefore, one detection cycle refers to completing the detection of obstacles within one state adjustment distance.
[0103] Please refer to Figure 5 After the drone takes off, starting from point A, it periodically checks for obstacles in the flight path based on high-precision map data of the area to be flown. Point A can be the drone's takeoff point, the point where operations begin, or a point customized by the user according to actual obstacle avoidance needs.
[0104] Figure 5 In the diagram, points A, B, and C are the locations of the drone. For example, when the drone reaches point A, the first detection cycle begins. First, the state adjustment distance L1 is calculated based on the drone's flight state and obstacle avoidance flight state at point A. Then, using point A as the reference point, the drone checks whether there are obstacles within the state adjustment distance L1 in the forward flight direction. If there are obstacles, the drone is controlled to transition to obstacle avoidance flight state. If there are no obstacles, the drone maintains its current flight state and continues to fly until the obstacle detection within the state adjustment distance L1 is completed. This process is the first detection cycle.
[0105] Assuming the drone reaches point B after completing the first detection cycle, the second detection cycle begins at point B. First, the state adjustment distance L2 is calculated based on the drone's flight state and obstacle avoidance flight state at point B. Then, using point A as the reference point, the drone is checked for obstacles within the state adjustment distance L2 in the forward flight direction. If obstacles exist, the drone is controlled to transition to obstacle avoidance flight state. If no obstacles exist, the drone maintains its current flight state and continues to fly until the obstacle detection within the state adjustment distance L2 is completed. This process constitutes the second detection cycle.
[0106] Following the same process described above, obstacles in the flight path are detected based on high-precision map data of the area to be flown until the drone completes the entire flight process.
[0107] As can be seen from the above, the process of detecting whether there is an obstacle within the detection state adjustment distance is the same for each detection cycle. Therefore, the following embodiment will only be described using one detection cycle as an example.
[0108] It should be noted that detecting obstacles in the forward flight path of the drone can refer to detecting obstacles on the drone's current flight path. In other words, obstacle detection within the state adjustment distance is performed on the drone's current flight path. Specifically, based on high-precision map data of the area to be flown, the presence of obstacles in the drone's forward flight path is periodically checked. This way, only obstacles affecting the current flight need to be detected, while other obstacles are ignored. This reduces the amount of data processing while ensuring the accuracy and effectiveness of the detected obstacles.
[0109] Of course, if there is a need to know in advance about obstacles on other routes or in other areas besides the drone's current route, it is not limited to detecting obstacles only on the drone's current route, but can also detect obstacles on other routes or in other areas where the obstacle situation needs to be known.
[0110] In one possible implementation, Figure 4 Based on this, please refer to Figure 6Step S102 may include S1021 to S1023.
[0111] S1021, for each detection cycle, starts from the current position of the drone and uses a sliding window of a set size to detect obstacles based on high-precision map data.
[0112] S1022, If an obstacle is detected within the current sliding window, then it is determined that an obstacle exists within the state adjustment distance.
[0113] S1023, If no obstacle is detected in the current sliding window, continue moving the sliding window until the detection of the state adjustment distance is completed.
[0114] In this embodiment, taking one detection cycle as an example, the state adjustment distance L is first calculated based on the current flight state and obstacle avoidance flight state of the UAV. Then, starting from the current position of the UAV, obstacle detection is performed on the state adjustment distance L using a sliding window of a set size.
[0115] For example, please refer to Figure 7 First, define the sliding window for effective obstacle detection and the step size for each slide. For example, the size of the sliding window can be 5m, and the step size can be 1m. Then, starting from the current position of the UAV, detect whether there is an obstacle in sliding window 1. If there is an obstacle in sliding window 1, proceed to step S103; if there is no obstacle in sliding window 1, continue moving the sliding window according to the set step size (e.g., 1m). After that, detect whether there is an obstacle in sliding window 2, until the detection of the state adjustment distance L is completed.
[0116] Obviously, the process of detecting whether there are obstacles in the sliding window is the same after each movement of the sliding window. Therefore, the following embodiments only use the current sliding window as an example for illustration.
[0117] Optionally, the process of detecting obstacles using a sliding window of a set size based on high-precision map data in S1021 may include S10211 to S10213.
[0118] S10211, using an equal-interval sampling method, determines multiple sampling points within the current sliding window.
[0119] S10212, Obtain the height data of each sampling point from the high-precision map data.
[0120] S10213, based on the height data of each sampling point, perform obstacle detection on the current sliding window.
[0121] by Figure 7 Taking sliding window 1 as an example, Figure 8As shown, using an equal-interval sampling method, multiple sampling points {p1,p2,p3,…,p8} are determined within the sliding window 1 at fixed intervals Δl; then, the height data {h1,h,h3,…,h8} of each sampling point is obtained from the high-precision map data; finally, obstacle detection is performed on the sliding window 1 based on the height data {h1,h,h3,…,h8} of each sampling point.
[0122] Optionally, the fixed interval Δl can be flexibly set according to actual obstacle avoidance requirements, for example, 1m. This application embodiment does not impose any restrictions on this.
[0123] Optionally, the multiple sampling points {p1,p2,p3,...,p8} can be points in the forward flight direction of the UAV or points on the forward flight path of the UAV. This application embodiment does not impose any restrictions on this.
[0124] Optionally, the process of detecting obstacles in the current sliding window based on the height data of each sampling point in S10213 may include:
[0125] Based on the height data of each sampling point, obtain the maximum and minimum height values within the current sliding window;
[0126] If the height difference between the maximum and minimum height values is greater than or equal to the height jump threshold, and the maximum height value is greater than or equal to the drone's current flight altitude, then it is determined that there is an obstacle within the current sliding window.
[0127] That is, with Figure 8 Taking the sliding window 1 shown as an example, the maximum height h within the sliding window 1 is obtained from the height data {h1,h,h3,…,h8} of each sampling point. max and minimum height h min .
[0128] Then, if h max -h min ≥h t And h max ≥h u Then it is determined that there are obstacles affecting the flight safety of the drone within sliding window 1, where h t h is the threshold for height jump. u This represents the current flight altitude of the drone. Otherwise, it is determined that there are no obstacles within sliding window 1 that could affect the flight safety of the drone.
[0129] In this embodiment, if an obstacle is detected in front of the drone, the drone is controlled to transition to obstacle avoidance flight mode, and after transitioning to obstacle avoidance flight mode, the drone is controlled to avoid the obstacle.
[0130] In one possible implementation, after the UAV transitions to obstacle avoidance flight, it can directly perform obstacle avoidance control based on the obstacles detected in S102. For example, it can plan an obstacle avoidance path based on the obstacles detected in S102, and control the UAV to avoid the obstacles according to the obstacle avoidance path and return to the flight path to continue the operation.
[0131] In another possible implementation, as can be seen from the above description, the quality of the acquired high-precision map data may be good or bad. Therefore, detecting obstacles on the flight path ahead based on high-precision map data mainly serves to provide obstacle warnings and transition to obstacle avoidance flight mode in advance to prepare for obstacle avoidance. If the obstacle avoidance path is planned directly according to the obstacles detected by the high-precision map data, there may be a risk of crashing the aircraft.
[0132] In other words, if the high-precision map has low accuracy, or if the map's update time is far removed from the drone's current flight, some obstacles may have changed but not been updated in the map, or some obstacles may not even be marked on the map at all. In such cases, the accuracy and actual location of obstacles detected by the high-precision map data may be inaccurate. If obstacle avoidance control is performed directly based on these obstacles, it could lead to a drone crash.
[0133] Therefore, please refer to again Figure 6 After step S103, the obstacle avoidance method provided in this application embodiment may further include step S104.
[0134] S104: After the drone transitions to obstacle avoidance flight mode, the actual position of the obstacle is determined by the detection equipment, so as to control the drone to avoid the obstacle based on the actual position.
[0135] In this embodiment, the detection device can be radar, such as millimeter-wave radar, or visual detection device, such as binocular camera.
[0136] After the UAV transitions to obstacle avoidance flight mode, obstacle avoidance is completed based on detection equipment. That is, the actual position of the obstacle is determined by detection equipment (such as millimeter-wave radar, binocular camera, etc.), and then the obstacle avoidance path is re-planned based on the actual position of the obstacle. The UAV is then controlled to avoid the obstacle according to the obstacle avoidance path and return to the flight path to continue the operation.
[0137] Thus, after the drone transitions to obstacle avoidance flight mode, obstacle avoidance control via detection equipment can prevent crashes caused by inaccurate obstacle detection accuracy and actual location based on high-precision map data, thereby improving obstacle avoidance accuracy.
[0138] In another possible implementation, Figure 4 Based on this, please refer to Figure 9Step S102 may include S102a.
[0139] S102a, for each detection cycle, determines whether there is an obstacle within the state adjustment distance based on obstacle information.
[0140] In this embodiment, the high-precision map data may include obstacle information within the area to be flown; that is, obstacles are already marked in the high-precision map data. In this case, instead of using a sliding window approach, it is possible to directly determine whether there are obstacles within the forward state adjustment distance L based on the obstacle information in the high-precision map data, i.e., the marked obstacles.
[0141] If there are obstacles within a distance L ahead, in addition to controlling the drone to transition to obstacle avoidance flight mode, in order to solve... Figure 3 The issue shown could be caused by accuracy problems or changes in obstacles, leading to the drone unexpectedly crashing when approaching user-defined obstacles. Further detection equipment can be used to confirm obstacles within the state adjustment distance.
[0142] Therefore, please refer to again Figure 9 After step S103, the obstacle avoidance method provided in this application embodiment further includes steps S105 to S107.
[0143] S105, Based on obstacle information, determine the reference position of the obstacle.
[0144] S106: When the drone is set to a distance from the reference position, the detection device confirms whether there are obstacles at the reference position.
[0145] S107: When an obstacle is confirmed at the reference position, the actual distance between the obstacle and the drone is determined by the detection equipment, so as to control the drone to avoid obstacles based on the actual distance.
[0146] In other words, if an obstacle is determined to exist within a distance L ahead based on obstacle information in the high-precision map data, the reference position of the obstacle is first obtained from the high-precision map data. Then, when the UAV is at a set distance (e.g., 10m) from the reference position, the presence of an obstacle at the reference position is confirmed by a detection device (e.g., millimeter-wave radar, binocular camera, etc.). If an obstacle is confirmed to exist at the reference position, the actual distance between the obstacle and the UAV is further determined by a detection device (e.g., millimeter-wave radar, binocular camera, etc.). The obstacle avoidance path is then replanned based on the reference position and actual distance of the obstacle, and the UAV is controlled to avoid the obstacle and return to the flight path to continue operation.
[0147] It should be noted that the set distance will vary depending on the detection equipment used. For example, the set distance for a binocular camera should be set shorter than that for a millimeter-wave radar. The specific distance can be flexibly set according to the actual detection equipment. This application does not impose any restrictions on this.
[0148] In one possible scenario, since obstacle detection is based on high-precision map data, it's possible that no obstacles are detected on the flight path ahead within the current detection cycle. However, the drone may have performed a state adjustment operation in the previous detection cycle, meaning it's currently in obstacle avoidance flight mode. Therefore, even though there are no obstacles on the flight path ahead, the drone's flight speed is relatively low. To ensure operational efficiency, the drone can be controlled to revert to its flight state before the state adjustment operation.
[0149] Therefore, in Figure 4 Based on this, please refer to Figure 10 After step S102, the obstacle avoidance method provided in this application embodiment further includes step S108.
[0150] S108: If no obstacle is detected within the state adjustment distance and the UAV has performed a state adjustment operation, then control the UAV to restore the flight state from the current flight state to the flight state before the state adjustment operation.
[0151] In this embodiment, the state adjustment operation refers to the operation related to the UAV transitioning to the obstacle avoidance flight state, such as decelerating to the obstacle avoidance speed and decelerating to the obstacle avoidance acceleration.
[0152] If there are no obstacles within the forward state adjustment distance L and the UAV has previously performed a state adjustment operation, in order to ensure that the UAV can perform efficient and safe operations, the UAV can be controlled to restore its current flight state to the flight state before the state adjustment operation.
[0153] In another possible scenario, if no obstacles are detected on the flight path ahead during the current detection cycle, and the drone has not performed any state adjustment operations in the previous detection cycle, then the drone can be controlled to maintain its current flight state and continue flying.
[0154] Therefore, please refer to again Figure 10 After step S102, the obstacle avoidance method provided in this application embodiment further includes step S109.
[0155] S109: If no obstacle is detected within the state adjustment distance and the drone has not performed a state adjustment operation, then control the drone to maintain the current flight state and continue flying.
[0156] Compared with the prior art, the embodiments of this application have the following beneficial effects:
[0157] First, during the flight of the drone, it can detect obstacles on the flight path ahead based on high-precision map data and transition to obstacle avoidance flight mode in advance to prepare for obstacle avoidance. Thus, regardless of whether the user turns on the obstacle avoidance function, it can carry out efficient and safe operations.
[0158] Secondly, if there are no obstacles ahead and the drone has previously performed a state adjustment operation, the drone is controlled to return to its flight state before the state adjustment operation. If there are no obstacles ahead and the drone has not previously performed a state adjustment operation, the drone is controlled to maintain its current flight state and continue flying, thereby ensuring the high-speed flight of the drone.
[0159] Third, defining obstacle avoidance speed by using the data quality of high-precision map data can achieve a balance between safety and efficiency. It can pass through obstacle areas in a relatively safe manner while maintaining the original speed during a longer operation, reducing the impact on flight efficiency.
[0160] In order to perform the corresponding steps in the above method embodiments and various possible implementations, an implementation of an obstacle avoidance device is given below.
[0161] Please refer to Figure 11 , Figure 11 A block diagram of an obstacle avoidance device 100 provided in an embodiment of this application is shown. The obstacle avoidance device 100 is applied to a drone and includes: an acquisition module 101, a detection module 102, and a control module 103.
[0162] The acquisition module 101 is used to acquire high-precision map data of the area to be flown.
[0163] The detection module 102 is used to periodically detect whether there are obstacles within the state adjustment distance based on high-precision map data; wherein, the state adjustment distance is the distance required for the UAV to transition from the current flight state to the obstacle avoidance flight state.
[0164] The control module 103 is used to control the drone to transition to obstacle avoidance flight mode if an obstacle is detected within the state adjustment distance.
[0165] Optionally, the detection module 102 is specifically used for:
[0166] For each detection cycle, starting from the drone's current position, obstacle detection is performed using a sliding window of a set size based on high-precision map data;
[0167] If an obstacle is detected within the current sliding window, then it is determined that an obstacle exists within the state adjustment distance;
[0168] If no obstacle is detected within the current sliding window, the sliding window continues to move until the detection of the state adjustment distance is completed.
[0169] Optionally, the detection module 102 may perform obstacle detection based on high-precision map data using a sliding window of a set size, which may include:
[0170] Multiple sampling points are determined within the current sliding window using an equal-interval sampling method;
[0171] Obtain the height data of each sampling point from the high-precision map data;
[0172] Obstacle detection is performed on the current sliding window based on the height data of each sampling point.
[0173] Optionally, the detection module 102 performs obstacle detection on the current sliding window based on the height data of each sampling point, including:
[0174] Based on the height data of each sampling point, obtain the maximum and minimum height values within the current sliding window;
[0175] If the height difference between the maximum and minimum height values is greater than or equal to the height jump threshold, and the maximum height value is greater than or equal to the drone's current flight altitude, then it is determined that there is an obstacle within the current sliding window.
[0176] Optionally, the control module 103 is also used for:
[0177] After the drone transitions to obstacle avoidance flight mode, the actual position of the obstacle is determined by the detection equipment, and the drone is controlled to avoid the obstacle based on the actual position.
[0178] Optionally, the detection module 102 is further used for:
[0179] For each detection cycle, the system determines whether there are obstacles within the state adjustment distance based on obstacle information.
[0180] Optionally, the control module 103 is also used for:
[0181] Based on obstacle information, determine the reference position of the obstacle;
[0182] When the drone is set to a distance from a reference position, a detection device is used to confirm whether there are obstacles at the reference position;
[0183] When an obstacle is confirmed at the reference location, the actual distance between the obstacle and the drone is determined by a detection device, and the drone is controlled to avoid obstacles based on the actual distance.
[0184] Optionally, the control module 103 is also used for:
[0185] If no obstacle is detected within the state adjustment distance and the UAV has performed a state adjustment operation, then control the UAV to resume its flight state from the current state to the flight state before the state adjustment operation; and / or,
[0186] If no obstacles are detected within the state adjustment distance and the drone has not performed a state adjustment operation, then control the drone to maintain its current flight state and continue flying.
[0187] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the obstacle avoidance device 100 described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0188] Please refer to Figure 12 , Figure 12 A block diagram of a drone 10 provided in an embodiment of this application is shown. The drone 10 includes a processor 11, a memory 12, and a bus 13, with the processor 11 connected to the memory 12 via the bus 13.
[0189] Memory 12 is used to store programs, for example Figure 11 The obstacle avoidance device 100 shown includes at least one software function module that can be stored in the memory 12 in the form of software or firmware. After receiving the execution instruction, the processor 11 executes the program to implement the obstacle avoidance method disclosed in the foregoing embodiments.
[0190] The memory 12 may include high-speed random access memory (RAM) or non-volatile memory (NVM).
[0191] Processor 11 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed through integrated logic circuits in the hardware of processor 11 or through software instructions. Processor 11 can be a general-purpose processor, including a Central Processing Unit (CPU), a Microcontroller Unit (MCU), a Complex Programmable Logic Device (CPLD), a Field Programmable Gate Array (FPGA), embedded ARM chips, etc.
[0192] In summary, the obstacle avoidance method, device, drone, and storage medium provided in this application, during drone flight, periodically detects the presence of obstacles within a state adjustment distance based on high-precision map data of the area to be flown. The state adjustment distance refers to the distance required for the drone to transition from its current flight state to an obstacle avoidance flight state. If an obstacle exists within the state adjustment area, the drone is controlled to transition to the obstacle avoidance flight state. In other words, during drone flight, obstacles ahead can be detected based on high-precision map data, and the drone can transition to the obstacle avoidance flight state in advance, preparing for obstacle avoidance. This allows for efficient and safe operation regardless of whether the user activates the obstacle avoidance function.
[0193] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. An obstacle avoidance method, characterized in that, The method includes: Obtain high-precision map data of the area to be flown; Based on the high-precision map data, the presence of obstacles within the state adjustment distance is periodically detected. The state adjustment distance is the distance required for the UAV to transition from its current flight state to obstacle avoidance flight state, and each detection cycle has its own corresponding state adjustment distance. The step of periodically detecting the presence of obstacles within the state adjustment distance based on the high-precision map data includes: for each detection cycle, starting from the current position of the UAV, using a sliding window of a set size based on the high-precision map data to detect obstacles; if an obstacle is detected within the current sliding window, it is determined that the obstacle exists within the state adjustment distance; if no obstacle is detected within the current sliding window, the sliding window continues to move until the state adjustment distance detection is completed. If an obstacle is detected within the state adjustment distance, the drone is controlled to transition to the obstacle avoidance flight state.
2. The method as described in claim 1, characterized in that, The step of detecting obstacles using a sliding window of a set size based on the high-precision map data includes: Multiple sampling points are determined within the current sliding window using an equal-interval sampling method; The height data of each sampling point is obtained from the high-precision map data; Obstacle detection is performed on the current sliding window based on the height data of each sampling point.
3. The method as described in claim 2, characterized in that, The step of performing obstacle detection on the current sliding window based on the height data of each of the sampling points includes: Based on the height data of each sampling point, obtain the maximum and minimum height values within the current sliding window; If the height difference between the maximum height and the minimum height is greater than or equal to the height jump threshold, and the maximum height is greater than or equal to the current flight altitude of the drone, then it is determined that there is an obstacle within the current sliding window.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: After the drone transitions to the obstacle avoidance flight state, the actual position of the obstacle is determined by the detection device, and the drone is controlled to avoid the obstacle based on the actual position.
5. The method as described in claim 1, characterized in that, The high-precision map data includes obstacle information within the area to be flown; The step of periodically detecting whether there are obstacles within the state adjustment distance based on the high-precision map data includes: For each detection cycle, the presence of an obstacle within the state adjustment distance is determined based on the obstacle information.
6. The method as described in claim 5, characterized in that, The method further includes: If an obstacle is detected within the state adjustment distance, the reference position of the obstacle is determined based on the obstacle information. When the drone is at a set distance from the reference position, a detection device is used to confirm whether there are obstacles at the reference position; When an obstacle is confirmed at the reference location, the actual distance between the obstacle and the drone is determined by the detection device, and the drone is controlled to avoid the obstacle based on the actual distance.
7. The method as described in claim 1, characterized in that, The method further includes: If no obstacle is detected within the state adjustment distance and the UAV has performed a state adjustment operation, then control the UAV to restore its flight state from the current flight state to the flight state before the state adjustment operation; and / or, If no obstacle is detected within the state adjustment distance and the UAV has not performed the state adjustment operation, then the UAV is controlled to maintain the current flight state and continue flying.
8. The method as described in claim 1, characterized in that, The obstacle detection within the state adjustment distance is performed on the current flight path of the UAV.
9. The method as described in claim 1, characterized in that, The obstacle avoidance flight state includes the obstacle avoidance speed, which is obtained through the following method: The obstacle avoidance speed is determined based on at least one of the map resolution and map update time of the high-precision map data; Wherein, the higher the map resolution, the closer the obstacle avoidance speed is to the first preset speed; the lower the map resolution, the closer the obstacle avoidance speed is to the second preset speed; the first preset speed is lower than the second preset speed; The closer the map update time is to the time of the current flight of the drone, the closer the obstacle avoidance speed is to the first set speed; the further the map update time is from the time of the current flight of the drone, the closer the obstacle avoidance speed is to the second set speed.
10. The method as described in claim 4, characterized in that, The obstacle avoidance flight state includes the obstacle avoidance speed, which is obtained through the following method: The initial obstacle avoidance speed is determined based on at least one of the map resolution and map update time of the high-precision map data; Wherein, the higher the map resolution, the closer the initial obstacle avoidance speed is to the first preset speed; the lower the map resolution, the closer the initial obstacle avoidance speed is to the second preset speed; the first preset speed is lower than the second preset speed; The closer the map update time is to the time of the current flight of the drone, the closer the initial obstacle avoidance speed is to the first set speed; the further the map update time is from the time of the current flight of the drone, the closer the initial obstacle avoidance speed is to the second set speed. The initial obstacle avoidance speed is adjusted based on the detection distance of the detection device to obtain the obstacle avoidance speed, wherein the detection distance is positively correlated with the obstacle avoidance speed.
11. An obstacle avoidance device, characterized in that, The device includes: The acquisition module is used to acquire high-precision map data of the area to be flown. The detection module is used to periodically detect whether there are obstacles within the state adjustment distance based on the high-precision map data. The state adjustment distance is the distance required for the UAV to transition from its current flight state to obstacle avoidance flight state, and each detection cycle has its own corresponding state adjustment distance. Specifically, the detection module is used to: for each detection cycle, starting from the UAV's current position, perform obstacle detection using a sliding window of a set size based on the high-precision map data; if an obstacle is detected within the current sliding window, it is determined that the obstacle exists within the state adjustment distance; if no obstacle is detected within the current sliding window, the sliding window continues to move until the state adjustment distance detection is completed. The control module is used to control the drone to transition to the obstacle avoidance flight state if it detects an obstacle within the state adjustment distance.
12. An unmanned aerial vehicle (UAV), characterized in that, It includes a processor and a memory, the memory being used to store a program, and the processor being used to implement the obstacle avoidance method according to any one of claims 1-10 when executing the program.
13. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the obstacle avoidance method as described in any one of claims 1-10.