Obstacle avoidance method, obstacle avoidance device and unmanned aerial vehicle
By setting up multiple modules on the unmanned aerial vehicle for geometric calculation and determination, the complexity of autonomous obstacle avoidance in the existing technology is solved, and rapid and accurate three-dimensional space obstacle avoidance is achieved, and the autonomous avoidance of unmanned aerial vehicles is improved. Optimization of obstacle capability and motion trajectory.
Patent Information
- Application Number
- CN201610528047.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2016-07-06
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2036-07-06
AI Technical Summary
The existing unmanned aircraft's autonomous obstacle avoidance technology has complex computing and cannot quickly and in real time to achieve all-round three-dimensional space obstacle avoidance.
By setting up obstacle detection module, avoidance determination module, avoidance direction calculation module and obstacle avoidance control module on the unmanned aircraft, geometric operations are used to determine and calculate between multiple planes to achieve autonomous obstacle avoidance in three-dimensional space and avoid Deep learning and the use of neural network algorithms.
It realizes the rapid and accurate autonomous obstacle avoidance of unmanned aerial vehicles in complex environments, reduces the system's computing load, and improves the intelligence and path optimization of the motion trajectory.
Smart Images

Figure CN105955304B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle control, and in particular to an obstacle avoidance method, an obstacle avoidance device and an unmanned aerial vehicle. Background Art
[0002] Autonomous obstacle avoidance is a key technology for the autonomous operation of unmanned aerial vehicles. Through autonomous obstacle avoidance, unmanned aerial vehicles can avoid obstacles that affect movement during flight. Autonomous obstacle avoidance is expected to enable the unmanned aerial vehicle to autonomously identify surrounding obstacles and avoid them in the event of a remote control operator's misoperation, the remote control operator only expects to operate by setting the starting point and end point, or the machine is out of remote control. However, the autonomous obstacle avoidance technology in the prior art needs to be implemented through complex computing methods such as neural networks and deep learning. The calculation is complex and takes a long time, and it is not possible to achieve all-round obstacle avoidance quickly and in real time. Summary of the invention
[0003] In view of this, the present invention provides an obstacle avoidance method, an obstacle avoidance device and an unmanned aerial vehicle, which can quickly and accurately avoid obstacles in three-dimensional space.
[0004] The technical solution provided by the present invention is as follows:
[0005] In a first aspect, the present invention provides an obstacle avoidance method, which is applied to an unmanned aerial vehicle, and the method includes: detecting whether there are obstacles around the unmanned aerial vehicle; when an obstacle is detected, determining whether the unmanned aerial vehicle can avoid the obstacle on a first plane where the first circular area is located; when it is determined that the unmanned aerial vehicle can avoid the obstacle on the first plane, calculating a first avoidance direction on the first plane; controlling the unmanned aerial vehicle to perform obstacle avoidance movement in the first avoidance direction; when it is determined that the unmanned aerial vehicle cannot avoid the obstacle on the first plane, determining whether the unmanned aerial vehicle can avoid the obstacle on a second plane, the second plane intersecting with the first plane and having a preset angle; when it is determined that the unmanned aerial vehicle can avoid the obstacle on the second plane, calculating a second avoidance direction on the second plane; and controlling the unmanned aerial vehicle to perform obstacle avoidance movement in the second avoidance direction.
[0006] In a second aspect, the present invention provides an obstacle avoidance device, which includes: an obstacle detection module, which is used to detect whether there is an obstacle around the unmanned aerial vehicle, and when an obstacle is detected, determine whether the obstacle is located in a first circular area; an avoidance determination module, which is used to determine whether the unmanned aerial vehicle can avoid the obstacle on a first plane where the first circular area is located when the obstacle is located in the first circular area; an avoidance direction calculation module, which is used to calculate a first avoidance direction on the first plane when it is determined that the unmanned aerial vehicle can avoid the obstacle on the first plane; an obstacle avoidance control module, which is used to control the unmanned aerial vehicle to perform obstacle avoidance movement in the first avoidance direction; the avoidance determination module is also used to determine whether the unmanned aerial vehicle can avoid the obstacle on a second plane when it is determined that the unmanned aerial vehicle cannot avoid the obstacle on the first plane, and the second plane intersects with the first plane and has a preset angle; the avoidance direction calculation module is also used to calculate a second avoidance direction on the second plane when it is determined that the unmanned aerial vehicle can avoid the obstacle on the second plane; the obstacle avoidance control module is also used to control the unmanned aerial vehicle to perform obstacle avoidance movement in the second avoidance direction.
[0007] In a third aspect, the present invention further provides an unmanned aerial vehicle, comprising the above-mentioned obstacle avoidance device.
[0008] In the obstacle avoidance method, obstacle avoidance device and unmanned aerial vehicle 1 provided in the present application, during the flight of the unmanned aerial vehicle, a determination is first made on the first plane whether the obstacle can be avoided. If the obstacle can be avoided on the first plane, the first avoidance direction is calculated. If it is determined that the obstacle cannot be avoided on the first plane, a further determination is made on whether the obstacle can be avoided on the second plane and a calculation is made on the second avoidance direction. In this way, autonomous obstacle avoidance in three-dimensional space can be achieved through the determination and calculation of two different planes. And the calculation of the first avoidance direction or the second avoidance direction is a geometric operation performed by establishing a geometric region. There is no need to perform complex calculations such as deep learning and neural network algorithms. The system has a low computing load and consumes less computing resources. It can quickly and in real time calculate feasible avoidance directions for obstacles, and can achieve autonomous obstacle avoidance movement of the unmanned aerial vehicle in a complex environment, making the motion trajectory of the unmanned aerial vehicle more intelligent and close to the optimal path.
[0009] In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. As shown in the accompanying drawings, the above and other purposes, features and advantages of the present invention will be clearer. The same reference numerals in all the drawings indicate the same parts. The drawings are not deliberately scaled to the actual size, and the focus is on illustrating the main purpose of the present invention.
[0011] Figure 1 A schematic structural block diagram of an unmanned aerial vehicle provided in an embodiment of the present invention.
[0012] Figure 2 A schematic flow chart of an obstacle avoidance method provided in an embodiment of the present invention is shown.
[0013] Figure 3 A schematic diagram showing a demonstration of the obstacle avoidance method provided in an embodiment of the present invention on the first plane.
[0014] Figure 4 A schematic flow chart of the sub-steps included in step S103 in an embodiment of the present invention is shown.
[0015] Figure 5 A schematic flow chart of the sub-steps included in step S1035 in an embodiment of the present invention is shown.
[0016] Figure 6 A schematic diagram showing a target point selection process for multiple obstacles in an embodiment of the present invention is shown.
[0017] Figure 7 Another schematic flow chart of the obstacle avoidance method provided by an embodiment of the present invention is shown.
[0018] Figure 8 A schematic flow chart of the sub-steps included in step S104 in an embodiment of the present invention is shown.
[0019] Fig. 9 A flowchart of sub-steps included in step S1043 in an embodiment of the present invention is shown.
[0020] Fig.10a A schematic diagram of calculating the obstacle avoidance direction in an embodiment of the present invention is shown.
[0021] Fig.10b A schematic diagram showing another method of calculating an obstacle avoidance direction in an embodiment of the present invention is shown.
[0022] Fig.11 A flow chart showing the sub-steps included in step S106 provided in an embodiment of the present invention is shown.
[0023] Fig.12 A schematic diagram showing a demonstration of the obstacle avoidance method according to an embodiment of the present invention on a second plane is shown.
[0024] Fig.13 A flow chart of sub-steps included in step S1064 provided in an embodiment of the present invention is shown.
[0025] Fig.14 A flow chart of sub-steps included in step S107 provided in an embodiment of the present invention is shown.
[0026] Fig.15 A schematic flow chart of sub-steps included in step S1073 provided in an embodiment of the present invention is shown.
[0027] Fig.16 A schematic diagram of a flow chart of determining an avoidance speed in an obstacle avoidance method provided in an embodiment of the present invention is shown.
[0028] Fig.17 A schematic diagram of a flow chart of determining a motion mode on a first plane in an obstacle avoidance method provided by an embodiment of the present invention is shown.
[0029] Fig.18 A schematic diagram of a flow chart of determining a motion mode on a second plane in an obstacle avoidance method provided by an embodiment of the present invention is shown.
[0030] Fig.19 A schematic structural block diagram of an obstacle avoidance device provided in an embodiment of the present invention is shown.
[0031] Main component symbols
[0032]
[0033] DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0036] Figure 1 FIG. 1 is a schematic structural block diagram of an unmanned aerial vehicle 100 provided by an embodiment of the present invention. Figure 1 As shown, the UAV 100 may include a memory 102, a memory controller 104, one or more (only one is shown) processors 106, a motion control unit 108, a communication unit 110, and an obstacle avoidance device 200. These components may implement data exchange or communication with each other through one or more communication buses or signal lines 116.
[0037] The memory 102 can store various software programs and modules, such as program instructions / modules corresponding to the obstacle avoidance method and obstacle avoidance device provided in the embodiments of the present invention. The processor 106 runs the software programs and modules stored in the memory 102 through the storage controller 104, thereby executing various functional applications and data processing, such as the obstacle avoidance method provided in the embodiments of the present invention.
[0038] The memory 102 may include, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electric erasable programmable read-only memory (EEPROM), etc. The processor 106 and other possible components may access the memory 102 under the control of the memory controller 104.
[0039] The processor 106 can be an integrated circuit chip with signal processing capabilities. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a microcontroller (MCU), a multi-dimensional processor (MPU) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0040] The motion control unit 108 can control the UAV 100 to move according to the instructions of the processor 106. In some embodiments, the motion control unit 108, the processor 106 and the storage controller 104 can also be implemented in a single chip. In some other examples, they can be implemented by separate chips.
[0041] The communication unit 110 can transmit various information to a remote controller, a control console or other suitable devices by wireless transmission. In this embodiment, the communication unit 110 can be a high-definition image transmission module provided on the unmanned aerial vehicle 100 for transmitting the captured high-definition images to a remote controller, a control console or other devices.
[0042] Understandably, Figure 1 The structure shown is for illustration only. The unmanned aerial vehicle 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0043] The present application also provides an obstacle avoidance method, which is applied to the unmanned aerial vehicle 100. Figure 2 and Figure 3 As shown in FIG. 1 , there are a flow chart and a demonstration diagram of the obstacle avoidance method, respectively. The method includes the following steps.
[0044] Step S101 , detecting whether there are obstacles around the UAV 100 .
[0045] The unmanned aerial vehicle 100 needs to avoid obstacles that may affect the flight process during flight. In the embodiment of the present application, an obstacle avoidance sensor may be provided on the unmanned aerial vehicle 100 to detect obstacles, such as an electromagnetic wave radar, a laser radar, a binocular camera, or a TOF (Time of Flight) rangefinder / camera, etc. The embodiment of the present application does not limit the specific form of the obstacle avoidance sensor.
[0046] The obstacles mentioned in the embodiment of the present application include fixed obstacles that are stationary relative to the ground, and fixed obstacles that the unmanned aerial vehicle 100 will encounter during flight, such as walls, wires, trees, etc. On the other hand, obstacles can also include objects that move relative to the ground and will cause obstacles to the movement of the unmanned aerial vehicle 100. In the embodiment of the present application, they can be called attacking objects. For example, debris flying towards the machine encountered during the flight of the unmanned aerial vehicle 100. The unmanned aerial vehicle 100 can move under the remote control of the remote controller, or it can move autonomously according to a pre-set destination position. Avoid detected obstacles during the movement.
[0047] The unmanned aerial vehicle 100 can detect obstacles by means of multiple sensors arranged at one position or different positions on the machine, or can detect obstacles around it by means of a rotatable sensor arranged on the machine. Of course, in order to reduce the cost of the obstacle avoidance sensor of the unmanned aerial vehicle 100, or to reduce the amount of computation of the system during autonomous movement, only one fixed sensor can be arranged to only detect obstacles in front of the machine when the unmanned aerial vehicle 100 is moving. The present application does not limit the arrangement form of the obstacle avoidance sensor on the unmanned aerial vehicle 100. For example, when a binocular camera is used as an obstacle avoidance sensor on the unmanned aerial vehicle 100, the binocular camera is generally used to detect obstacles encountered in the forward direction of the unmanned aerial vehicle 100. On a plane parallel to the horizontal plane, the viewing angle of the binocular camera is generally 90 to 120 degrees, and the lateral viewing angle of the binocular camera will vary depending on the installation position and product model.
[0048] The unmanned aerial vehicle 100 obtains the environment around the obstacle avoidance sensor through the obstacle avoidance sensor, and determines whether there is an obstacle through a pre-set rule. The technology of detecting obstacles through the obstacle avoidance sensor is a prior art and will not be described in detail in this application. Figure 3 As shown, the outermost circle with O as the center is the detection area of the obstacle. The size of the detection area is related to the specific form of the sensor. When the obstacle enters the detection area, it can be detected.
[0049] Step S102: when an obstacle is detected, determining whether the obstacle is located within a first circular area.
[0050] In this embodiment, when an obstacle is detected, it can be directly determined whether the obstacle can be avoided. It can also be determined whether the obstacle can be avoided after the obstacle is located in the first circular area. The first circular area is a circular area with the current position point of the unmanned aerial vehicle 100 as the center. The current position of the unmanned aerial vehicle 100 is virtualized as a point, and the first circular area is formed with the point. The radius length of the first circular area is preset and is set to be less than the detection distance of the obstacle avoidance sensor.
[0051] When an obstacle is detected around the UAV 100, it indicates that the obstacle has entered the detection area of the obstacle avoidance sensor, and the obstacle avoidance sensor can detect the distance between the point on the obstacle closest to the UAV 100 and the current position of the UAV 100. When the distance between the point on the obstacle closest to the current position of the UAV 100 and the current position is less than or equal to the detection distance of the sensor, the sensor can detect the obstacle.
[0052] Since the shape of obstacles is generally irregular, the embodiment of the present application needs to obtain the position information of the point on the obstacle closest to the UAV 100. Determining whether the obstacle is located within the first circular area is actually determining whether the distance between the point on the obstacle closest to the UAV 100 and the current position of the UAV 100 is less than the radius of the first circular area.
[0053] In the embodiment of the present application, obstacle detection is performed by an obstacle avoidance sensor. For the convenience of calculation, the position of the obstacle avoidance sensor and the current position point of the unmanned aerial vehicle 100 are set to the same point, that is, it is considered that the signal of the sensor detecting obstacles is sent from the current position point as the starting point.
[0054] Step S103: when the obstacle is located within the first circular area, determining whether the UAV 100 can avoid the obstacle on a first plane.
[0055] In the embodiments of the present application, the process of judging whether an obstacle can be avoided is the same, but the amount of calculation is greater when the obstacle is detected than when the obstacle is determined to be located in the first circular area. In the embodiments of the present application, for the convenience of description, only the judgment of whether the obstacle can be avoided is performed after determining that the obstacle is located in the first circular area. However, it can be understood by those skilled in the art that it is also feasible to not perform step 102 and directly perform the calculation of whether the obstacle can be avoided when the obstacle is detected.
[0056] When the distance between the point on the obstacle closest to the UAV 100 and the current position of the UAV 100 is less than or equal to the first distance, it indicates that the obstacle is located in the first circular area. At this time, if the UAV 100 continues to move in the current direction, it may collide with the obstacle. At this time, a judgment is made whether the obstacle can be avoided on the first plane.
[0057] The "inability to avoid obstacles" mentioned in the embodiments of the present application does not actually mean that obstacles cannot be avoided at all in the strict sense. If the unmanned aerial vehicle 100 performs a large-angle turn and displacement, it is still possible to avoid obstacles on the first plane. "Inability to avoid obstacles" specifically means that obstacles cannot be avoided at a limited angle. For ease of understanding, the inability to avoid obstacles at a limited angle is defined as "inability to avoid obstacles" in this application.
[0058] For example, Figure 3As shown, point P on the obstacle is the point on the obstacle closest to the current position point O. Point P touches the first circular area, that is, it is located in the first circular area. At this time, it is necessary to determine whether the obstacle can be avoided on the first plane. In addition, if the obstacle is in the detection area but not in the first circular area, in order to save the amount of calculation, it is not necessary to determine whether the obstacle can be avoided on the first plane.
[0059] Step S104: when it is determined that the UAV 100 can avoid the obstacle on the first plane, a first avoiding direction is calculated on the first plane.
[0060] Step S105 , controlling the UAV 100 to perform obstacle avoidance movement in the first avoidance direction.
[0061] When it is determined through judgment that the unmanned aerial vehicle 100 can avoid obstacles on the first plane, the first avoidance direction is calculated, and the first avoidance direction is calculated to be located on the first plane, and the unmanned aerial vehicle 100 is controlled to move along the calculated first avoidance direction, so that the unmanned aerial vehicle 100 avoids obstacles on the first plane.
[0062] Step S106: When it is determined that the UAV 100 cannot avoid the obstacle on the first plane, it is determined whether the UAV 100 can avoid the obstacle on a second plane.
[0063] The second plane in the embodiment of the present application is a plane different from the first plane, the second plane intersects with the first plane, and the intersection line of the two planes coincides with the current direction of movement. When it is determined that the unmanned aerial vehicle 100 cannot avoid obstacles on the first plane, it indicates that the obstacle on the first plane has a long extension length on the first plane, which may be a wall, a horizontal wire, etc. At this time, if the unmanned aerial vehicle 100 continues to move on the first plane, it needs to make a large angle turn on the first plane to avoid the obstacle, which requires a large change in the movement route of the unmanned aerial vehicle 100. The "inability to avoid obstacles" in the embodiment of the present application does not mean that it cannot be avoided in an absolute sense. It is just that when the first distance is less than the diameter of the first obstacle avoidance area, it indicates that the extension length of the obstacle on the first plane is too long, and it may be uneconomical for the unmanned aerial vehicle 100 to continue to avoid obstacles on the first plane. Therefore, it is determined that the unmanned aerial vehicle 100 cannot avoid obstacles on the first plane to perform obstacle avoidance determination on the second plane and calculation of the second obstacle avoidance direction.
[0064] In the embodiment of the present application, the reference object for the movement of the UAV 100 may be the ground. If the UAV 100 moves relative to the ground, it will have a parameter of "current direction of movement" for the above calculation. However, if the UAV 100 is stationary relative to the ground, but the obstacle is moving relative to the ground or relative to the UAV 100, although the UAV 100 does not have the parameter of "current direction of movement" because it is stationary relative to the ground, if the reference object of the UAV 100 is converted into an obstacle, the UAV 100 is moving relative to the obstacle. At this time, the obstacle's direction of movement can be detected and converted into the current direction of movement of the UAV 100, which is convenient for the subsequent calculation of the avoidance direction.
[0065] Step S107: when it is determined that the UAV 100 can avoid the obstacle on the second plane, a second avoiding direction is calculated on the second plane.
[0066] Step S108: controlling the UAV 100 to perform obstacle avoidance movement in the second avoidance direction.
[0067] The setting method of the first plane and the second plane can be set according to the specific situation. For the convenience of calculation, the first plane can be a plane parallel to the horizontal plane, and the second plane is perpendicular to the first plane. Obstacle avoidance on the first plane is to avoid obstacles in the horizontal direction, and obstacle avoidance on the second plane is to avoid obstacles in the vertical direction. If it is determined that the unmanned aerial vehicle 100 cannot avoid obstacles on the first plane, a determination is made on the second plane. If the conditions for obstacle avoidance movement are met, the second avoidance direction is calculated to achieve avoidance on the second plane. For example, the unmanned aerial vehicle 100 encounters a wall during flight in the horizontal direction. The horizontal direction is the first plane. After determination, the unmanned aerial vehicle 100 cannot avoid obstacles in the horizontal direction. At this time, a determination is made on the second plane. Assuming that the second plane is a vertical plane, after determination, the unmanned aerial vehicle 100 can perform obstacle avoidance movement on the vertical plane. At this time, the UAV 100 can directly calculate the second avoidance direction on the water plane to achieve obstacle avoidance on the vertical plane. This is reflected in the flight trajectory as the UAV 100 changes from horizontal movement to vertical movement, passes over the wall, and avoids the wall.
[0068] Further, such as Figure 4 As shown, step S103 of determining whether the UAV 100 can avoid obstacles on the first plane may specifically include:
[0069] Step S1031: Detect a first edge position point of the obstacle on the first plane.
[0070] In the embodiment of the present application, a first circular area is preset, and the time point when an obstacle is detected in the first circular area is used as the time point to start determining whether the obstacle can be avoided. The preset first circular area is located on a first plane, and the first plane can be a plane that includes the current position point of the unmanned aerial vehicle 100 and is parallel to the horizontal plane, or a plane that changes dynamically according to the motion state of the unmanned aerial vehicle 100. After the first circular area is determined, the first plane where the first circular area is located is determined.
[0071] The first circular area can be set according to the specific form of the sensor on the unmanned aerial vehicle 100. In actual work, the detection range of the sensor on the unmanned aerial vehicle 100 can be three-dimensional, but the detection height range of this three-dimensional detection range is small. In the embodiment of the present application, the detection range of the sensor is equivalent to a plane, and the detection plane of the sensor can be used as the plane where the first circular area is located. For example, when the unmanned aerial vehicle 100 is in motion, as the flight posture of the unmanned aerial vehicle 100 changes (such as level flight, side flight, etc.), the detection range of the sensor will change dynamically with the flight posture, and then the first plane where the first circular area is located will change dynamically. The embodiment of the present application does not limit the specific setting form of the first circular area.
[0072] After the first circular area is determined, the edge position points of the obstacles on the plane where the first circular area is located can be detected. Figure 3 As shown, point A and point B are the first edge position points of the obstacle on the plane where the first circular area is located. For ease of understanding, Figure 3 Only one obstacle is shown.
[0073] In the embodiment of the present application, the edge point of the obstacle detected by the sensor on the UAV 100 is used as the edge position point, that is, when the current position point of the UAV 100 is used as the starting point of the sensor transmitting the signal, the tangent point where the straight line where the signal emitted by the sensor is located and the obstacle is tangent is the edge position point. Figure 3 In the example, two tangent lines are drawn from the current position point to the obstacle, forming two tangent points A and B with the obstacle. Tangent points A and B are the first edge position points of the obstacle on the plane where the first circular area is located. When detecting obstacles, not only the distance between the point on the obstacle closest to the current position point of the unmanned aerial vehicle 100 and the current position point can be detected, but also the edge position points on the obstacle can be detected. The edge position points described in the embodiment of the present application are the edges of the obstacle detected at the position of the current position point. Generally, two first edge position points can be obtained for an obstacle on the plane where the first circular area is located.
[0074] Step S1032: determine a first sector-shaped area on the first plane, wherein the vertex of the first sector-shaped area is the center of the first circular area.
[0075] The size of the first sector-shaped area in the embodiment of the present application can coincide with the detection range of the obstacle avoidance sensor on the first plane, and the detection range of the obstacle avoidance sensor on the first plane can be equated to a sector. At this time, the size of the central angle of the first sector-shaped area is equal to the viewing angle of the obstacle avoidance sensor. In addition, the first sector-shaped area can also be set separately according to actual conditions, and is not equal to the viewing angle of the obstacle avoidance sensor. The setting form of the first sector-shaped area is not limited in this application. Preferably, the bisector of the central angle of the first sector-shaped area coincides with the current movement direction of the unmanned aerial vehicle 100. If a binocular camera is used as an obstacle avoidance sensor, the viewing angle range of the binocular camera on the first plane can be determined as the first sector-shaped area. Figure 3 In the figure, OYY' is the first sector area.
[0076] Step S1033 , determining a cylindrical area including the UAV 100 .
[0077] In the embodiment of the present application, the area where the UAV 100 is located is equivalent to a cylinder, that is, a cylindrical area, the radius of the bottom surface of the cylindrical area can be set to be a certain value larger than the projection area of the UAV 100 on the horizontal plane, and the height of the cylindrical area is a certain value larger than the height of the UAV 100. The specific size of the cylindrical area can be set according to the specific structure of the UAV 100. The cylindrical area includes the structure of the entire UAV 100.
[0078] Step S1034 , determining a first obstacle avoidance area including the UAV 100 .
[0079] After determining the cylindrical area, it is also necessary to determine the first obstacle avoidance area to facilitate determining whether the UAV 100 can avoid obstacles on the first plane. The first obstacle avoidance area in the embodiment of the present application is circular, the radius of the first obstacle avoidance area is smaller than the radius of the first circular area, and is coplanar and concentric with the first circular area. The bottom surface of the cylindrical area is parallel to the first obstacle avoidance area, and the first obstacle avoidance area coincides with the projection of the cylindrical area on the first plane. Figure 3 In the figure, the smallest circle with O as the center is the first obstacle avoidance area.
[0080] Preferably, the radius of the first obstacle avoidance area is a preset constant, and the radius of the first circular area is Or a preset constant. Wherein, R1 is the radius of the first circular area, v is the current moving speed of the UAV 100, a is the maximum acceleration when braking in the current moving direction, and R2 is the radius of the first obstacle avoidance area.
[0081] Step S1035: Select two of the first edge position points as first target points, and calculate the distance between each of the first target points and the radius of the first sector area closest to the first target point, which is recorded as the first distance.
[0082] Since the unmanned aerial vehicle 100 may encounter more than one obstacle during its movement, if a certain obstacle is detected to be located within the first circular area, two first edge position points will be detected for the single obstacle, and the two first edge position points will be used as the first target points to calculate the first distance. Generally, the first sector area is the detection area of the obstacle avoidance sensor on the first plane, the detected first edge position point is located within the first sector area, and the calculation of the first distance is based on the two first target points. Calculate the first distance between the first target point and the radius of the first sector area closest to the first target point.
[0083] like Figure 3 As shown, the distances between point A and point B and the radii OY and O' of the first sector area are calculated, that is, the lengths of AA' and BB' are calculated respectively.
[0084] Step S1036, comparing the first distance with the diameter of the first obstacle avoidance area;
[0085] Step S1037: When the maximum distance among the first distances is smaller than the diameter of the first obstacle avoidance area, it is determined that the UAV 100 cannot avoid the obstacle on the first plane.
[0086] Step S1038: When at least one of the first distances is greater than the diameter of the first obstacle avoidance area, it is determined that the UAV 100 can avoid the obstacle on the first plane.
[0087] After calculating the first distances, if the maximum distance among the first distances is less than the diameter of the first obstacle avoidance area, it is determined that the UAV 100 cannot avoid the obstacle. If at least one of the two first distances calculated is greater than the diameter of the first obstacle avoidance area, it is determined that the UAV 100 can perform obstacle avoidance movement on the first plane. Figure 3 As shown, the lengths of AA' and BB' are compared with the diameter length of the first obstacle avoidance area.
[0088] In addition, since multiple obstacles may be detected in the first circular area at the same time during the movement of the UAV 100, the number of detected first edge position points will be more than two, and two points need to be selected from the multiple first edge position points as the first target points for calculation. Figure 5 As shown, the step S1035 of selecting two first target points from the detected first edge position points may specifically include:
[0089] Step S10351, determining the number of obstacles on the first plane.
[0090] The prerequisite for determining the first target point is to detect that an obstacle is located within the first circular area. Since the obstacle described in the embodiment of the present application is located within the first circular area, it means that the distance between the point on the obstacle closest to the current position point and the current position point is less than or equal to the radius of the first circular area.
[0091] There are two cases where the obstacle is located within the first circular area: one is that the distance between the point on the obstacle closest to the current position and the current position is equal to the first distance, that is, one point on the obstacle is in contact with the outermost edge of the first circular area, and the rest of the obstacle is located outside the first circular area. The other case is that the distance between the point on the obstacle closest to the current position and the current position is less than the first distance, indicating that part of the obstacle is already within the first circular area.
[0092] The first situation mentioned above generally occurs when the unmanned aerial vehicle 100 moves autonomously. No obstacle is detected at the beginning of the movement. After moving to a certain position, an obstacle is detected. However, when the obstacle is detected, the distance between the point on the obstacle closest to the current position and the current position is still greater than the radius of the first circular area. At this time, no determination is made as to whether the obstacle can be avoided. As the unmanned aerial vehicle 100 continues to move, the distance between the point on the obstacle closest to the current position and the current position becomes smaller and smaller. When the distance between the two decreases to be equal to the radius of the first circular area, a determination is made as to whether the obstacle can be avoided.
[0093] The second situation is that the unmanned aerial vehicle 100 has already detected the obstacle when it starts to detect the obstacle, and the distance between the point on the obstacle closest to the current position and the current position is less than the radius of the first circular area. In this case, when the unmanned aerial vehicle 100 and the obstacle move relative to each other, it will immediately determine whether the obstacle can be avoided.
[0094] In short, when determining the first target point, it is necessary to first determine the number of obstacles on the first plane, and the obstacles whose number needs to be determined are obstacles at the outer edge of the first circular area or inside it. The specific number of obstacles can be detected by the obstacle avoidance sensor on the unmanned aerial vehicle 100.
[0095] Step S10352: when the number of the obstacles on the first plane is 1, two first edge position points of the obstacle on the first plane are used as the two first target points.
[0096] Step S10353: when the number of obstacles on the first plane is greater than 1, it is determined in sequence whether the minimum distance between the two innermost first edge position points of two adjacent obstacles is greater than or equal to the diameter length of the first obstacle avoidance area.
[0097] In the embodiment of the present application, when the number of obstacles determined on the first plane is greater than one, it is necessary to further determine the minimum spacing between the first edge position points of two adjacent obstacles. Two first edge position points can be determined for each obstacle on the first plane, and the minimum spacing refers to the distance between the two innermost first edge position points of the two adjacent obstacles. By comparing the minimum spacing with the diameter of the first obstacle avoidance area, it can be determined whether the unmanned aerial vehicle 100 can pass through the two obstacles.
[0098] Step S10354: If the minimum distance is greater than or equal to the diameter length of the first obstacle avoidance area, two first edge position points of any one of the obstacles are used as the two first target points.
[0099] If the calculated minimum distance is greater than or equal to the diameter of the first obstacle avoidance area, it indicates that the distance between two adjacent obstacles allows the UAV 100 to pass through. At this time, the two first edge positions of any obstacle can be selected as the first target points to determine whether the obstacle can be avoided later.
[0100] Step S10355: If the minimum distance is less than the diameter of the first obstacle avoidance area, the two outermost first edge position points of two adjacent obstacles are used as the two first target points.
[0101] If the minimum distance is less than the diameter of the first obstacle avoidance area, it indicates that the distance between two adjacent obstacles is small, and the UAV 100 cannot pass through the two obstacles. Therefore, such two adjacent obstacles can be regarded as one obstacle, and only the two outermost first edge position points are selected as the first target points to determine whether the obstacles can be avoided.
[0102] like Figure 6 As shown, Figure 6 Two obstacles are shown in the figure, and the current movement direction of the unmanned aerial vehicle 100 is vertically upward. We assume that the points on the two obstacles touch the edge of the first circular area at the same time. At this time, it is necessary to determine whether the obstacle can be avoided. However, since the number of obstacles located in the first circular area is more than two. It is necessary to determine the distance between the two innermost first edge position points of the two adjacent obstacles in sequence (either clockwise or counterclockwise), that is, determine the distance between M and Q, and compare the length of the line segment MQ with the diameter of the first obstacle avoidance area. If the length of MQ is greater than or equal to the diameter of the first obstacle avoidance area, any obstacle is selected to determine whether the obstacle can be avoided. If the length of MQ is less than the diameter of the first obstacle avoidance area, the two obstacles are regarded as one obstacle, that is, the two first edge position points of point W and point N are selected as the first target points to determine whether the obstacle can be avoided.
[0103] Through the above-mentioned first target point selection process, it is possible to determine whether obstacles can be avoided when the number of obstacles is one or more.
[0104] In another specific embodiment, Figure 7 As shown, for the sake of clear description, Figure 7 Only the branch step of determining whether the UAV 100 can avoid the obstacle on the second plane is shown. When it is determined that the UAV 100 cannot avoid the obstacle on the second plane, the method further includes:
[0105] Step S109: calculating a third avoiding direction on the first plane.
[0106] Step S110, controlling the UAV 100 to perform obstacle avoidance movement in the third avoidance direction.
[0107] In the embodiment of the present application, the judgment of whether the obstacle can be avoided on the second plane is performed only when the obstacle cannot be avoided on the first plane. When it is determined that the unmanned aerial vehicle 100 cannot avoid the obstacle on the second plane, it indicates that the two second distances calculated on the second plane are both less than the height of the second obstacle avoidance area perpendicular to the current direction of movement. At this time, if the unmanned aerial vehicle 100 needs to rotate on the second plane in order to find a new angle that satisfies the calculation of the second avoidance direction, it may take more time. At this time, the calculation of the third avoidance direction is started on the first plane. The specific calculation process of the third avoidance direction is the same as the calculation of the first avoidance direction, but the premise of starting the calculation of the third avoidance direction is different from the premise of calculating the first avoidance direction. Through the calculation of the third avoidance direction, even if the unmanned aerial vehicle 100 is judged to be unable to avoid the obstacle on both planes, it can still avoid the obstacle through the calculation and movement of the third avoidance direction.
[0108] Further, such as Figure 7 As shown, when it is determined that the UAV 100 cannot avoid the obstacle on the second plane, the method further includes
[0109] Step S111, controlling the UAV 100 to rotate until it is determined that the UAV 100 can avoid the obstacle on the first plane;
[0110] Step S112, calculating a first avoidance direction on the first plane; and
[0111] Step S113: controlling the UAV 100 to perform obstacle avoidance movement in the first avoidance direction.
[0112] As described in step S109, if the unmanned aerial vehicle 100 passes through the judgment on the first plane and the second plane, the result is that the obstacle cannot be avoided. It shows that in the current scene of encountering obstacles, no suitable path for small-angle and short-distance movement to avoid obstacles is found on the first plane, and no suitable path for small-angle and short-distance movement to avoid obstacles is found on the second plane. At this time, only large-angle and long-distance movement can be performed on the first plane to avoid obstacles. When the unmanned aerial vehicle uses a depth sensor that can rotate 360 degrees, such as a laser radar, the third avoidance direction can be calculated directly. When using a depth sensor whose detection angle of view is limited by the installation position, such as a binocular camera, the unmanned aerial vehicle or the depth sensor needs to rotate, and during the rotation process, find the angle at which the first distance is greater than the diameter of the first obstacle avoidance area. And when the angle at which the first distance is greater than the diameter of the first obstacle avoidance area is found, the calculation of the third avoidance direction continues.
[0113] By rotating the UAV 100 or the sensors thereon, a position that can avoid obstacles on the first plane is found. The flight state of the UAV 100 is changed by rotation. During the rotation process, if the UAV 100 does not fly forward and does not generate the parameter "current motion direction", the direction of the bisector of the central angle of the first sector area can still be used as the parameter of the current motion direction in the process of calculating the avoidance direction.
[0114] After the unmanned aerial vehicle 100 has determined whether it can avoid obstacles on two planes, and has obtained the result that it cannot avoid obstacles, it can also move in the opposite direction of the current movement direction to make a concession. It can also rotate itself or the depth sensor at the new position point to find an angle that can avoid obstacles at the new position point, and avoid obstacles through subsequent calculation of the avoidance direction. In this way, the unmanned aerial vehicle can try to avoid obstacles from multiple angles after encountering obstacles, and will not enter a stopped state, and the movement is more intelligent.
[0115] Since the inability to avoid mentioned in this application does not mean that it is completely impossible to avoid in a strict sense, it just means that it is impossible to avoid with the minimum computational cost. However, at this time, both planes cannot be avoided with the minimum computational cost. Therefore, only the first avoidance direction can be calculated directly. Or as described in step S112, the unmanned aerial vehicle 100 is first controlled to rotate, and the obstacle avoidance sensor on the machine will re-detect the situation of the obstacle as the unmanned aerial vehicle 100 rotates, and re-determine whether the obstacle can be avoided. The machine can continue to rotate until it finds an angle that can avoid the obstacle.
[0116] At this time, if the UAV 100 is stationary relative to the obstacle, the bisector of the central angle of the first sector area can be used as the parameter of the current moving direction to perform subsequent calculation of the first avoiding direction.
[0117] Furthermore, if Figure 8 As shown, the step S104 of calculating the first avoidance direction or the third avoidance direction on the first plane specifically includes the following steps. It should be noted that in the embodiment of the present application, the calculation process of the third avoidance direction is the same as the calculation process of the first avoidance direction.
[0118] Step S1041 , calculating a tangent line from each of the first target points to the first obstacle avoidance area, wherein the tangent line intersects with the current moving direction of the UAV 100 .
[0119] After the first target point is determined, the tangent from each first target point to the first obstacle avoidance area is calculated. Two tangents will be obtained from a point outside a circle to the circle. The tangent selected in this application is the tangent that intersects with the current direction of motion, and the tangent that does not intersect with the current direction of motion is excluded. The current direction of motion described in the embodiment of the present application is the direction starting from the current position point of the unmanned aerial vehicle 100. The current direction of motion in the calculation process is a ray, and the tangent selected by the calculation is intersecting with the ray. In general, such a tangent can be calculated for each first target point.
[0120] In the embodiment of the present application, the reference object for the movement of the UAV 100 may be the ground. If the UAV 100 moves relative to the ground, it will have a parameter of "current direction of movement" for the above calculation. However, if the UAV 100 is stationary relative to the ground, but the obstacle is moving relative to the ground or relative to the UAV 100, although the UAV 100 does not have the parameter of "current direction of movement" because it is stationary relative to the ground, if the reference object of the UAV 100 is changed to an obstacle, the UAV 100 is moving relative to the obstacle. At this time, the relative direction of movement between the UAV 100 and the obstacle can be detected by detecting the direction of movement of the obstacle, and the relative direction of movement between the UAV 100 and the obstacle can be changed to the current direction of movement of the UAV 100, so that the above tangent can be determined and the subsequent calculation of the first avoidance direction can be performed.
[0121] See also Figure 3 , we assume that Figure 3 On the first plane shown, the UAV 100 can avoid obstacles. In the process of calculating the first avoidance direction, the tangent lines intersecting the current motion direction determined by the two points A and B are AD and BC respectively.
[0122] Step S1042, calculating a first angle between the tangent line and the current moving direction.
[0123] After determining the tangent, you also need to calculate the angle between the tangent and the current direction of motion. The angle between the tangent and the current direction of motion ranges from zero to 90 degrees, that is, you need to calculate Figure 3 The angles α and β are shown.
[0124] Step S1043: determine the first avoiding direction or the third avoiding direction according to the first angle.
[0125] Since the tangent selected in the embodiment of the present application is a tangent intersecting the current motion direction, two first target points can each determine a tangent, and two first angles can be calculated. It is necessary to determine the direction corresponding to one of the first angles as the first avoidance direction or the third avoidance direction.
[0126] Specifically, Fig. 9 As shown, step S1043 of determining the first evasive direction or the third evasive direction according to the first angle includes:
[0127] Step S10431, determining whether the two first target points are located on the same side of the current moving direction.
[0128] Since the two first target points can determine two tangent lines that intersect the current motion direction and are tangent to the first obstacle avoidance area, it is necessary to first determine the relative orientation of the two first target points to the current motion direction, and determine whether the two first target points are located on both sides of the current motion direction or on the same side.
[0129] exist Figure 3 That is, determine the relative positions of point A and point B with respect to the current direction of movement.
[0130] Step S10432, if the two first target points are located on the same side of the current motion direction, determine the maximum angle among the calculated first angles, and use the direction along the tangent corresponding to the maximum angle and away from the first target point corresponding to the maximum angle as the first avoidance direction.
[0131] When it is determined that the two first target points are located on both sides of the current direction of motion, the two first target points can respectively determine a tangent line that intersects the current direction of motion and is tangent to the first obstacle avoidance area, and the angle between the tangent line and the current direction of motion can be calculated. At this time, the tangent line corresponding to the angle with a larger value is used as the straight line where the first avoidance direction is located, and the first avoidance direction is the direction away from the target point corresponding to the maximum angle. At this time, the unmanned aerial vehicle 100 can use the current position point as the starting point of the obstacle avoidance movement, and perform obstacle avoidance movement along the first avoidance direction or the third avoidance direction to avoid obstacles.
[0132] Step S10433, if the two first target points are located on both sides of the current motion direction, determine the minimum angle among the calculated first angles, and use the direction along the tangent corresponding to the minimum angle and toward the first target point corresponding to the minimum angle as the first avoidance direction or the third avoidance direction.
[0133] When the two first target points are located on both sides of the current movement direction, the tangent corresponding to the angle with a smaller value is selected as the straight line where the first avoidance direction is located, and the first avoidance direction is toward the target point corresponding to the minimum angle. At this time, the unmanned aerial vehicle 100 can perform obstacle avoidance movement along the determined first avoidance direction or the third avoidance direction.
[0134] In addition, when the two first target points are located on both sides of the current movement direction, the values of the two first angles may be equal. At this time, the minimum angles are two, and the tangent corresponding to any one of the first angles can be selected to determine the first avoidance direction or the third avoidance direction.
[0135] exist Figure 3 In the figure, point A and point B are located on both sides of the current motion direction, so it is necessary to determine the minimum angle of the two angles α and β, and use the direction toward the target point corresponding to the minimum angle as the first avoidance direction. If the value of α is small, OE in the figure is parallel to the tangent AD corresponding to α, then the direction toward the target point A is used as the first avoidance direction or the third avoidance direction, that is, obstacle avoidance movement is performed along the direction of OE.
[0136] In addition, in the actual implementation process, the current movement direction can be used as the coordinate axis, and the angles on both sides of the current movement direction can be set to positive or negative angles. In this way, the relative position of the target point and the current movement direction can be determined by judging the positive or negative angle.
[0137] The following Fig.10a As shown, it is a schematic diagram for calculating the angle between the above-mentioned tangent and the current direction of movement. The unmanned aerial vehicle 100 moves in a vertically upward direction, and a point on the obstacle contacts the first circular area. At this time, it is necessary to determine whether the obstacle can be avoided, and calculate the first avoidance direction when it is determined that the obstacle can be avoided. Points G and H are the first edge position points of the obstacle on the first plane, and point O is the current position point. Since there is only one obstacle, the two first edge position points of the obstacle are used as the first target points. The radius of the first circular area is calculated according to the above method, or set to a constant. R2 is the radius of the first obstacle avoidance area set in advance. For the convenience of description, only the tangent calculated from point G is illustrated in the figure. A tangent is drawn from point G to the first obstacle avoidance area. The tangent intersects with the current direction of movement at point I, and the point of intersection between the tangent and the first obstacle avoidance area is J. The first angle described in the embodiment of the present application is the angle α between the tangent AD and the current direction of motion. The value of α is calculated to obtain the first angle corresponding to the first target point G. The first angle corresponding to point H is calculated according to the same method. Points G and H in this embodiment are located on both sides of the current direction of motion. The two first angles are then compared, and the direction along the tangent corresponding to the minimum angle with the smallest value and toward the first target point corresponding to the minimum angle is used as the first avoidance direction or the third avoidance direction.
[0138] exist Fig.10aIn the figure, a perpendicular line can be drawn from point G to the current direction of movement, with point K as the perpendicular point, and point G and point O are connected at the same time. In the actual working process, the distance d between point G and point O can be detected by the sensor on the unmanned aerial vehicle 100, and the angle α between GO and OK can be detected. Assuming that the length of line segment KI is x1, the length of line segment IO is x2, and the length of line segment GK is l, the value of x2 can be calculated according to the following set of equations.
[0139]
[0140] Fig.10a middle, This way we can calculate the value of α,
[0141] The method for calculating the angle corresponding to point H is similar to the above and will not be repeated here. After calculating the angles corresponding to the two target points G and H, the final first avoidance direction needs to be determined. Since the two target points G and H are located on both sides of the current direction of motion, it is necessary to determine the minimum angle among the calculated first angles, and take the direction along the tangent corresponding to the minimum angle and toward the target point corresponding to the minimum angle as the first avoidance direction or the third avoidance direction.
[0142] For the sake of simplicity, no specific numerical calculation is performed here. We assume that the angle calculated corresponding to the target point G is a small value, so the tangent GJ and the direction toward point G are used as the first avoidance direction. As shown in the figure, the ray OL is parallel to GJ, so the unmanned aerial vehicle 100 will perform obstacle avoidance movement along OL, and the angle of the movement steering is α.
[0143] The above calculation process is that an obstacle appears in front of the current moving direction of the UAV 100. If the current moving direction of the UAV 100 remains unchanged, but an attacker appears from the side and rear, the attacker enters the detection range of the sensor and contacts the first circular area, and satisfies the condition of being located in the first circular area, then the obstacle avoidance direction calculation still needs to be performed. Fig.10b As shown, the calculation principle is the same as the above calculation process, but there are some differences in the specific calculation process.
[0144] exist Fig.10b In the example of point G, the length of line segment KO is x1, the length of line segment IO is x2, and the length of line segment GK is 1. At this time, the equation group for calculating x2 is:
[0145]
[0146] Fig.10b middle, The value of α can also be calculated.
[0147] At this time, the first angle between the tangent corresponding to another first target point and the current motion direction is calculated by the same calculation method, and then the tangent corresponding to the first angle is selected according to the above process to determine the first obstacle avoidance direction or the third obstacle avoidance direction.
[0148] In a specific implementation process, a coordinate system may be set, and the corresponding coordinates of the edge position points in the coordinate system may be obtained by detection, and then the corresponding angle may be calculated based on the coordinate relationship using the above calculation formula.
[0149] When the UAV 100 encounters an attacker moving relative to the ground, it can also calculate the avoidance direction according to the calculation process of the first avoidance direction. It only needs to regard the attacker as an obstacle to avoid the attacker.
[0150] Similar to the above steps of determining whether obstacles can be avoided on the first plane, Fig.11 and Fig.12 When it is determined that the unmanned aerial vehicle 100 cannot avoid the obstacle on the first plane, step S106 of determining whether the unmanned aerial vehicle 100 can avoid the obstacle on the second plane specifically includes:
[0151] Step S1061: Detect a second edge position point of the obstacle on the second plane.
[0152] Similar to the step of detecting the first edge position point on the first plane, when judging whether the second plane can avoid obstacles, it is necessary to first detect the second edge position point on the second plane. The obstacle avoidance sensor performs obstacle detection on a second plane different from the first plane, and detects the intersection of the obstacle and the second plane. It can be understood that the detection of the first edge position point is due to the fact that the distance between the point on the obstacle closest to the current position point and the current position point is equal to the radius of the first circular area. A circular area with the same size as the first circular area and the center coinciding with the center of the first circular area can also be established on the second plane. However, since the detection trigger condition of the second edge position point is to determine that the obstacle cannot be avoided on the first plane, the second edge position point can be detected directly on the second plane, eliminating the step of establishing a circular area on the second plane.
[0153] exist Fig.12 In the example, the two second edge position points detected are R and S.
[0154] Step S1062: determine the projection of the cylindrical area on the second plane, which is recorded as the second obstacle avoidance area.
[0155] The projection of the cylindrical area on the first plane is a circle. For the convenience of calculation, the second plane is selected to be a plane perpendicular to the first plane, so that the projection of the cylindrical area on the second plane is a rectangle, which is the second obstacle avoidance area. In the embodiment of the present application, the center of gravity of the cylindrical area coincides with the current position point to facilitate the calculation of the first avoidance direction and the second avoidance direction. Fig.12 In the figure, the rectangle with O as the center is the second obstacle avoidance area.
[0156] Step S1063: determine a second sector-shaped area on the second plane.
[0157] Preferably, the bisector of the central angle of the second sector-shaped area coincides with the current direction of movement of the UAV 100. The second sector-shaped area can be the detection range of the obstacle avoidance sensor on the first plane. The central angle of the second sector-shaped area is the viewing angle of the obstacle avoidance sensor. If a binocular camera is used as the obstacle avoidance sensor, the second plane is set as a vertical plane. The viewing angle of the binocular camera on the vertical plane is generally 30 to 45 degrees. The specific setting method can be set according to the specific situation of the sensor. Fig.12 In the figure, OZZ' is the second sector area.
[0158] Step S1064: select two of the second edge position points on the second plane as second target points, and calculate the distance between each of the second target points and the radius of the second sector area closest to the second target point, which is recorded as the second distance.
[0159] Similar to the step of selecting the first target point, when determining whether an obstacle can be avoided on the second plane, two second target points also need to be selected first. If there is only one obstacle on the second plane, then the two second edge position points of the obstacle are directly used as the second target points. The first edge position point in the embodiment of the present application is the edge position point on the first plane. In order to distinguish it from the edge position point on the first plane, the edge position point detected on the second plane is used as the second edge position point.
[0160] After the second target point is determined, the distance between each second target point and the radius of the second sector area closest to the second target point is calculated, that is, the second distance is calculated. Fig.12 In the example, point R and point S are taken as the second target points, and the second distance is calculated, that is, the lengths of RR' and SS' are calculated respectively.
[0161] Step S1065: Compare the second distance with the height of the second obstacle avoidance area on a second plane perpendicular to the current moving direction.
[0162] Step S1066: When the maximum distance in the second distances is less than the height of the second obstacle avoidance area on the second plane perpendicular to the current moving direction, it is determined that the UAV 100 cannot avoid the obstacle on the second plane.
[0163] Step S1067: When at least one of the second distances is greater than the height of the second obstacle avoidance area on the second plane perpendicular to the current moving direction, it is determined that the UAV 100 can avoid the obstacle on the second plane.
[0164] The height of the second obstacle avoidance area on the second plane perpendicular to the current direction of movement is the length of one side of the rectangle, that is, the length of the side perpendicular to the current direction of movement. After the second distance is calculated, the second distance is compared with the length of the side to determine whether the unmanned aerial vehicle 100 can perform obstacle avoidance movement on the second plane. When both of the second distances are smaller than the length of the side, it is determined that the unmanned aerial vehicle 100 cannot avoid the obstacle on the second plane. When at least one of the second distances is greater than the length of the side of the rectangle, it is determined that the unmanned aerial vehicle 100 can avoid the obstacle on the second plane. Fig.12 In the example, the lengths of RR' and SS' are compared with the length of the short side of the rectangle. And it is determined whether the obstacle can be avoided on the second plane according to the comparison result.
[0165] like Fig.13 As shown, the step S1064 of selecting two second edge position points on the second plane as second target points specifically includes:
[0166] Step S10641, determining the number of obstacles on the second plane.
[0167] Similar to the process of determining the number of obstacles on the first plane, the number of obstacles on the second plane also needs to be determined.
[0168] Step S10642: when the number of the obstacles on the second plane is 1, two second edge position points of the obstacle on the second plane are used as the two second target points.
[0169] Step S10643: when the number of obstacles on the second plane is greater than 1, it is determined in sequence whether the minimum distance between the two innermost second edge position points of two adjacent obstacles is greater than or equal to the height of the second obstacle avoidance area on the second plane.
[0170] Step S10644: If the minimum distance is greater than or equal to the height of the second obstacle avoidance area on the second plane, two second edge position points of any one of the obstacles are used as the two second target points.
[0171] Step S10645: If the minimum distance is less than the height of the second obstacle avoidance area on the second plane, the two outermost second edge position points of two adjacent obstacles are used as the two second target points.
[0172] In summary, if Fig.14 As shown, the step S107 of calculating the second avoidance direction on the second plane includes the following steps.
[0173] Step S1071, calculating a tangent line from each of the second target points to the second obstacle avoidance area, wherein the tangent line intersects with the current moving direction of the UAV 100;
[0174] Step S1072, calculating a second angle between the tangent line and the current moving direction; and
[0175] Step S1073: determine the second avoiding direction according to the second angle.
[0176] Specifically, Fig.15 As shown, step S1073 of determining the second avoiding direction according to the second angle includes:
[0177] Step S10731, determining whether the two second target points are located on the same side of the current moving direction;
[0178] Step S10732, if the two second target points are located on the same side of the current motion direction, determine the maximum angle among the calculated second angles, and use the direction along the tangent corresponding to the maximum angle among the second angles and away from the second target point corresponding to the maximum angle as the second avoidance direction;
[0179] Step S10733, if the two second target points are located on both sides of the current motion direction, determine the minimum angle among the calculated second angles, and take the direction along the tangent corresponding to the minimum angle among the second angles and toward the second target point corresponding to the minimum angle as the second avoidance direction.
[0180] The process of calculating the second avoidance direction is similar to the process of calculating the first avoidance direction described above, and will not be repeated here.
[0181] Further, such as Fig.16As shown, after controlling the unmanned aerial vehicle 100 to perform obstacle avoidance movement in the first avoidance direction or the second avoidance direction on the first plane or the second plane, the method further includes:
[0182] Step S114, determining the evasion speed of the UAV 100 to evade the obstacle.
[0183] After the avoidance direction of the UAV 100 is calculated, the avoidance speed of the UAV 100 may also be determined.
[0184] Specifically, the UAV 100 moves at an expected speed in the current moving direction, and the expected speed may be a speed set by a control instruction for controlling the movement of the UAV 100, that is, the avoidance speed is the same as the expected speed.
[0185] Step S115, controlling the UAV 100 to perform obstacle avoidance movement in the first avoidance direction or the second avoidance direction at the avoidance speed.
[0186] In the embodiment of the present application, the UAV 100 may move at a desired speed before performing obstacle avoidance movement, and after encountering an obstacle and performing obstacle avoidance movement, the speed may be maintained unchanged, and the direction of movement may be adjusted to the avoidance direction.
[0187] In the embodiment of the present application, since the operating environment of the unmanned aerial vehicle 100 may be more complex and face more obstacles, the unmanned aerial vehicle 100 can also be set to run at a preset fixed speed for a preset time after each obstacle avoidance movement, that is, after moving a fixed step length, obstacle detection and avoidance direction calculation are performed to ensure that the movement of the unmanned aerial vehicle 100 is smoother.
[0188] By determining the avoidance speed of the UAV 100 , it can be ensured that the UAV 100 can react more quickly during obstacle avoidance movement and avoid obstacles in a timely manner.
[0189] The UAV 100 moves at an expected speed in a current moving direction, where the expected speed is a speed set by a control instruction for controlling the movement of the UAV 100, and the avoidance speed is the same as the expected speed.
[0190] Further, such as Fig.17 As shown, after the step of controlling the UAV 100 to perform obstacle avoidance movement in the first avoidance direction, the method further includes:
[0191] Step S116, determining whether there are any obstacles in the first circular area.
[0192] After the unmanned aerial vehicle 100 performs obstacle avoidance movement, if there is no obstacle within the first circular area, the unmanned aerial vehicle 100 can move normally. If there is still an obstacle within the first circular area, the avoidance direction calculation described above needs to be repeated, which will not be repeated here.
[0193] Step S117, when there is no obstacle in the first circular area, determining the motion mode of the UAV 100, the motion mode including a directional mode and a fixed-point mode;
[0194] Step S118, when it is determined that the UAV 100 is moving in the directional mode on the first plane, controlling the UAV 100 to continue moving in the directional mode after performing obstacle avoidance movement;
[0195] Step S119, when it is determined that the UAV 100 moves in the fixed-point mode, after the UAV 100 performs obstacle avoidance movement, the movement direction of the UAV 100 and the end point is re-determined, and the UAV 100 is controlled to continue moving in the re-determined movement direction.
[0196] When the unmanned aerial vehicle 100 is moving, it may be controlled by the control system to move in a fixed direction, such as forward. At this time, if an obstacle avoidance movement is performed and no obstacles are detected in the first circular area, the unmanned aerial vehicle 100 can still maintain the original direction of movement, that is, the directional mode, so that the direction of movement of the unmanned aerial vehicle 100 before and after the obstacle avoidance movement remains unchanged. In the directional mode, the unmanned aerial vehicle 100 does not move along the avoidance direction all the time, but after making an obstacle avoidance movement along the avoidance direction, further adjusts the movement direction to the original direction. In the directional mode, the time for the unmanned aerial vehicle 100 to perform the obstacle avoidance movement can also be pre-set, or the distance for the obstacle avoidance movement can be pre-set. After the time of the obstacle avoidance movement expires or the distance of the obstacle avoidance movement is completed, it continues to move in the original direction in the directional mode.
[0197] In the fixed-point mode, the UAV 100 has a pre-set end point. The UAV 100 needs to plan a trajectory between the end points and move along the trajectory. However, if obstacle avoidance is performed during the fixed-point mode movement, the UAV 100 needs to re-plan the trajectory between the end points after avoiding the obstacle and continue moving along the re-planned trajectory to eventually reach the preset end point and complete the entire autonomous movement process.
[0198] By determining the motion mode of the UAV 100 after the obstacle avoidance motion and then controlling the UAV 100 to continue moving, the UAV 100 can achieve completely autonomous obstacle avoidance and perform different motions according to different motion modes after obstacle avoidance.
[0199] The above steps S117 to S120 are for determining the motion mode on the first plane. Fig.18 As shown, after the step of controlling the UAV 100 to perform obstacle avoidance movement in the second avoidance direction, the method further includes:
[0200] Step S120, determining whether there are any obstacles in the first circle;
[0201] Step S121, when there is no obstacle in the first circle, determining the motion mode of the UAV 100 on the second plane, the motion mode including a directional mode and a fixed-point mode;
[0202] Step S122, when it is determined that the UAV 100 is moving in the directional mode on the second plane, controlling the UAV 100 to continue moving in the directional mode after performing obstacle avoidance movement;
[0203] Step S123, when it is determined that the UAV 100 moves in a fixed-point mode on the second plane, after the UAV 100 performs obstacle avoidance movement, the movement direction of the UAV 100 and the end point is redetermined, and the UAV 100 is controlled to continue moving in the redetermined movement direction.
[0204] The process from step S120 to step S123 is similar to the process from step S116 to step S119, and will not be repeated here.
[0205] like Fig.19 As shown, the embodiment of the present application further provides an obstacle avoidance device 200, which is applied to the unmanned aerial vehicle 100. The obstacle avoidance device 200 includes: an obstacle detection module 201, an avoidance determination module 202, an avoidance direction calculation module 203 and an obstacle avoidance control module 204.
[0206] The obstacle detection module 201 is used to detect whether there are obstacles around the unmanned aerial vehicle 100. It is also used to determine whether the obstacle is located in the first circular area when an obstacle is detected. The specific way in which the obstacle detection module 201 detects obstacles can refer to the detailed description of steps S101 and S102 above. That is, the above steps S101 and S102 can be executed by the obstacle detection module 201.
[0207] The avoidance determination module 202 is used to determine whether the unmanned aerial vehicle can avoid the obstacle on the first plane when an obstacle is detected. It is also used to determine whether the unmanned aerial vehicle can avoid the obstacle on the first plane when it is determined that the obstacle is located in the first circular area. The avoidance determination module 202 is also used to determine whether the unmanned aerial vehicle can avoid the obstacle on the second plane when it is determined that the unmanned aerial vehicle cannot avoid the obstacle on the first plane. The steps of the avoidance determination module 202 to determine whether the obstacle can be avoided can refer to the detailed description of step S103 and its sub-steps, step S106 and its sub-steps above. That is, the above-mentioned steps S103 and its sub-steps, step S106 and its sub-steps can be executed by the avoidance determination module 202.
[0208] The avoidance direction calculation module 203 is used to calculate the first avoidance direction on the first plane when it is determined that the unmanned aerial vehicle can avoid the obstacle on the first plane. It is also used to calculate the second avoidance direction on the second plane when it is determined that the unmanned aerial vehicle can avoid the obstacle on the second plane. The avoidance direction calculation module 203 is also used to calculate the third avoidance direction when it is determined that the obstacle cannot be avoided on both the first plane and the second plane, and to calculate the first avoidance direction after the unmanned aerial vehicle itself or the deep sensor rotates. The specific manner in which the avoidance direction calculation module 203 calculates the avoidance direction can refer to the detailed description of step S104 and its sub-steps, step S107 and its sub-steps above. That is, the above-mentioned step S103 and its sub-steps, step S107 and its sub-steps can be executed by the avoidance direction calculation module 203.
[0209] The obstacle avoidance control module 204 is used to control the unmanned aerial vehicle 100 to perform obstacle avoidance movement in the first avoidance direction or the second avoidance direction. The obstacle detection module 201 can detect the first edge position point of the obstacle in the first plane where the first circular area is located and the second edge position point of the second plane. The method for the avoidance direction calculation module 203 to calculate the first avoidance direction, the second avoidance direction or the third avoidance direction for the unmanned aerial vehicle 100 to avoid the obstacle is described in detail above with respect to step S104 and step S107.
[0210] Furthermore, the device also includes an avoidance speed determination module 205, which is used to determine the avoidance speed of the unmanned aerial vehicle 100 to avoid the obstacle; the obstacle avoidance control module is also used to control the unmanned aerial vehicle 100 to perform obstacle avoidance movement at the avoidance speed in the avoidance direction. Preferably, the unmanned aerial vehicle 100 moves at an expected speed in the current movement direction, and the expected speed is the speed set by the control instruction for controlling the movement of the unmanned aerial vehicle 100, and the size of the avoidance speed is the same as the size of the expected speed. The specific manner in which the avoidance speed determination module 205 determines the avoidance speed can refer to the detailed description of steps S115 and S116 above. That is, the above steps S115 and S116 can be executed by the avoidance speed determination module 205.
[0211] In a specific embodiment, after the obstacle avoidance control module controls the UAV 100 to perform obstacle avoidance movement in the avoidance direction, the obstacle detection module is further used to determine whether there are still obstacles in the first circular area. The device also includes a motion mode determination module 206, which is used to determine the motion mode of the UAV 100 in the first plane or the second plane when it is determined that there are no obstacles in the first circular area, and the motion mode includes a directional mode and a fixed-point mode; the obstacle avoidance control module 204 is also used to control the UAV 100 to continue to move in the directional mode after performing the obstacle avoidance movement when it is determined that the UAV 100 moves in the directional mode; the obstacle avoidance control module 204 is also used to redetermine the motion direction of the UAV 100 and the end point after the UAV 100 performs the obstacle avoidance movement when it is determined that the UAV 100 moves in the fixed-point mode, and control the UAV 100 to continue to move in the redetermined motion direction. The specific way in which the motion mode determination module 206 determines the motion mode can refer to the detailed description of steps S116 to S123 above. That is, the above steps S116 to S123 may be executed by the motion mode determination module 206 .
[0212] In summary, in the obstacle avoidance method, obstacle avoidance device and unmanned aerial vehicle 100 provided in the embodiments of the present application, during the flight of the unmanned aerial vehicle 100, a determination is first made on the first plane whether an obstacle can be avoided, and if the obstacle can be avoided on the first plane, a first avoidance direction is calculated. If it is determined that the obstacle cannot be avoided on the first plane, a determination is further made on the second plane whether an obstacle can be avoided and a second avoidance direction is calculated.
[0213] In this way, autonomous obstacle avoidance in three-dimensional space can be achieved through the judgment and calculation of two different planes. And the calculation of the first avoidance direction or the second avoidance direction is a geometric operation performed by establishing a geometric area. There is no need to perform complex calculations such as deep learning and neural network algorithms. The system has a low computing load and consumes less computing resources. It can quickly and in real time calculate feasible avoidance directions for obstacles, and can realize autonomous obstacle avoidance movement of unmanned aerial vehicles in complex environments, making the movement trajectory of unmanned aerial vehicles more intelligent and close to the optimal path.
[0214] The embodiment of the obstacle avoidance device of the present invention may be implemented by software code, in which case the above modules may be stored in the memory 102 of the unmanned aerial vehicle 100. The above modules may also be implemented by hardware such as an integrated circuit chip. Those skilled in the art may clearly understand that for the convenience and simplicity of description, the specific description of the functional modules described above may refer to the specific description of the corresponding method steps described above, and will not be repeated here one by one.
[0215] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0216] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0217] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0218] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk. It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0219] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention. It should be noted that similar numbers and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0220] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. An obstacle avoidance method, applied to an unmanned aerial vehicle, characterized in that: The method includes: Detecting whether there are obstacles around the unmanned aerial vehicle; When an obstacle is detected, determining whether the unmanned aerial vehicle can avoid the obstacle on a first plane; When it is determined that the UAV can avoid the obstacle on the first plane, calculating a first avoidance direction on the first plane; Controlling the unmanned aerial vehicle to perform obstacle avoidance movement in the first avoidance direction; When it is determined that the UAV cannot avoid the obstacle on the first plane, determining whether the UAV can avoid the obstacle on a second plane, where the second plane intersects the first plane and has a preset angle; When it is determined that the UAV can avoid the obstacle on the second plane, calculating a second avoidance direction on the second plane; The unmanned aerial vehicle is controlled to perform obstacle avoidance movement in the second avoidance direction.
2. The obstacle avoidance method according to claim 1, characterized in that: Before the step of determining whether the obstacle can be avoided on the first plane, the method further includes: Determining whether the obstacle is located within the first circular area; When the obstacle is located within the first circular area, it is determined whether the unmanned aerial vehicle can avoid the obstacle on the first plane, wherein the first plane is the plane where the first circular area is located.
3. The obstacle avoidance method according to claim 2, characterized in that: The step of determining whether the unmanned aerial vehicle can avoid the obstacle on the first plane where the first circular area is located comprises: Detecting a first edge position point of the obstacle on the first plane; Determine a first sector-shaped area on the first plane, wherein the vertex of the first sector-shaped area is the center of the first circular area; determining a cylindrical region containing the UAV; Determine a first obstacle avoidance area including the unmanned aerial vehicle, wherein the first obstacle avoidance area is circular, the radius of the first obstacle avoidance area is smaller than the radius of the first circular area, and the first obstacle avoidance area is coplanar and concentric with the first circular area, the bottom surface of the cylindrical area is parallel to the first obstacle avoidance area, and the first obstacle avoidance area and the projection of the cylindrical area on the first plane coincide with each other; Select two of the first edge position points as first target points, and calculate the distance between each of the first target points and the radius of the first sector area closest to the first target point, which is recorded as a first distance; comparing the two first distances with the diameter of the first obstacle avoidance area; When the maximum distance among the first distances is smaller than the diameter of the first obstacle avoidance area, determining that the unmanned aerial vehicle cannot avoid the obstacle on the first plane; When at least one of the first distances is greater than the diameter of the first obstacle avoidance area, it is determined that the UAV can avoid the obstacle on the first plane.
4. The obstacle avoidance method according to claim 3, characterized in that: The step of selecting two of the first detected edge position points as first target points comprises: determining the number of obstacles on the first plane; When the number of the obstacles on the first plane is 1, two first edge position points of the obstacle on the first plane are used as two first target points; When the number of obstacles on the first plane is greater than 1, determining in sequence whether the minimum distance between the two innermost first edge position points of two adjacent obstacles is greater than or equal to the diameter length of the first obstacle avoidance area; If the minimum distance is greater than or equal to the diameter of the first obstacle avoidance area, two first edge position points of any one of the obstacles are used as two first target points; If the minimum distance is smaller than the diameter of the first obstacle avoidance area, the two first edge position points at the outermost sides of two adjacent obstacles are used as the two first target points.
5. The obstacle avoidance method according to claim 4, characterized in that: When it is determined that the UAV cannot avoid the obstacle on the second plane, the method further includes: calculating a third avoidance direction on the first plane; and The unmanned aerial vehicle is controlled to perform obstacle avoidance movement in the third avoidance direction.
6. The obstacle avoidance method according to claim 5, characterized in that: When it is determined that the UAV cannot avoid the obstacle on the second plane, the method further includes: Controlling the UAV to rotate until it is determined that the UAV can avoid the obstacle on the first plane; calculating the first avoidance direction on the first plane; and The unmanned aerial vehicle is controlled to perform obstacle avoidance movement in the first avoidance direction.
7. The obstacle avoidance method according to claim 6, characterized in that: The step of calculating the first avoidance direction or the third avoidance direction on the first plane comprises: Calculating a tangent line from each of the first target points to the first obstacle avoidance area, wherein the tangent line intersects with the current moving direction of the UAV; Calculating a first angle between the tangent line and the current moving direction; and The first avoiding direction is determined according to the first angle.
8. The obstacle avoidance method according to claim 7, characterized in that: The step of determining the avoidance direction according to the first angle comprises: Determining whether the two first target points are located on the same side of the current moving direction; If the two first target points are located on the same side of the current motion direction, determining the maximum angle among the calculated first angles, and taking the direction along the tangent corresponding to the maximum angle and away from the first target point corresponding to the maximum angle as the first avoidance direction or the third avoidance direction; If the two first target points are located on both sides of the current motion direction, the minimum angle among the calculated first angles is determined, and the direction along the tangent corresponding to the minimum angle and toward the first target point corresponding to the minimum angle is used as the first avoidance direction or the third avoidance direction.
9. The obstacle avoidance method according to claim 3, characterized in that: When it is determined that the unmanned aerial vehicle cannot avoid the obstacle on the first plane, the step of determining whether the unmanned aerial vehicle can avoid the obstacle on the second plane includes: Detecting a second edge position point of the obstacle on the second plane; Determine a projection of the cylindrical area on the second plane, recorded as a second obstacle avoidance area; Determine a second sector-shaped area on the second plane, wherein the bisector of the central angle of the second sector-shaped area coincides with the current moving direction of the UAV; Select two of the second edge position points on the second plane as second target points, and calculate the distance between each of the second target points and the radius of the second sector area closest to the second target point, which is recorded as the second distance; comparing the second distance with a height of the second obstacle avoidance area on a second plane perpendicular to the current moving direction; When both of the two second distances are less than the height of the second obstacle avoidance area on the second plane perpendicular to the current motion direction, determining that the unmanned aerial vehicle cannot avoid the obstacle on the second plane; When at least one of the second distances is greater than the height of the second obstacle avoidance area on the second plane perpendicular to the current moving direction, it is determined that the unmanned aerial vehicle can avoid the obstacle on the second plane.
10. The obstacle avoidance method according to claim 9, characterized in that: The step of selecting two of the second edge position points on the second plane as second target points comprises: determining the number of obstacles on the second plane; When the number of the obstacles on the second plane is 1, two second edge position points of the obstacle on the second plane are used as two second target points; When the number of the obstacles on the second plane is greater than 1, determining in sequence whether the minimum distance between the two innermost second edge position points of two adjacent obstacles is greater than or equal to the height of the second obstacle avoidance area on the second plane perpendicular to the current motion direction; If the minimum distance is greater than or equal to the height of the second obstacle avoidance area on the second plane perpendicular to the current moving direction, two second edge position points of any one of the obstacles are used as two second target points; If the minimum distance is smaller than the height of the second obstacle avoidance area on the second plane perpendicular to the current moving direction, the two outermost second edge position points of two adjacent obstacles are used as the two second target points.
11. The obstacle avoidance method according to claim 10, characterized in that: The step of calculating the second avoidance direction on the second plane comprises: Calculating a tangent line from each of the second target points to the second obstacle avoidance area, wherein the tangent line intersects with the current moving direction of the UAV; Calculating a second angle between the tangent line and the current direction of motion; and The second avoiding direction is determined according to the second angle.
12. The obstacle avoidance method according to claim 11, characterized in that: The step of determining the second avoiding direction according to the second angle comprises: Determining whether the two second target points are located on the same side of the current moving direction; If the two second target points are located on the same side of the current motion direction, determining the maximum angle among the calculated second angles, and taking the direction along the tangent corresponding to the maximum angle among the second angles and away from the second target point corresponding to the maximum angle as the second avoidance direction; If the two second target points are located on both sides of the current motion direction, determine the minimum angle among the calculated second angles, and take the direction along the tangent corresponding to the minimum angle among the second angles and toward the second target point corresponding to the minimum angle as the second avoidance direction.
13. The obstacle avoidance method according to claim 1, characterized in that: The method further includes: determining an avoidance speed of the unmanned aerial vehicle to avoid the obstacle; The unmanned aerial vehicle is controlled to perform obstacle avoidance movement in the first avoidance direction or the second avoidance direction at the avoidance speed.
14. The obstacle avoidance method according to claim 13, characterized in that: The unmanned aerial vehicle moves at an expected speed in a current moving direction, the expected speed being a speed set by a control instruction for controlling the movement of the unmanned aerial vehicle, and the avoidance speed is the same as the expected speed.
15. The obstacle avoidance method according to claim 2, characterized in that: After the step of controlling the unmanned aerial vehicle to perform obstacle avoidance movement in the first avoidance direction, the method further comprises: Determine whether there are still obstacles in the first circular area; When there is no obstacle in the first circular area, determining a motion mode of the UAV on the first plane, the motion mode including a directional mode and a fixed-point mode; When it is determined that the UAV is moving in the directional mode on the first plane, controlling the UAV to continue moving in the directional mode after performing obstacle avoidance movement; When it is determined that the UAV is moving in a fixed-point mode on the first plane, after the UAV performs obstacle avoidance movement, the movement direction of the UAV and the end point is redetermined on the first plane, and the UAV is controlled to continue moving in the redetermined movement direction.
16. The obstacle avoidance method according to claim 15, characterized in that: After the step of controlling the unmanned aerial vehicle to perform obstacle avoidance movement in the second avoidance direction, the method further comprises: Determine whether there are still obstacles in the first circular area; When there is no obstacle in the first circular area, determining a motion mode of the UAV on the second plane, the motion mode including a directional mode and a fixed-point mode; When it is determined that the UAV is moving in the directional mode on the second plane, controlling the UAV to continue moving in the directional mode after performing obstacle avoidance movement; When it is determined that the UAV is moving in a fixed-point mode on the second plane, after the UAV performs obstacle avoidance movement, the movement direction of the UAV and the end point is redetermined on the second plane, and the UAV is controlled to continue moving in the redetermined movement direction.
17. An obstacle avoidance device, characterized in that: The device includes: Obstacle detection module, used to detect whether there are obstacles around the UAV; An avoidance determination module, configured to determine whether the unmanned aerial vehicle can avoid the obstacle on a first plane when an obstacle is detected; an avoidance direction calculation module, configured to calculate a first avoidance direction on the first plane when it is determined that the unmanned aerial vehicle can avoid the obstacle on the first plane; an obstacle avoidance control module, used to control the unmanned aerial vehicle to perform obstacle avoidance movement in the first avoidance direction; The avoidance determination module is further configured to determine whether the unmanned aerial vehicle can avoid the obstacle on a second plane when it is determined that the unmanned aerial vehicle cannot avoid the obstacle on the first plane, the second plane intersecting with the first plane and having a preset angle; The avoidance direction calculation module is further used to calculate a second avoidance direction on the second plane when it is determined that the unmanned aerial vehicle can avoid the obstacle on the second plane; The obstacle avoidance control module is also used to control the unmanned aerial vehicle to perform obstacle avoidance movement in the second avoidance direction.
18. The obstacle avoidance device according to claim 17, characterized in that: The obstacle detection module is also used to determine whether the obstacle is located in the first circular area; When the obstacle detection module determines that the obstacle is located in the first circular area, the avoidance determination module determines whether the unmanned aerial vehicle can avoid the obstacle on the first plane, wherein the first plane is the plane where the first circular area is located.
19. The obstacle avoidance device according to claim 18, characterized in that: The method by which the avoidance determination module determines whether the unmanned aerial vehicle can avoid the obstacle on the first plane where the first circular area is located includes: Detecting a first edge position point of the obstacle on the first plane; Determine a first sector-shaped area on the first plane, wherein the vertex of the first sector-shaped area is the center of the first circular area; determining a cylindrical region containing the UAV; Determine a first obstacle avoidance area including the unmanned aerial vehicle, wherein the first obstacle avoidance area is circular, the radius of the first obstacle avoidance area is smaller than the radius of the first circular area, and the first obstacle avoidance area is coplanar and concentric with the first circular area, the bottom surface of the cylindrical area is parallel to the first obstacle avoidance area, and the first obstacle avoidance area and the projection of the cylindrical area on the first plane coincide with each other; Select two of the first edge position points as first target points, and calculate the distance between each of the first target points and the radius of the first sector area closest to the first target point, which is recorded as a first distance; comparing the two first distances with the diameter of the first obstacle avoidance area; When the maximum distance among the first distances is smaller than the diameter of the first obstacle avoidance area, determining that the unmanned aerial vehicle cannot avoid the obstacle on the first plane; When at least one of the first distances is greater than the diameter of the first obstacle avoidance area, it is determined that the UAV can avoid the obstacle on the first plane.
20. The obstacle avoidance device according to claim 19, characterized in that: The obstacle detection module is further used to determine the number of obstacles on the first plane; The avoidance determination module is also used for: When the number of the obstacles on the first plane is 1, two first edge position points of the obstacle on the first plane are used as two first target points; When the number of obstacles on the first plane is greater than 1, determining in sequence whether the minimum distance between the two innermost first edge position points of two adjacent obstacles is greater than or equal to the diameter length of the first obstacle avoidance area; If the minimum distance is greater than or equal to the diameter of the first obstacle avoidance area, two first edge position points of any one of the obstacles are used as two first target points; If the minimum distance is smaller than the diameter of the first obstacle avoidance area, the two first edge position points at the outermost sides of two adjacent obstacles are used as the two first target points.
21. The obstacle avoidance device according to claim 19, characterized in that: The avoidance direction calculation module is further configured to calculate a third avoidance direction on the first plane when it is determined that the UAV cannot avoid the obstacle on the second plane; and The unmanned aerial vehicle is controlled to perform obstacle avoidance movement in the third avoidance direction.
22. The obstacle avoidance device according to claim 21, characterized in that: The avoidance direction calculation module is further used to control the UAV to rotate when it is determined that the UAV cannot avoid the obstacle on the second plane, until it is determined that the UAV can avoid the obstacle on the first plane; calculating the first avoidance direction on the first plane; and The unmanned aerial vehicle is controlled to perform obstacle avoidance movement in the first avoidance direction.
23. The obstacle avoidance device according to claim 22, characterized in that: The method in which the avoidance direction calculation module calculates the first avoidance direction or the third avoidance direction on the first plane includes: Calculating a tangent line from each of the first target points to the first obstacle avoidance area, wherein the tangent line intersects with the current moving direction of the UAV; Calculating a first angle between the tangent line and the current moving direction; and The first evasive direction or the third evasive direction is determined according to the first angle.
24. The obstacle avoidance device according to claim 23, characterized in that: The method in which the avoidance direction calculation module determines the first avoidance direction or the third avoidance direction according to the first angle includes: Determining whether the two first target points are located on the same side of the current moving direction; If the two first target points are located on the same side of the current motion direction, determining the maximum angle among the calculated first angles, and taking a direction along a tangent corresponding to the maximum angle and away from the first target point corresponding to the maximum angle as the first avoidance direction or the third avoidance direction; If the two first target points are respectively located on both sides of the current movement direction, determine the minimum angle among the calculated first angles, and take the direction along the tangent corresponding to the minimum angle and toward the first target point corresponding to the minimum angle as the first avoidance direction or the third avoidance direction.
25. The obstacle avoidance device according to claim 19, characterized in that: When the avoidance determination module determines that the UAV cannot avoid the obstacle on the first plane, the method by which the avoidance determination module determines whether the UAV can avoid the obstacle on the second plane includes: Detecting a second edge position point of the obstacle on the second plane; Determine a projection of the cylindrical area on the second plane, recorded as a second obstacle avoidance area; Determine a second sector-shaped area on the second plane, wherein the bisector of the central angle of the second sector-shaped area coincides with the current moving direction of the UAV; Select two of the second edge position points on the second plane as second target points, and calculate the distance between each second target point and the radius of the second sector area closest to the second target point, which is recorded as the second distance; comparing the second distance with a height of the second obstacle avoidance area on a second plane perpendicular to the current moving direction; When both of the two second distances are less than the height of the second obstacle avoidance area on the second plane perpendicular to the current motion direction, determining that the unmanned aerial vehicle cannot avoid the obstacle on the second plane; When at least one of the second distances is greater than the height of the second obstacle avoidance area on the second plane perpendicular to the current moving direction, it is determined that the unmanned aerial vehicle can avoid the obstacle on the second plane.
26. The obstacle avoidance device according to claim 25, characterized in that: The method in which the avoidance determination module selects two of the second edge position points on the second plane as second target points includes: determining the number of obstacles on the second plane; When the number of the obstacles on the second plane is 1, two second edge position points of the obstacle on the second plane are used as two second target points; When the number of the obstacles on the second plane is greater than 1, determining in sequence whether the minimum distance between the two innermost second edge position points of two adjacent obstacles is greater than or equal to the height of the second obstacle avoidance area on the second plane perpendicular to the current motion direction; If the minimum distance is greater than or equal to the height of the second obstacle avoidance area on the second plane perpendicular to the current moving direction, two second edge position points of any one of the obstacles are used as two second target points; If the minimum distance is smaller than the height of the second obstacle avoidance area on the second plane perpendicular to the current moving direction, the two outermost second edge position points of two adjacent obstacles are used as the two second target points.
27. The obstacle avoidance device according to claim 26, characterized in that: The method in which the avoidance direction calculation module calculates the second avoidance direction on the second plane includes: Calculating a tangent line from each of the second target points to the second obstacle avoidance area, wherein the tangent line intersects with the current moving direction of the UAV; Calculating a second angle between the tangent line and the current direction of motion; and The second avoiding direction is determined according to the second angle.
28. The obstacle avoidance device according to claim 27, characterized in that: The method in which the avoidance direction calculation module determines the second avoidance direction according to the second angle includes: Determining whether the two second target points are located on the same side of the current moving direction; If the two second target points are located on the same side of the current motion direction, determining the maximum angle among the calculated second angles, and taking the direction along the tangent corresponding to the maximum angle among the second angles and away from the second target point corresponding to the maximum angle as the second avoidance direction; If the two second target points are located on both sides of the current motion direction, determine the minimum angle among the calculated second angles, and take the direction along the tangent corresponding to the minimum angle among the second angles and toward the second target point corresponding to the minimum angle as the second avoidance direction.
29. The obstacle avoidance device according to claim 17, characterized in that: The device also includes: An avoidance speed determination module, used to determine the avoidance speed of the unmanned aerial vehicle to avoid the obstacle; The obstacle avoidance control module is further used to control the unmanned aerial vehicle to perform obstacle avoidance movement in the first avoidance direction or the second avoidance direction at the avoidance speed.
30. The obstacle avoidance device according to claim 29, characterized in that: The unmanned aerial vehicle moves at an expected speed in a current moving direction, the expected speed being a speed set by a control instruction for controlling the movement of the unmanned aerial vehicle, and the avoidance speed is the same as the expected speed.
31. The obstacle avoidance device according to claim 18, characterized in that: After the obstacle avoidance control module controls the UAV to perform obstacle avoidance movement in the first avoidance direction, the obstacle detection module is further used to determine whether there are still obstacles in the first circular area. The device also includes a motion mode determination module, which is used to determine the motion mode of the UAV when it is determined that there are no obstacles in the first circular area. The motion mode includes a directional mode and a fixed-point mode. The obstacle avoidance control module is further used to control the unmanned aerial vehicle to continue to move in the directional mode after performing the obstacle avoidance movement when it is determined that the unmanned aerial vehicle moves in the directional mode; The obstacle avoidance control module is also used to, when it is determined that the unmanned aerial vehicle is moving in a fixed-point mode on the first plane, redetermine the movement direction of the unmanned aerial vehicle and the end point on the first plane after the unmanned aerial vehicle performs obstacle avoidance movement, and control the unmanned aerial vehicle to continue moving in the redetermined movement direction.
32. The obstacle avoidance device according to claim 31, characterized in that: After the obstacle avoidance control module controls the unmanned aerial vehicle to perform obstacle avoidance movement in the second avoidance direction, the obstacle detection module is further used to determine whether there are still obstacles in the first circular area; The motion mode is also used to determine the motion mode of the UAV on the second plane when there are no obstacles in the first circular area; The obstacle avoidance control module is further used to control the UAV to continue to move in the directional mode after performing the obstacle avoidance movement when it is determined that the UAV moves in the directional mode on the second plane; The obstacle avoidance control module is also used to, when it is determined that the unmanned aerial vehicle is moving in a fixed-point mode on the second plane, redetermine the movement direction of the unmanned aerial vehicle and the end point on the second plane after the unmanned aerial vehicle performs obstacle avoidance movement, and control the unmanned aerial vehicle to continue moving in the redetermined movement direction.
33. An unmanned aerial vehicle, characterized in that: An obstacle avoidance device comprising any one of claims 17 to 32.
