Embedded online unmanned mower dynamic path planning method
By embedding ultrasonic radar and A* algorithm on the unmanned lawn mower, dynamic path planning is realized, which solves the problem of inefficiency in the face of random obstacles by unmanned lawn mowers, improves the calculation rate and work efficiency, and avoids dead zones phenomenon and simplify user operations.
Patent Information
- Application Number
- CN202411173466.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-11-12
AI Technical Summary
Existing unmanned lawn mowers are inefficient when facing random obstacles, easily fall into dead zones, and lack planning strategies for short-term obstacles, and require a large amount of pre-test obstacle information and high computing equipment support. Users can replace and cut Information needs to be re-entered when laying out the grass area, which increases the after-sales work intensity.
Using embedded online dynamic path planning method, the unmanned lawn mower independently plans and records of random obstacles by installing ultrasonic radars Am, Al, and Ar, combined with distance proportion constraints and A* algorithm, avoiding traditional The cumbersome calculation of raster maps improves the calculation rate.
Unmanned lawn mowers can quickly plan feasible paths, record unknown obstacle boundary information, and are not limited by obstacle size and shape, greatly improve work efficiency, avoid dead zones, and reduce user after-sales work intensity.
Smart Images

Figure CN118938933A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of path navigation, and in particular relates to a dynamic path planning method for an online unmanned lawn mower implemented on an embedded system. Background Art
[0002] The unmanned lawn mowers currently on the market are basically composed of positioning modules, perception modules, path planning modules and other modules working together. Path planning is a major difficulty in the work of lawn mowers, and it is necessary to consider factors such as the number of turns, coverage, repetition rate, etc. At present, most unmanned lawn mowers use vision and various sensors to perceive the location of obstacles, and then plan the path in advance on a computer or a high-computing processor, and then send the results to the unmanned lawn mower. This method is suitable for a priori obstacles. In addition, most machines do not consider the situation of randomly appearing obstacles, or use random obstacle avoidance after collision to treat dynamic obstacles. This working method is inefficient and can easily cause the machine to fall into an area and collide back and forth and be unable to leave, commonly known as a "dead zone", which greatly affects the subsequent work of the lawn mower.
[0003] Most of the above lawn mower working methods require a large amount of prior obstacle and boundary information, and also require the support of high-computing equipment. Once the user changes the layout of the mowing area, the information needs to be re-entered, which greatly increases the intensity of after-sales work. At the same time, there is no planning strategy for short-term obstacles such as pets. Summary of the invention
[0004] Purpose of the invention: In order to solve the problems existing in the above-mentioned prior art, the present invention provides an online dynamic fast path planning method for an unmanned lawn mower.
[0005] Technical solution: The present invention provides a dynamic path planning method for an online unmanned lawn mower implemented on an embedded system. An ultrasonic radar A is installed at the center of the unmanned lawn mower. m , the ultrasonic radar A is installed on the left side of the unmanned lawn mower l The ultrasonic radar A is installed on the right side of the unmanned lawn mower r ;
[0006] The method specifically comprises the following steps:
[0007] Step 1: At the current time t, if the ultrasonic radar A m If an obstacle is detected, go to step 2, otherwise continue to move in the original planned direction;
[0008] Step 2: Determine whether the obstacle is stored in the Flash space; if so, read the coordinate range of the corresponding obstacle in the Flash space and go to step 4, otherwise go to step 3;
[0009] Step 3: Control the initial rotation direction of the unmanned lawn mower according to the position of the unmanned lawn mower, and start the ultrasonic radar A according to the initial rotation direction l or A r , and set the distance constraint condition; based on the distance constraint condition, the unmanned lawn mower is controlled to autonomously plan a circle around the obstacle in the initial rotation direction; thereby obtaining the coordinate range of the obstacle, that is, the obstacle boundary, and storing the coordinate range in the Flash space; the distance constraint condition is: the ultrasonic radar A l or A r The difference between the detected distance and the width a of the unmanned lawn mower and the ultrasonic radar A m The difference between the detected distance and the length b of the unmanned lawn mower affects the route around the obstacle in real time according to different proportions;
[0010] Step 4: Calculate the path of the unmanned lawn mower at the next moment based on the obstacle boundary.
[0011] Furthermore, in step 1, the ultrasonic radar A m If the sensing distance d meets the following conditions, it is determined that there is an obstacle ahead:
[0012] 0.8×a≤d≤1.2×a.
[0013] Furthermore, in step 2, according to the ultrasonic radar A m The distance to the obstacle and the position of the unmanned lawn mower are used to estimate the coordinates of the obstacle. If the coordinates of the obstacle are within the coordinate range of a certain obstacle stored in the Flash space, it is determined that the obstacle is stored in the Flash space.
[0014] Furthermore, in step 3, when the ultrasonic radar A m When an obstacle is detected, if the unmanned lawn mower is at the right edge of the mowing area, the unmanned lawn mower is controlled to rotate left and the ultrasonic radar A is activated. r ; Otherwise, the unmanned lawn mower is controlled to rotate right and the ultrasonic radar A is activated l .
[0015] Furthermore, in the step 3, if the ultrasonic radar activated during the autonomous planning of the unmanned lawn mower is A l , the rotation angle of the vehicle head is controlled according to the following formula:
[0016] θ k+1 =θ k +K l ·D lk +K q ·D mk
[0017] If the activated ultrasonic radar is A r, the rotation angle of the vehicle head is controlled according to the following formula:
[0018] θ k+1 =θ k -K r ·D rk -K q ·D mk
[0019] Among them, θ k+1 represents the rotation angle of the unmanned lawn mower head at the k+1th moment in the autonomous planning process, K q For ultrasonic radar A m The associated proportionality factor, K l For ultrasonic radar A l The associated proportional control coefficient, K r For ultrasonic radar A r The relevant proportional control coefficient, and K l >K q , K r >K q , D lk , D rk and D mk The expression is as follows:
[0020] D lk =d lk -R
[0021] D mk =d mk -L
[0022] D rk =d rk -R
[0023] Where L = b, R = a; d lk Indicates the ultrasonic radar A at the kth moment l Distance to obstacle, d rk Indicates the ultrasonic radar A at the kth moment r Distance to obstacles; d mk Indicates the ultrasonic radar A at the kth moment m Distance to obstacles.
[0024] Furthermore, the coordinate range of the obstacle is calculated according to the following formula:
[0025]
[0026] in, represents the coordinates of the obstacle at the kth moment, (x k ,y k ) represents the coordinates of the unmanned lawn mower at the kth moment, β kThe y-axis of the coordinate system at the kth moment and the ultrasonic radar A r Or ultrasonic radar A l The angle between k =θ k -α, θ k represents the rotation angle of the unmanned lawn mower head at the kth moment in the autonomous planning process, ρ k The expression of is: k = l k +d k , l k Indicates the ultrasonic radar A at the kth moment l Or ultrasonic radar A r The distance from the center of mass of the unmanned lawn mower, d k is the ultrasonic radar A at the kth moment l Or ultrasonic radar A r The distance to the obstacle, α refers to the ultrasonic radar A l Or ultrasonic radar A r With ultrasonic radar A m The angle between.
[0027] Furthermore, an A*-like algorithm is used to calculate the path of the unmanned lawn mower at the next moment.
[0028] Furthermore, the objective function of the A*-like algorithm is:
[0029] minf(t)
[0030] f(t+1)=g(t+1)+h(t+1)
[0031] Among them, f(t+1) represents the cost function of the unmanned lawn mower moving left, forward and right at the next moment, g(t+1) represents the distance cost between the unmanned lawn mower at the next moment and the current moment, and h(t+1) represents the distance cost between the unmanned lawn mower at the next moment and the end point;
[0032] If the cost function f(t+1) of the unmanned lawn mower moving left, forward, and right at the next moment is ∞, the unmanned lawn mower will move backward.
[0033] An electronic device / system for an online dynamic fast path planning method for an unmanned lawn mower comprises a processor and a memory, wherein the memory stores execution instructions of the processor, and the processor is configured to execute the execution instructions to implement the online dynamic fast path planning method for the unmanned lawn mower.
[0034] A computer-readable storage medium is used to store a program, and the program is executed to implement the online dynamic fast path planning method for the unmanned lawn mower.
[0035] Beneficial effects: The present invention realizes online dynamic fast path planning of unmanned lawn mower based on embedded system. It adds distance ratio constraint condition on the basis of obstacle detection by multi-ultrasonic radar, so that unmanned lawn mower can autonomously plan and record boundary information of unknown obstacles, regardless of obstacle size and shape; at the same time, based on the embedded online processing characteristics, the traditional A* algorithm is modified, and the map is no longer rasterized, but the distance cost is calculated according to the specific step length of the lawn mower per second, which solves the problem of cumbersome access to raster map blocks and large amount of calculation in programming, and greatly improves the calculation rate. Through this invention, the unmanned lawn mower can record and avoid random obstacles during work, and quickly plan a feasible path. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a flow chart of the method of the present invention;
[0037] Figure 2 It is a schematic diagram of the main planning process of the unmanned lawn mower of the present invention. DETAILED DESCRIPTION
[0038] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0039] like Figure 1 As shown, the present invention provides an embedded online unmanned lawn mower dynamic path planning method, which is specifically:
[0040] In this embodiment, three ultrasonic radars are installed in front of the unmanned lawn mower, on the left and right front. Generally, only one ultrasonic radar in the front senses obstacles. When an obstacle is sensed, it rotates right by default to wake up the left front radar; if it is close to the right edge of the mowing range, it rotates left to wake up the right front radar.
[0041] Step 1: Use the positioning module to read the current position of the unmanned lawn mower (X c ,Y c ) and set it as the starting point and record the end point position coordinates (X e ,Y e ), calculate the moving direction according to the following formula
[0042]
[0043] The direction of the unmanned lawn mower is adjusted by the gyroscope and moves towards the destination.
[0044] Step 2: When the ultrasonic radar in front senses an obstacle, the subsequent steps are as follows:
[0045] (1) When the ultrasonic radar sensing distance d in front satisfies the following formula, it is determined that there is an unknown obstacle;
[0046] 0.8×a≤d≤1.2×a (2)
[0047] Among them, a is the width of the unmanned lawn mower.
[0048] (2) Determine whether the obstacle is an obstacle stored in the storage space. If yes, read the coordinate point set of the obstacle, skip step 3 and proceed directly to step 4; otherwise, go to step 3. m The distance to the obstacle and the position of the unmanned lawn mower are used to estimate the coordinates of the obstacle. If the coordinates of the obstacle are within the coordinate range of a certain obstacle stored in the Flash space, it is determined that the obstacle is stored in the Flash space.
[0049] Step 3: Based on the distance constraint, go around the unknown obstacle to estimate the obstacle volume and coordinate range. The specific implementation steps are as follows:
[0050] 1. If Figure 2 As shown in the figure, the speed is constant during the walking process, and the distance constraint is set: the distance from the obstacle surface is 1 car width as the constraint to autonomously track around the obstacle. At the same time, a car length constraint is provided in the middle of the front radar to prevent the lawn mower from getting stuck in the concave surface of the irregular obstacle and unable to exit. The edge position of the obstacle is calculated by the position of the unmanned lawn mower itself every second and recorded in the Flash.
[0051] 2. Set R = a, L = b according to the requirements, where b is the length of the vehicle, k represents the current time, and K p is the proportional control coefficient of the left front ultrasonic radar (or right front ultrasonic radar), K q It is the proportional control coefficient of the front radar. It is selected between 0 and 1 according to the actual situation, but it needs to satisfy K p >K q :
[0052] D lk =d lk -R (3)
[0053]
[0054] θ k+1 =θ k +K l ·D lk +K q ·D mk (5)
[0055] θ k+1 =θ k-K r ·D rk -K q ·D mk (6)
[0056] Among them, θ k+1 represents the rotation angle of the unmanned lawn mower head at the k+1th moment in the autonomous planning process, K q is the proportional coefficient related to the ultrasonic radar in front, K l is the proportional control coefficient related to the left front ultrasonic radar, K r is the proportional control coefficient related to the right front ultrasonic radar, and K l >K q , K r >K q , d lk represents the distance between the left front ultrasonic radar and the obstacle at the kth moment, d rk Indicates the distance between the right front ultrasonic radar and the obstacle at the kth moment; Indicates the distance between the ultrasonic radar and the obstacle at the kth moment.
[0057] 3. The coordinates of the obstacle surface point perceived are calculated through the position coordinates of the unmanned lawn mower. In this embodiment, the coordinates provided by the positioning module of the unmanned lawn mower are approximately considered to be the coordinates of the center of mass of the vehicle, and the angle provided by the gyroscope is the angle of the vehicle head direction. k refers to the angle from the y-axis of the principal coordinate system at the current time k to the left front or right front ultrasonic radar, α refers to the angle from the left front ultrasonic radar or the right front ultrasonic radar to the front of the lawn mower (that is, the front ultrasonic radar), l k represents the distance between the left front ultrasonic radar or the right front ultrasonic radar and the mass center of the unmanned lawn mower at the kth moment, d k is the distance between the left front ultrasonic radar or the right front ultrasonic radar and the obstacle at the kth moment. and Refers to the detected obstacle surface coordinates, where the upper right corner i represents the i-th obstacle encountered in this path planning, and x k and k Refer to the current lawnmower coordinates:
[0058] β k =θ k -α (7)
[0059] ρ k = l k +d k (8)
[0060]
[0061] Step 4: After tracking for one round, return to the obstacle and calculate the cost of moving left, forward and right in the next second based on the obstacle information stored in Flash and the A*-like algorithm. Based on the characteristics of embedded systems and to speed up the calculation, this embodiment modifies the traditional A* algorithm. All distance costs are not implemented based on grid maps, but the total distance cost is calculated based on the specific step length of the lawn mower per second. g(t+1) refers to the distance cost of the unmanned lawn mower from the starting point at time t+1, and h(t+1) is the estimated distance cost from the end point at time t+1. The sum of the position costs in the next second in the three directions of forward, left and right is estimated every second to determine the direction of movement in the next second:
[0062] f(t+1)=g(t+1)+h(t+1) (10)
[0063] The smaller f(t+1) is, the better. When the moving direction is an obstacle, set f(t+1) to ∞ at time t+1. Only when the costs of moving forward, left, and right are all ∞, consider retreating.
[0064] Step 5: After bypassing the obstacle, continue to move towards the end point. Based on the A*-like algorithm, walking in a straight line must be the optimal walking route with the lowest cost. During this process, if you encounter an obstacle, repeat steps 2 to 4 until you reach the end point.
[0065] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not further describe various possible combinations.
Claims
1. A dynamic path planning method for an online unmanned lawn mower implemented on an embedded system. It is characterized in that The ultrasonic radar A is installed at the center of the unmanned lawn mower m , the ultrasonic radar A is installed on the left side of the unmanned lawn mower l The ultrasonic radar A is installed on the right side of the unmanned lawn mower r ; The method specifically comprises the following steps: Step 1: At the current time t, if the ultrasonic radar A m If an obstacle is detected, go to step 2, otherwise continue to move in the original planned direction; Step 2: Determine whether the obstacle is stored in the Flash space; If yes, read the coordinate range of the corresponding obstacle in the Flash space and go to step 4, otherwise go to step 3; Step 3: Control the initial rotation direction of the unmanned lawn mower according to the position of the unmanned lawn mower, and start the ultrasonic radar A according to the initial rotation direction l or A r , and set distance constraints; Based on the distance constraint, the unmanned lawn mower is controlled to autonomously plan a circle around the obstacle in the initial rotation direction; thereby obtaining the coordinate range of the obstacle, that is, the obstacle boundary, and storing the coordinate range in the Flash space; the distance constraint is: the ultrasonic radar A l or A r The difference between the detected distance and the width a of the unmanned lawn mower and the ultrasonic radar A m The difference between the detected distance and the length b of the unmanned lawn mower affects the route around the obstacle in real time according to different proportions; Step 4: Calculate the path of the unmanned lawn mower at the next moment based on the obstacle boundary.
2. According to the embedded system dynamic path planning method for an online unmanned lawn mower according to claim 1, It is characterized in that In step 1, the ultrasonic radar A m If the sensing distance d meets the following conditions, it is determined that there is an obstacle ahead: 0.8×a≤d≤1.2×a.
3. According to the embedded system dynamic path planning method for an online unmanned lawn mower according to claim 1, It is characterized in that In step 2, according to the ultrasonic radar A m The distance to the obstacle and the position of the unmanned lawn mower are used to estimate the coordinates of the obstacle. If the coordinates of the obstacle are within the coordinate range of a certain obstacle stored in the Flash space, it is determined that the obstacle is stored in the Flash space.
4. According to the embedded system dynamic path planning method for an online unmanned lawn mower according to claim 1, It is characterized in that In step 3, when the ultrasonic radar A m When an obstacle is detected, if the unmanned lawn mower is at the right edge of the mowing area, the unmanned lawn mower is controlled to rotate left and the ultrasonic radar A is activated. r ; Otherwise, the unmanned lawn mower is controlled to rotate right and the ultrasonic radar A is activated l .
5. According to the embedded system dynamic path planning method for an online unmanned lawn mower according to claim 1, It is characterized in that In the step 3, if the ultrasonic radar activated during the autonomous planning of the unmanned lawn mower is A l , the rotation angle of the vehicle head is controlled according to the following formula: i k+1 =θ k +K l ·D lk +K q ·D mk If the activated ultrasonic radar is A r , the rotation angle of the vehicle head is controlled according to the following formula: i k+1 =θ k -K r ·D rk -K q ·D mk Among them, θ k+1 represents the rotation angle of the unmanned lawn mower head at the k+1th moment in the autonomous planning process, K q For ultrasonic radar A m The associated proportionality factor, K l For ultrasonic radar A l The associated proportional control coefficient, K r For ultrasonic radar A r The relevant proportional control coefficient, and K l >K q , K r >K q , D lk , D rk and D mk The expression is as follows: D lk =d lk -R Where L = b, R = a; d lk Indicates the ultrasonic radar A at the kth moment l Distance to obstacle, d rk Indicates the ultrasonic radar A at the kth moment r Distance to obstacles; d mk Indicates the ultrasonic radar A at the kth moment m Distance to obstacles.
6. According to the embedded system-implemented dynamic path planning method for an online unmanned lawn mower according to claim 1, It is characterized in that The coordinate range of the obstacle is calculated according to the following formula: in, represents the coordinates of the obstacle at the kth moment, (x k ,y k ) represents the coordinates of the unmanned lawn mower at the kth moment, β k The y-axis of the coordinate system at the kth moment and the ultrasonic radar A r Or ultrasonic radar A l The angle between k =θ k -α, θ k represents the rotation angle of the unmanned lawn mower head at the kth moment in the autonomous planning process, ρ k The expression of is: k = l k +d k , l k Indicates the ultrasonic radar A at the kth moment l Or ultrasonic radar A r The distance from the center of mass of the unmanned lawn mower, d k is the ultrasonic radar A at the kth moment l Or ultrasonic radar A r The distance to the obstacle, α refers to the ultrasonic radar A l Or ultrasonic radar A r With ultrasonic radar A m The angle between.
7. The method for dynamic path planning of an online unmanned lawn mower implemented on an embedded system according to claim 1, It is characterized in that An A*-like algorithm is used to calculate the path of the unmanned lawn mower at the next moment.
8. According to the embedded system dynamic path planning method for an online unmanned lawn mower according to claim 7, It is characterized in that The objective function of the A*-like algorithm is: minf(t) f(t+1)=g(t+1)+h(t+1) Among them, f(t+1) represents the cost function of the unmanned lawn mower moving left, forward and right at the next moment, g(t+1) represents the distance cost between the unmanned lawn mower at the next moment and the current moment, and h(t+1) represents the distance cost between the unmanned lawn mower at the next moment and the end point; If the cost function f(t+1) of the unmanned lawn mower moving left, forward, and right at the next moment is ∞, the unmanned lawn mower will move backward.
9. An electronic device / system for implementing a dynamic path planning method for an online unmanned lawn mower on an embedded system, It is characterized in that It comprises a processor and a memory, wherein the memory stores execution instructions of the processor, and the processor is configured to execute the execution instructions to implement a dynamic path planning method for an online unmanned lawn mower implemented on an embedded system as described in any one of claims 1-9.
10. A computer-readable storage medium for storing a program, It is characterized in that Execute the program to implement a dynamic path planning method for an online unmanned lawn mower implemented on an embedded system as described in any one of claims 1-9.
