Plant protection unmanned aerial vehicle irregular farmland path planning method based on convex hull algorithm

By applying a path planning method based on convex hull algorithm in irregular farmlands, combining density clustering algorithm and Yolov7-tiny model for boundary recognition and real-time detection, the problem of boundary recognition and poor adaptability in irregular farmland path planning is solved, and high-precision farmland path planning is achieved, and agricultural operation efficiency is improved.

CN120010478AActive Publication Date: 2025-05-16DALIAN MARITIME UNIVERSITY
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510120480.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-25
Publication Date
2025-05-16
Estimated Expiration
2045-01-25

AI Technical Summary

Technical Problem

In the path planning of irregular farmland, the prior art has problems such as poor coupling of boundary identification and path planning and poor adaptability of complex terrain, resulting in boundary missed or path redundant, and the operation accuracy significantly decreases in complex terrain.

Method used

The irregular farmland path planning method of plant protection drone based on convex hull algorithm is adopted. By obtaining the coordinate data set of farmland boundary points, denoising using density clustering algorithm, introducing convex hull algorithm to generate the smallest external rectangle, combining the Yolov7-tiny model for real-time edge detection, and tilt compensation is performed according to the heading angle detected by the drone acceleration sensor, and the flight angle is adjusted to achieve round-trip farmland path planning.

Benefits of technology

This method effectively reduces boundary omissions and path redundancy, improves the accuracy of irregular farmland path planning, and is suitable for farmland with complex terrain, greatly improving agricultural operation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120010478A_ABST
    Figure CN120010478A_ABST
Patent Text Reader

Abstract

The invention discloses a plant protection unmanned aerial vehicle irregular farmland path planning method based on a convex hull algorithm, and the method comprises the steps: obtaining a coordinate data set of farmland boundary points, and carrying out the denoising of the coordinate data set, and obtaining a denoised data set; introducing a convex hull algorithm, traversing all coordinates in the de-noised data set, finding out a plurality of convex hull points, connecting the convex hull points, generating a minimum enclosing rectangle, and randomly selecting one edge to set a reference course angle; a Yolov7-tiny model is introduced, one corner of a minimum enclosing rectangle is randomly selected, real-time edge detection is carried out, and an actual farmland edge is found; calculating inclination compensation in the motion process of the unmanned aerial vehicle according to the acceleration detected by an acceleration sensor of the unmanned aerial vehicle to obtain an actual course angle; the actual course angle is made to be consistent with the reference course angle, the reference course angle is adjusted at the actual farmland edge to rotate by 90 degrees towards the inner side of the farmland, and back-and-forth farmland path planning is achieved; according to the method, the problem of path planning during irregular operation of the plant protection unmanned aerial vehicle is solved, boundary omission and path redundancy are reduced, the accuracy of irregular farmland path planning is improved, and the agricultural operation efficiency is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of smart agricultural path optimization, and in particular to an irregular farmland path planning method for a plant protection UAV based on a convex hull algorithm. Background Art

[0002] Smart agriculture is an important direction for the deep integration of modern science and technology development and traditional agriculture. Drone technology has become a core tool in smart agriculture due to its high flexibility and versatility. In precision agriculture, the main applications of drones include soil testing, pest and disease monitoring, pesticide spraying, sowing, and crop growth monitoring. Among them, pesticide spraying is one of the most widely used areas. Its goal is to improve the utilization rate of pesticides and reduce environmental pollution through precise distribution of pesticides, while increasing crop yields and quality.

[0003] However, current precision spraying technology is mainly aimed at straight or simple curved operation paths in regular farmland. Irregular farmland, due to its complex boundary shape and uneven area distribution, poses great challenges to path planning and spraying accuracy. Spraying on irregular farmland mainly relies on the operator's handheld remote control. It cannot be accurately implemented in farmland that the operator cannot reach or is difficult to reach, in order to achieve intelligent spraying. In complex terrain such as mountainous areas, plateaus or farmland with complex boundaries, traditional navigation and path planning technologies are prone to insufficient coverage, spraying omissions or waste of pesticides due to insufficient accuracy or poor algorithm adaptability.

[0004] To date, there have been a lot of studies on drone spraying path planning. For example, the use of genetic algorithms to realize the trajectory planning of several discontinuous farmlands, and its efficiency has been verified through experiments (Zhao Yue., 2023). However, this type of algorithm has high requirements on the quality of initial boundary data and is not adaptable enough to dynamic changes in terrain. There is also a route planning method for plant protection drones based on particle swarm algorithms (Wu Jinlong., 2018), which solves the obstacle avoidance problem, but the path planning relies on regular terrain and cannot meet the needs of irregular farmlands. Based on the analysis of the above technologies and research status, it can be seen that there are still some problems that have not been effectively solved in the path planning of plant protection drones in irregular farmlands, including the following problems as a whole:

[0005] Poor coupling between boundary recognition and path planning: Existing technologies fail to effectively integrate boundary recognition algorithms and dynamic path planning algorithms, which can easily lead to boundary omissions or path redundancy in irregular farmland operations.

[0006] Poor adaptability to complex terrain: Existing UAV path planning algorithms are mostly based on regular terrain, and the operating accuracy is significantly reduced in complex terrain or magnetic interference environments. Summary of the invention

[0007] The present invention provides an irregular farmland path planning method for a plant protection UAV based on a convex hull algorithm, so as to overcome the technical problems that the existing track planning method cannot adapt to complex terrain and is prone to boundary omission and path redundancy during path planning.

[0008] In order to achieve the above object, the technical solution of the present invention is:

[0009] A method for irregular farmland path planning of a plant protection UAV based on a convex hull algorithm, comprising:

[0010] S1: Obtain a coordinate data set of farmland boundary points, and use a density clustering algorithm to denoise the coordinate data set to obtain a denoised data set;

[0011] S2: Introduce a convex hull algorithm, use the convex hull algorithm to traverse all coordinates in the denoised data set, find multiple convex hull points, connect all convex hull points, generate a minimum circumscribed rectangle, and randomly select one side of the minimum circumscribed rectangle to set a reference heading angle;

[0012] S3: Introduce the Yolov7-tiny model and randomly select a corner of the minimum circumscribed rectangle, use the Yolov7-tiny model to perform real-time edge detection with the corner of the minimum circumscribed rectangle as the starting point, and find the actual edge of the farmland;

[0013] S4: Calculate the tilt compensation of the UAV during its motion according to the acceleration in the horizontal and vertical directions detected by the UAV's acceleration sensor to obtain the actual heading angle;

[0014] S5: Adjust the flight angle of the drone so that the actual heading angle is consistent with the reference heading angle, and at the same time adjust the reference heading angle at the actual edge of the farmland to rotate 90 degrees inside the farmland to achieve round-trip farmland path planning.

[0015] Furthermore, a convex hull algorithm is introduced to traverse all coordinates in the denoised data set, find multiple convex hull points, connect all convex hull points, and generate a minimum circumscribed rectangle, including:

[0016] S21, randomly dividing the denoised data set into n groups, each group containing m farmland boundary points;

[0017] S22, selecting the farmland boundary point O with the smallest x-coordinate and y-coordinate in the denoised data set as a reference point, and calculating the polar angles between all other farmland boundary points and the point; the x-coordinate and y-coordinate are coordinates in a coordinate system based on longitude and latitude;

[0018] S23, in each group, the farmland boundary points included in the group are sorted in order from small to large polar angles. If the polar angles of two farmland boundary points are the same, the farmland boundary points are sorted in order from near to far according to the distances from the farmland boundary points to the reference point to form a point set;

[0019] S24, randomly select a farmland boundary point A in a group as a preset convex hull point, construct a vector OA, randomly select a detection point i in the group, construct a vector Oi, calculate the cross product of the vector OA and Oi, and determine the positive or negative of the cross product:

[0020] If the result is positive, point i is a non-convex hull point, and point A is still the current convex hull point. Point A and the reference point form a vector and participate in the vector cross product calculation of the next farmland boundary point.

[0021] If the result is negative, point A is not a convex hull point. Point i is set as a new convex hull point. This point forms a vector with the reference point and participates in the vector cross product calculation of the next farmland boundary point. This continues until all farmland boundary points in the group are traversed and the final convex hull point is used as the convex hull point of the group.

[0022] S25, traverse the sorted point sets of the remaining groups in turn to obtain all convex hull points including the reference point, connect two adjacent convex hull points in turn to generate a minimum circumscribed rectangle to enclose the remaining non-convex hull points of the farmland boundary points.

[0023] Furthermore, the convex hull algorithm is a Graham scanning method.

[0024] Furthermore, the tilt compensation of the UAV during its motion is calculated according to the acceleration in the horizontal and vertical directions detected by the UAV's acceleration sensor to obtain the actual heading angle, including:

[0025] Decompose the geomagnetic field into components in the x-direction and y-direction parallel to the horizontal plane and a component in the z-direction perpendicular to the horizontal plane;

[0026] The component in the x direction is shown in formula (1):

[0027]

[0028] Among them, H x represents the component in the x direction, X M represents the component of the magnetic compass in the x direction, Z M represents the component of the magnetic compass in the z direction, represents the pitch angle based on the acceleration sensor, as shown in formula (2),

[0029]

[0030] Among them, A x ,Ay ,A z are the accelerations in the x, y, and z directions respectively;

[0031] The component in the y direction is shown in formula (3):

[0032]

[0033] Among them, H y represents the component in the y direction, and θ represents the tilt angle based on the acceleration sensor, as shown in formula (4),

[0034]

[0035] The actual heading angle is calculated based on the x-direction component and the y-direction component, as shown in formula (5):

[0036]

[0037] Where β represents the actual heading angle.

[0038] Further, the flight angle of the drone is adjusted so that the actual heading angle is consistent with the reference heading angle, and at the same time, the reference heading angle is adjusted to rotate 90 degrees inside the farmland at the actual edge of the farmland to achieve round-trip farmland path planning, including:

[0039] S51, set the two perpendicular sides of the minimum bounding rectangle to be Y1=K1*X1+b and Y2=K2*X2+b, where K1 represents the slope of one side of the rectangle, K2 represents the slope of another vertical side; X1, Y1 represent the horizontal and vertical coordinates of the side, b is a constant, X2, Y2 represent the horizontal and vertical coordinates of another vertical side;

[0040] S52, set the flight direction corresponding to the reference heading angle to be parallel to one side of the rectangle, that is, parallel to the slope direction corresponding to Y1=K1*X1+b; calculate the actual heading angle according to the current actual coordinate value of the UAV and formula (5); if the current reference heading angle α is different from the actual heading angle β, adjust the flight direction of the UAV and return to the direction corresponding to the reference heading angle; if the two values ​​are equal, the UAV keeps flying in the direction corresponding to the current actual heading angle;

[0041] S53. When the UAV reaches the edge of the farmland, the reference heading angle is rotated 90 degrees toward the inside of the farmland. At this time, the flight direction is parallel to the vertical side, that is, parallel to the slope direction corresponding to Y2=K2*X2+b. When the UAV reaches the preset flight time, the current reference heading angle is rotated 90 degrees toward the inside of the farmland, and is parallel to the slope direction corresponding to Y1=K1*X1+b, and flies in the opposite direction.

[0042] Furthermore, the coordinate data set is denoised using a density clustering algorithm to obtain a denoised data set, including:

[0043] S11, randomly selecting a boundary point in the coordinate data set, and taking the point as the center of a circle to form a neighborhood radius;

[0044] S12, determine the number of boundary points in the neighborhood of the point. If the number is less than the set density threshold, the point is a noise point; if the number is greater than or equal to the set density threshold, the point is marked as a core point and expanded to form a cluster. When all boundary points in the neighborhood of the current point are traversed, stop expanding the cluster;

[0045] S13. After all boundary points are marked, the points that do not belong to any cluster are noise points.

[0046] Beneficial effect: The present invention provides a method for irregular farmland path planning of a plant protection UAV based on a convex hull algorithm. By applying the convex hull algorithm to the operation path planning of the plant protection UAV and combining it with the edge recognition algorithm to identify the boundaries of the farmland, the problem of path planning of the plant protection UAV during irregular operations is solved, boundary omissions and path redundancy are reduced, and the accuracy of path planning for irregular farmland is improved; by calculating the actual heading angle of the UAV, the angle of the UAV can be quickly adjusted to prevent deviation, thereby realizing comprehensive path planning of the farmland. The present invention is suitable for farmlands in complex terrain (such as mountainous areas and plateaus), and greatly improves the efficiency of agricultural operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0048] Figure 1 A method flow chart of a method for irregular farmland path planning of a plant protection UAV based on a convex hull algorithm provided by the present invention;

[0049] FIG2 is a schematic diagram showing the effect of using a density clustering algorithm to eliminate noise points;

[0050] FIG3 is a schematic diagram showing the effect of the convex hull algorithm;

[0051] Figure 4 A schematic diagram of a preset reference heading angle of the present invention;

[0052] FIG5 is a schematic diagram of edge detection of farmland according to the present invention;

[0053] Figure 6 A schematic diagram of virtual path planning of the present invention;

[0054] Figure 7 It is a schematic diagram of the actual path planning of the present invention. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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.

[0056] This embodiment provides a method for planning irregular farmland paths for plant protection UAVs based on a convex hull algorithm. Figure 1 As shown, including:

[0057] S1: Obtain a coordinate data set of farmland boundary points, and use a density clustering algorithm to denoise the coordinate data set to obtain a denoised data set;

[0058] S2: Introduce a convex hull algorithm, use the convex hull algorithm to traverse all coordinates in the denoised data set, find multiple convex hull points, connect all convex hull points, generate a minimum circumscribed rectangle, and randomly select one side of the minimum circumscribed rectangle to set a reference heading angle;

[0059] S3: Introduce the Yolov7-tiny model and randomly select a corner of the minimum circumscribed rectangle, use the Yolov7-tiny model to perform real-time edge detection with the corner of the minimum circumscribed rectangle as the starting point, and find the actual edge of the farmland;

[0060] S4: Calculate the tilt compensation of the UAV during its motion according to the acceleration in the horizontal and vertical directions detected by the UAV's acceleration sensor to obtain the actual heading angle;

[0061] S5: Adjust the flight angle of the drone so that the actual heading angle is consistent with the reference heading angle, and at the same time adjust the reference heading angle at the actual edge of the farmland to rotate 90 degrees inside the farmland to achieve round-trip farmland path planning.

[0062] Specifically, first, obtain the coordinate data set of the farmland boundary points, and use the density clustering algorithm to denoise the coordinate data set to obtain the denoised data set, use Beidou navigation to collect real GPS coordinate data along the farmland boundary, and collect points in difficult-to-reach areas without human assistance to ensure the integrity of the boundary data, provide an initial data set for the following steps, use density clustering to introduce the convex hull algorithm, use the convex hull algorithm to traverse all coordinates in the denoised data set, find multiple convex hull points, connect all convex hull points, generate a minimum circumscribed rectangle, and randomly select one side of the minimum circumscribed rectangle to set the reference heading angle. Using the convex hull algorithm, all farmland boundary points can be enclosed in the convex hull to form a circumscribed rectangle, which defines the working area of ​​the drone and ensures the integrity of the coverage range. The heading angle is set according to the formed rectangular edge to provide the drone with an initial navigation direction, and subsequent edge detection and path planning are performed based on this direction; the Yolov7-tiny model is introduced and used with The drone selects a corner of the minimum circumscribed rectangle, uses the Yolov7-tiny model to take the corner of the minimum circumscribed rectangle as the starting point, performs real-time edge detection, and finds the actual edge of the farmland. Through image processing technology, the drone can identify the boundary of the farmland and provide accurate data support for path planning. The tilt compensation of the drone during movement is calculated according to the acceleration in the horizontal and vertical directions detected by the accelerometer of the drone to obtain the actual heading angle. The actual heading angle can be quickly adjusted to prevent the planned path from being offset and unable to fully cover the farmland. Finally, the flight angle of the drone is adjusted to make the actual heading angle consistent with the reference heading angle, and at the same time, the angle of the reference heading angle is adjusted to rotate 90 degrees to the inside of the farmland at the actual edge of the farmland to achieve round-trip farmland path planning. The drone flies along the edge of the planned rectangle to ensure that every corner of the farmland can be accurately covered without omission.

[0063] In a specific embodiment, a coordinate data set of farmland boundary points is obtained, and a density clustering algorithm is used to denoise the coordinate data set to obtain a denoised data set:

[0064] S11. Obtain the coordinate data set of the farmland boundary points:

[0065] Collection equipment: Use drones equipped with Beidou navigation modules or handheld devices to collect GPS coordinate data along the boundaries of farmlands and store them as a set of longitude and latitude coordinate points with longitude and latitude as the coordinate system;

[0066] Collection method: The operator walks along the boundary of the farmland, and the drone assists in collecting points in difficult-to-reach areas to ensure the integrity of the boundary data;

[0067] Output result: a coordinate set {P1,P2,...,P n}, the data format is (x,y);

[0068] S12. De-noising the coordinate data set using a density clustering algorithm to obtain a de-noised data set:

[0069] S121: randomly selecting a boundary point in the coordinate data set, and taking the point as the center of a circle to form a neighborhood radius; the value of the neighborhood radius is manually set according to actual conditions and experience;

[0070] S122: Determine the number of boundary points in the neighborhood of the point. If the number is less than the set density threshold, the point is a noise point. If the number is greater than or equal to the set density threshold, the point is marked as a core point and expanded to form a cluster. When all boundary points in the neighborhood of the current point are traversed, the cluster expansion stops.

[0071] S123: After all boundary points are marked, the points that do not belong to any cluster are noise points;

[0072] The denoising using density clustering algorithm is shown in Figure 2. Figure 2a This is the coordinate point diagram before processing. In the figure, the xy axis is longitude and latitude, the points in the figure are the coordinate points of the farmland, and the red circles are typical noise points. Figure 2b This is the coordinate point diagram after processing.

[0073] In this solution, the Beidou system is used to collect the actual farmland coordinates, and the longitude and latitude are used as the x-axis and y-axis of the coordinates. The actual coordinate values ​​can be used for subsequent path planning. At the same time, the drone is equipped with a GPS navigation system to realize the intelligent autonomous operation of the drone and improve the efficiency of path planning.

[0074] The density clustering algorithm is used to denoise the data. It is suitable for irregular farmland and has good noise elimination effect, which can improve the accuracy of the data.

[0075] In a specific embodiment, a convex hull algorithm is introduced, and the convex hull algorithm is used to traverse all coordinates in the denoised data set, find multiple convex hull points, connect all convex hull points, generate a minimum circumscribed rectangle, and set the reference heading angle according to one side of the minimum circumscribed rectangle. The scheme is:

[0076] In this embodiment, the Graham scanning method is used, and the specific steps are as follows:

[0077] S21, randomly dividing the denoised data set into n groups, each group containing m farmland boundary points; in this embodiment, the number of convex hull points selected is 21, that is, the denoised data set is divided into 21 groups;

[0078] S22, selecting the farmland boundary point O with the smallest x-coordinate and y-coordinate in the denoised data set as a reference point, and calculating the polar angles between all other farmland boundary points and the point;

[0079] S23, in each group, the farmland boundary points included in the group are sorted in order from small to large polar angles. If the polar angles of two farmland boundary points are the same, the farmland boundary points are sorted in order from near to far according to the distances from the farmland boundary points to the reference point to form a point set;

[0080] S24, randomly select a farmland boundary point A in a group as a preset convex hull point, construct a vector OA, randomly select a detection point i in the group, construct a vector Oi, calculate the cross product of the vector OA and Oi, and determine the positive or negative of the cross product:

[0081] If the result is positive, point i is a non-convex hull point, and point A is still the current convex hull point. Point A and the reference point form a vector and participate in the vector cross product calculation of the next farmland boundary point.

[0082] If the result is negative, point A is not a convex hull point. Point i is set as a new convex hull point. This point forms a vector with the reference point and participates in the vector cross product calculation of the next farmland boundary point. This continues until all farmland boundary points in the group are traversed and the final convex hull point is used as the convex hull point of the group.

[0083] S25, traversing the sorted point sets of the remaining groups in turn, obtaining all convex hull points including the reference point, connecting two adjacent convex hull points in turn, generating a minimum circumscribed rectangle to enclose the farmland boundary points of the remaining non-convex hull points;

[0084] S26, selecting a corner of the rectangle as a starting point, and presetting a reference heading angle according to one of the sides;

[0085] The convex hull algorithm is shown in Figure 3. Figure 3a The 21 convex hull points are formed in the figure. By connecting the convex hull points, the remaining farmland boundary points can be enclosed in the convex hull. Figure 3b is the virtual minimum enclosing rectangle formed by the convex hull points; the preset reference heading angle is as follows Figure 4 As shown, the convex hull algorithm is used in this embodiment, which can enclose all the boundary points of the farmland in the convex hull to form a circumscribed rectangle, define the working area of ​​the UAV, and ensure the integrity of the coverage range; at the same time, the heading angle is preset according to the rectangular edge to provide the UAV with an initial flight direction, and subsequent edge detection and path planning are performed based on the flight direction.

[0086] In a specific embodiment, the Yolov7-tiny model is introduced and a corner of the minimum circumscribed rectangle is randomly selected. The Yolov7-tiny model is used to perform real-time edge detection with the corner of the minimum circumscribed rectangle as the starting point to find the actual farmland edge:

[0087] S31, grayscale and binarize the image, such as Figure 5a and Figure 5b As shown,

[0088] S32, use Gaussian filtering to reduce the level of detail, and finally Sobel operator to plan the edge, such as Figure 5c and Figure 5d shown.

[0089] In this embodiment, the Yolov7-tiny model is used in combination with the drone to perform real-time edge detection to obtain the actual edge of the farmland, providing accurate data support for the subsequent drone to identify the farmland boundary and perform path planning, that is, to change the heading angle.

[0090] In a specific embodiment, the solution for calculating the tilt compensation during the movement of the drone based on the acceleration in the horizontal and vertical directions detected by the acceleration sensor of the drone to obtain the actual heading angle is:

[0091] Decompose the geomagnetic field into components in the x-direction and y-direction parallel to the horizontal plane and a component in the z-direction perpendicular to the horizontal plane;

[0092] The component in the x direction is shown in formula (6):

[0093]

[0094] Among them, H x represents the component in the x direction, X M represents the component of the magnetic compass in the x direction, Z M represents the component of the magnetic compass in the z direction, represents the pitch angle based on the acceleration sensor, as shown in formula (7),

[0095]

[0096] Among them, A x ,A y ,A z are the accelerations in the x, y, and z directions respectively;

[0097] The component in the y direction is shown in formula (8),

[0098]

[0099] Among them, H y represents the component in the y direction, and θ represents the tilt angle based on the acceleration sensor, as shown in formula (9),

[0100]

[0101] The actual heading angle is calculated based on the x-direction component and the y-direction component, as shown in formula (10):

[0102]

[0103] Where β represents the actual heading angle.

[0104] In this solution, the magnetic north pole identified by the electronic compass is premised on the electronic compass being kept horizontal. However, it is difficult for the drone to remain horizontal during flight, and there will be an angle between it and the horizontal ground. Therefore, an acceleration sensor is required to compensate for this. The true heading angle can be calculated based on the acceleration in the three directions of xyz to ensure the accuracy of the magnetic north pole identification. At the same time, the actual heading angle can be calculated to quickly adjust the flight direction of the drone to prevent the planned path from deviating and failing to fully cover the farmland.

[0105] In a specific embodiment, the flight angle of the drone is adjusted so that the actual heading angle is consistent with the reference heading angle, and at the same time, the reference heading angle is adjusted to rotate 90 degrees inside the farmland at the actual edge of the farmland to achieve round-trip farmland path planning, including:

[0106] S51, set the two perpendicular sides of the minimum bounding rectangle to be Y1=K1*X1+b and Y2=K2*X2+b, where K1 represents the slope of one side of the rectangle, K2 represents the slope of another vertical side; X1, Y1 represent the horizontal and vertical coordinates of the side, b is a constant, X2, Y2 represent the horizontal and vertical coordinates of another vertical side;

[0107] S52, setting the flight direction corresponding to the reference heading angle to be parallel to one side of the rectangle, that is, parallel to the slope direction corresponding to Y1=K1*X1+b; calculating the actual heading angle according to the current actual coordinate value of the UAV and formula (10); if the current reference heading angle α is different from the actual heading angle β, adjusting the flight direction of the UAV to return to the direction corresponding to the reference heading angle; if the two values ​​are equal, the UAV keeps flying in the direction corresponding to the current actual heading angle;

[0108] S53. When the UAV reaches the edge of the farmland, the reference heading angle is rotated 90 degrees toward the inside of the farmland. At this time, the flight direction is parallel to the vertical edge, that is, parallel to the slope direction corresponding to Y2=K2*X2+b. When the UAV reaches the preset flight time, the current reference heading angle is rotated 90 degrees toward the inside of the farmland, and is parallel to the slope direction corresponding to Y1=K1*X1+b, and flies in the opposite direction.

[0109] In this scheme, the three-dimensional magnetic component obtained from the three-dimensional magnetometer of the electronic compass and the acceleration component obtained from the acceleration sensor are substituted into the above equations (6), (7) and (8) to calculate the actual heading angle of the drone during navigation. Taking the drone flying counterclockwise along the farmland as an example, the virtual path planning is as follows: Figure 6 As shown, the actual heading angle is calculated according to formula (10), the reference heading angle is compared with the preset heading angle, and the flight direction of the UAV is adjusted to be consistent with the flight direction corresponding to the reference heading angle;

[0110] When the drone touches the boundary of a farmland, it changes the reference heading angle and turns 90 degrees inside the farmland, 90 degrees perpendicular to the original flight direction. After flying for a preset time, it updates the reference heading angle and turns 90 degrees inside the farmland, flying in the opposite direction of the original flight direction, forming a "round-trip" path planning. The actual path planning is as follows: Figure 7 shown.

[0111] The drone flies along the edge of the planned rectangle, forming a round-trip farmland path planning, ensuring that every corner of the farmland can be accurately covered without omissions, solving the problem of path planning for plant protection drones during irregular operations.

[0112] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for irregular farmland path planning of plant protection UAV based on convex hull algorithm, characterized in that: include: S1: Obtain a coordinate data set of farmland boundary points, and use a density clustering algorithm to denoise the coordinate data set to obtain a denoised data set; S2: Introduce a convex hull algorithm, use the convex hull algorithm to traverse all coordinates in the denoised data set, find multiple convex hull points, connect all convex hull points, generate a minimum circumscribed rectangle, and randomly select one side of the minimum circumscribed rectangle to set a reference heading angle; S3: Introduce the Yolov7-tiny model and randomly select a corner of the minimum circumscribed rectangle, use the Yolov7-tiny model to perform real-time edge detection with the corner of the minimum circumscribed rectangle as the starting point, and find the actual edge of the farmland; S4: Calculate the tilt compensation of the UAV during its motion according to the acceleration in the horizontal and vertical directions detected by the UAV's acceleration sensor to obtain the actual heading angle; S5: Adjust the flight angle of the drone so that the actual heading angle is consistent with the reference heading angle, and at the same time adjust the reference heading angle at the actual edge of the farmland to rotate 90 degrees inside the farmland to achieve round-trip farmland path planning.

2. According to the method of irregular farmland path planning for plant protection UAV based on convex hull algorithm in claim 1, it is characterized in that: The convex hull algorithm is introduced to traverse all coordinates in the denoised data set, find multiple convex hull points, connect all convex hull points, and generate the minimum circumscribed rectangle, including: S21, randomly dividing the denoised data set into n groups, each group containing m farmland boundary points; S22, selecting the farmland boundary point O with the smallest x-coordinate and y-coordinate in the denoised data set as a reference point, and calculating the polar angles between all other farmland boundary points and the point; the x-coordinate and y-coordinate are coordinates in a coordinate system based on longitude and latitude; S23, in each group, the farmland boundary points included in the group are sorted in order from small to large polar angles. If the polar angles of two farmland boundary points are the same, the farmland boundary points are sorted in order from near to far according to the distances from the farmland boundary points to the reference point to form a point set; S24, randomly select a farmland boundary point A in a group as a preset convex hull point, construct a vector OA, randomly select a detection point i in the group, construct a vector Oi, calculate the cross product of the vector OA and Oi, and determine the positive or negative of the cross product: If the result is positive, point i is a non-convex hull point, and point A is still the current convex hull point. Point A and the reference point form a vector and participate in the vector cross product calculation of the next farmland boundary point. If the result is negative, point A is not a convex hull point. Point i is set as a new convex hull point. This point forms a vector with the reference point and participates in the vector cross product calculation of the next farmland boundary point. This continues until all farmland boundary points in the group are traversed and the final convex hull point is used as the convex hull point of the group. S25, traverse the sorted point sets of the remaining groups in turn to obtain all convex hull points including the reference point, connect two adjacent convex hull points in turn to generate a minimum circumscribed rectangle to enclose the remaining non-convex hull points of the farmland boundary points.

3. According to claim 2, a method for irregular farmland path planning of a plant protection UAV based on a convex hull algorithm is characterized in that: The convex hull algorithm is the Graham scanning method.

4. According to the method of irregular farmland path planning for plant protection UAV based on convex hull algorithm in claim 1, it is characterized in that: The tilt compensation during the movement of the drone is calculated based on the acceleration in the horizontal and vertical directions detected by the drone's acceleration sensor to obtain the actual heading angle, including: Decompose the geomagnetic field into components in the x-direction and y-direction parallel to the horizontal plane and a component in the z-direction perpendicular to the horizontal plane; The component in the x direction is shown in formula (1): Among them, H x represents the component in the x direction, X M represents the component of the magnetic compass in the x direction, Z M represents the component of the magnetic compass in the z direction, represents the pitch angle based on the acceleration sensor, as shown in formula (2), Among them, A x ,A y ,A z are the accelerations in the x, y, and z directions respectively; The component in the y direction is shown in formula (3): Among them, H y represents the component in the y direction, and θ represents the tilt angle based on the acceleration sensor, as shown in formula (4), The actual heading angle is calculated based on the x-direction component and the y-direction component, as shown in formula (5): Where β represents the actual heading angle.

5. According to the method of irregular farmland path planning for plant protection UAV based on convex hull algorithm in claim 4, it is characterized in that: The flight angle of the drone is adjusted so that the actual heading angle is consistent with the reference heading angle, and at the same time, the reference heading angle is adjusted to rotate 90 degrees inside the farmland at the actual edge of the farmland to achieve round-trip farmland path planning, including: S51, set the two perpendicular sides of the minimum bounding rectangle to be Y1=K1*X1+b and Y2=K2*X2+b, where K1 represents the slope of one side of the rectangle, K2 represents the slope of another vertical side; X1, Y1 represent the horizontal and vertical coordinates of the side, b is a constant, X2, Y2 represent the horizontal and vertical coordinates of another vertical side; S52, set the flight direction corresponding to the reference heading angle to be parallel to one side of the rectangle, that is, parallel to the slope direction corresponding to Y1=K1*X1+b; calculate the actual heading angle according to the current actual coordinate value of the UAV and formula (5); if the current reference heading angle α is different from the actual heading angle β, adjust the flight direction of the UAV and return to the direction corresponding to the reference heading angle; if the two values ​​are equal, the UAV keeps flying in the direction corresponding to the current actual heading angle; S53. When the UAV reaches the edge of the farmland, the reference heading angle is rotated 90 degrees toward the inside of the farmland. At this time, the flight direction is parallel to the vertical side, that is, parallel to the slope direction corresponding to Y2=K2*X2+b. When the UAV reaches the preset flight time, the current reference heading angle is rotated 90 degrees toward the inside of the farmland, and is parallel to the slope direction corresponding to Y1=K1*X1+b, and flies in the opposite direction.

6. The irregular farmland path planning method for plant protection UAV based on convex hull algorithm according to claim 1 is characterized in that: The coordinate data set is denoised using a density clustering algorithm to obtain a denoised data set, including: S11, randomly selecting a boundary point in the coordinate data set, and taking the point as the center of a circle to form a neighborhood radius; S12, determine the number of boundary points in the neighborhood of the point. If the number is less than the set density threshold, the point is a noise point; if the number is greater than or equal to the set density threshold, the point is marked as a core point and expanded to form a cluster. When all boundary points in the neighborhood of the current point are traversed, stop expanding the cluster; S13. After all boundary points are marked, the points that do not belong to any cluster are noise points.

Citation Information

Patent Citations

  • Pesticide application robot farmland path planning method capable of combining visual sensor with laser sensor

    CN109885063A

  • Unmanned aerial vehicle track and resource allocation joint optimization method for multi-carrier communication

    CN110730031A

  • Path planning method and device for harrowing operation

    CN113804212A

  • Plant protection unmanned aerial vehicle route planning method based on full coverage path

    CN113934225A

  • Multi-obstacle avoidance path generation method and device, electronic equipment and medium

    CN117170385A