Lawn mower path planning method and equipment based on illumination direction and storage medium

Through the path planning method based on light direction, the light utilization rate is used to optimize the lawn mower path, which solves the problem of inaccurate visual recognition under backlight conditions and improves the safety and accuracy of path planning.

CN120630974APending Publication Date: 2025-09-12RUICHI SMART TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510604954.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Under strong backlight conditions, the lawn mower's visual recognition technology has difficulty accurately identifying obstacles and boundaries, resulting in inaccurate path planning. Existing technologies such as generative adversarial networks (GANs) cannot fully capture the complex optical properties of backlight environments, affecting obstacle avoidance and path planning.

Method used

A path planning method based on lighting direction plans a feasible path on a grid map through a preset path search algorithm. The lighting utilization rate is determined in combination with the lighting direction and used as a constraint condition of the optimization algorithm to optimize the target path to avoid driving against the light.

Benefits of technology

The safety and accuracy of lawn mower path planning are improved, the problem of reduced visual recognition accuracy under backlight conditions is avoided, and path selection is ensured to meet lighting conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120630974A_ABST
    Figure CN120630974A_ABST
Patent Text Reader

Abstract

The invention discloses a lawn mower path planning method and device based on an illumination direction and a storage medium, and the method comprises the following steps: carrying out the path planning on a preset grid map based on a preset path search algorithm, and obtaining a feasible path; acquiring an illumination direction according to the current date, time and geographical location information; determining an illumination utilization rate according to the path direction of the feasible path and the illumination direction; and taking the illumination utilization rate as a constraint condition of a preset optimization algorithm, and obtaining a target path based on the optimization algorithm. According to the method and the device, the illumination condition is considered when the traveling path of the mower is selected, so that the situation that the accuracy of visual identification is reduced due to backlight of sunlight when the mower runs along a backlight path is avoided, and the safety and the accuracy of path planning are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, device, and storage medium for lawn mower path planning based on light direction. Background Art

[0002] When planning their paths, lawn mowers typically rely on visual recognition technology to handle dynamic obstacles and boundary detection. In strong backlight conditions, cameras are prone to overexposure, resulting in loss of image details. At the same time, glare may interfere with image processing algorithms, making it difficult to accurately identify obstacles or boundaries. To address this issue, generative adversarial networks (GANs) are typically used to generate backlight data and convert backlight images into images under normal lighting to improve the lawn mower's visual recognition capabilities in backlight environments. However, during the image conversion process, GANs may not fully capture the complex optical characteristics of real backlight environments, such as lens glare, shadows, and loss of details in highlight areas, which can affect obstacle avoidance and path planning.

[0003] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention

[0004] The main purpose of this application is to provide a lawn mower path planning method, device and storage medium based on light direction, aiming to solve the technical problem of how to avoid the backlight of sunlight reducing the accuracy of visual recognition and improve the safety and accuracy of path planning.

[0005] In order to solve the above problems, the present application provides a lawn mower path planning method based on light direction, the lawn mower path planning method based on light direction includes:

[0006] Based on the preset path search algorithm, path planning is performed on the preset grid map to obtain a feasible path;

[0007] Get the lighting direction based on the current date, time and geographic location information;

[0008] determining a light utilization rate according to the path direction of the feasible path and the light direction;

[0009] The light utilization rate is used as a constraint condition of a preset optimization algorithm, and a target path is obtained based on the optimization algorithm.

[0010] In one embodiment, the step of performing path planning on a preset grid map based on a preset path search algorithm to obtain a feasible path includes:

[0011] Based on the path search algorithm, starting from the current position of the lawn mower as a starting node, traversing the grids in the grid map to generate neighbor nodes;

[0012] Obtaining the mobility cost values ​​of the neighboring nodes and determining the target node corresponding to the minimum mobility cost value;

[0013] Perform path search according to the target node until the target location is found;

[0014] The feasible path is obtained by tracing back from the target position to the current position of the lawn mower.

[0015] In one embodiment, before the step of traversing the grids in the grid map from the current position of the lawn mower as the starting node based on the path search algorithm to generate neighbor nodes, the step further includes:

[0016] Determining the target position in a preset lawn boundary coordinate set;

[0017] Obtaining image information from a visual sensor, identifying obstacles in the image information using a pre-trained target detection algorithm, and obtaining the location of the obstacle;

[0018] The grid map is generated according to the current position of the lawn mower, the target position and the obstacle position.

[0019] In one embodiment, the step of obtaining the lighting direction according to the current date, time and geographical location information includes:

[0020] Inputting the current date, the time, and the geographical location information into a preset astronomical algorithm to obtain a solar azimuth;

[0021] The solar azimuth angle is determined as the illumination direction.

[0022] In one embodiment, the step of determining the light utilization rate according to the path direction of the feasible path and the light direction includes:

[0023] Determining the path direction according to the coordinates of adjacent path points on the feasible path;

[0024] Obtaining an angle between the path direction and the illumination direction, and a difference between the angle and a vertical direction;

[0025] The light utilization rate is determined according to the difference.

[0026] In one embodiment, the step of using the light utilization rate as a constraint condition of a preset optimization algorithm and obtaining a target path based on the optimization algorithm includes:

[0027] Constructing an objective function based on the light utilization rate, path length and path smoothness;

[0028] An optimal solution of the objective function is determined based on the optimization algorithm to obtain the target path.

[0029] In one embodiment, the step of determining the optimal solution of the objective function based on the optimization algorithm to obtain the target path includes:

[0030] Randomly change the points on the current path to get the latest path;

[0031] Obtaining a first objective function value of the current path and a second objective function value of the latest path;

[0032] If the first objective function value is less than the second objective function value, iteration is performed according to the latest path until a termination condition is reached.

[0033] In one embodiment, the lawn mower path planning method based on light direction further includes:

[0034] When it is detected that the angle between the illumination direction and the driving direction of the lawn mower is less than a preset angle threshold, and the image exposure area is greater than a preset exposure area threshold, it is determined that the lawn mower is in a backlit area;

[0035] A turning speed perpendicular to the light irradiation direction is generated, and the lawn mower is controlled to change direction at the turning speed.

[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes a lawn mower path planning device based on light direction, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the lawn mower path planning method based on light direction as described above.

[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the lawn mower path planning method based on light direction as described above are implemented.

[0038] This application provides a path planning method for a lawn mower based on illumination direction. A preset path search algorithm is used to perform path planning on a preset grid map to obtain a feasible path, providing the lawn mower with a preliminary feasible path from its starting point to its destination. The illumination utilization rate is determined based on the path direction and illumination direction, and the illumination utilization rate is used as a constraint in a preset optimization algorithm to obtain a target path based on the optimization algorithm. By considering illumination conditions when selecting the lawn mower's path, the method avoids the situation where backlighting from sunlight reduces the accuracy of visual recognition when the lawn mower travels against the sun, thereby improving the safety and accuracy of path planning. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0040] In order to more clearly illustrate the embodiments of the present application 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0041] Figure 1 A first flow chart of the lawn mower path planning method based on light direction provided in this application;

[0042] Figure 2 A second flow chart of the lawn mower path planning method based on light direction provided in this application;

[0043] Figure 3 A third flow chart of the lawn mower path planning method based on light direction provided in this application;

[0044] Figure 4 A fourth flow chart of the lawn mower path planning method based on light direction provided in this application;

[0045] Figure 5 A fifth flow chart of the lawn mower path planning method based on light direction provided in this application;

[0046] Figure 6 Schematic diagram of the structure of the hardware operating environment involved in the lawn mower path planning method based on light direction in an embodiment of the present application.

[0047] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.

[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0050] To achieve the above-mentioned purpose, the present application proposes a lawn mower path planning method based on light direction, and the lawn mower path planning method based on light direction includes: performing path planning on a preset grid map based on a preset path search algorithm to obtain a feasible path; obtaining the light direction according to the current date, time and geographic location information; determining the light utilization rate according to the path direction of the feasible path and the light direction; using the light utilization rate as a constraint condition of a preset optimization algorithm, and obtaining the target path based on the optimization algorithm.

[0051] When planning their paths, lawn mowers typically rely on visual recognition technology to handle dynamic obstacles and boundary detection. In strong backlight conditions, cameras are prone to overexposure, resulting in loss of image details. At the same time, glare may interfere with image processing algorithms, making it difficult to accurately identify obstacles or boundaries. To address this issue, generative adversarial networks (GANs) are typically used to generate backlight data and convert backlight images into images under normal lighting to improve the lawn mower's visual recognition capabilities in backlight environments. However, during the image conversion process, GANs may not fully capture the complex optical characteristics of real backlight environments, such as lens glare, shadows, and loss of details in highlight areas, which can affect obstacle avoidance and path planning.

[0052] This application provides a path planning method for a lawn mower based on illumination direction. A preset path search algorithm is used to perform path planning on a preset grid map to obtain a feasible path, providing the lawn mower with a preliminary feasible path from its starting point to its destination. The illumination utilization rate is determined based on the path direction and illumination direction, and the illumination utilization rate is used as a constraint in a preset optimization algorithm to obtain a target path based on the optimization algorithm. By considering illumination conditions when selecting the lawn mower's path, the method avoids the situation where backlighting from sunlight reduces the accuracy of visual recognition when the lawn mower travels against the sun, thereby improving the safety and accuracy of path planning.

[0053] It should be noted that the execution subject of this embodiment can be a computing service device with network communication and program execution capabilities, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device or device capable of implementing the above functions. The following uses a lawn mower path planning device based on light direction as an example to illustrate this embodiment and the following embodiments.

[0054] Based on this, the embodiment of the present application provides a lawn mower path planning method based on light direction, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the lawn mower path planning method based on light direction of the present application.

[0055] In this embodiment, the lawn mower path planning method based on light direction is applied to a lawn mower path planning device based on light direction. The method includes steps S10 to S40:

[0056] Step S10 : performing path planning on a preset grid map based on a preset path search algorithm to obtain a feasible path.

[0057] In this embodiment, the starting and ending points of the path planning are first determined in a preset grid map. Next, a preset path search algorithm, such as the A* algorithm or the Dijkstra algorithm, is selected and executed with the grid map, the starting and ending points as input. Based on the map information and the starting and ending points, the algorithm calculates the cost of each grid cell (e.g., distance, difficulty, etc.) to find the optimal or suboptimal path from the starting point to the ending point. Once the algorithm finds the ending point, it backtracks to obtain a feasible path from the starting point to the ending point. Finally, the resulting path is optimized by removing redundant points and smoothing the path.

[0058] Optionally, redundant points are removed using the Douglas-Peucker algorithm. Set a distance threshold to determine the degree of path simplification. Connect the starting point and the end point of the path to form a line segment. Calculate the perpendicular distance from all points on the path to this line segment and find the point P with the largest distance. max If P max If the distance is greater than the distance threshold, then retain P max , divide the path into two segments and process them recursively. max If the distance is less than or equal to the distance threshold, delete P max All points between . Merge the recursively processed path segments to obtain the simplified path.

[0059] Optionally, path smoothing is performed using spline interpolation or Bezier curves. When using spline interpolation for path smoothing, simplified path points are used as interpolation nodes. The coefficients of the spline function are calculated based on the node coordinates, and smooth curve segments are generated between the nodes to form a complete path.

[0060] Step S20: Obtain the lighting direction according to the current date, time and geographical location information.

[0061] In this embodiment, based on the current date, time, and geographic location information, an astronomical algorithm is used or a related astronomical data interface (such as the astropy library) is called to calculate the sunlight direction at the current location. The resulting light direction vector (x, y, z) represents the direction of sunlight in three-dimensional space.

[0062] In one possible implementation, please refer to Figure 2 Step S20, obtaining the illumination direction according to the current date, time and geographic location information, may include steps S21 to S22:

[0063] Step S21: input the current date, the time and the geographical location information into a preset astronomical algorithm to obtain the solar azimuth.

[0064] It should be noted that the altitude is the angle of the sun above the horizon, indicating the sun's vertical position in the sky. The azimuth is the angle of the sun relative to true north, measured in a clockwise direction, indicating the sun's direction on the horizontal plane.

[0065] In this implementation, the astropy library is used to calculate the solar altitude and azimuth. The date and time are used to calculate the position of the sun in a day, and the geographical location includes latitude, longitude, and altitude, which are used to determine the location of the observation point. Create an astronomical time object. Convert the local time with time zone information to Coordinated Universal Time (UTC). Use the astropy.coordinates.get_sun function to calculate the position of the sun in the celestial coordinate system based on astropy_time. The returned solar position contains Right Ascension (RA) and Declination (Dec), which represent the coordinates of the sun on the celestial sphere. Create a horizontal coordinate system (AltAz) frame and specify the observation time and location. Use the transform_to method to convert the position of the sun in the celestial coordinate system to the horizontal coordinate system. The converted position contains altitude and azimuth.

[0066] Step S22: confirming the solar azimuth angle as the illumination direction.

[0067] In this embodiment, the direction of the solar azimuth is used as the illumination direction. Optionally, the illumination direction is also determined based on the altitude and azimuth. Using the altitude and azimuth, a polar coordinate system is established with the observer as the center. The altitude and azimuth are converted into Cartesian coordinates (x, y, z), where: x = sin (azimuth) * cos (altitude), y = cos (azimuth) * cos (altitude), and z = sin (altitude).

[0068] Step S30: determining the illumination utilization rate according to the path direction of the feasible path and the illumination direction.

[0069] In this embodiment, a feasible path is a set of possible paths from a starting point to an end point, each path consisting of a series of points or line segments. The illumination direction is represented by a vector, which determines which path segments are considered backlit (i.e., the path direction is opposite to the illumination direction).

[0070] Optionally, the illumination utilization rate is determined by the angle between the path direction and the illumination direction. The path direction and the illumination direction are compared and the angle between them is calculated. The smaller the angle, the higher the illumination utilization rate.

[0071] Optionally, the lighting utilization rate is determined by the dot product of the path direction and the lighting direction. When the dot product is positive, it means that the path direction is in the same direction as the lighting direction, and the lighting effectively covers the path.

[0072] In a feasible implementation, step S30, determining the light utilization rate according to the path direction of the feasible path and the light direction, may include steps S31 to S32:

[0073] Step S31: determining the path direction according to the coordinates of adjacent path points on the feasible path.

[0074] In this embodiment, adjacent path points are extracted in sequence from the planned feasible paths. Assume that the path points are represented as two-dimensional coordinates, and the coordinates of the i-th path point are (x i ,y i ), the coordinates of the i+1th path point are (x i+1 ,y i+1 ). For two adjacent path points, calculate the vector they form, the x component of the vector is v x= x i+1 -x +1 , the y component is v y= y i+1 -y +1 Alternatively, the inverse tangent function can be used to calculate the angle between the vector and the positive x-axis to determine the path direction. Alternatively, the dot product formula can be used to calculate the angle: cos(θ) = (v1*v2) / (|v1|*|v2|), where v1 represents the light direction vector and v2 is the direction vector of the path segment.

[0075] Step S32: Acquire the angle between the path direction and the illumination direction, and the difference between the angle and the vertical direction.

[0076] In this embodiment, the illumination direction angle information can be detected and output in real time by the illumination sensor, or the illumination direction can be obtained based on a pre-set illumination direction map. The angle between the path direction and the illumination direction is calculated. If the absolute value of the difference between the angle and the vertical direction is zero, then the feasible path is perpendicular to the sunrise and sunset directions.

[0077] Step S33: determining the light utilization rate according to the difference.

[0078] In this embodiment, the light utilization rate is related to the difference between the included angle and the vertical direction. The smaller the difference, the higher the light utilization rate. Optionally, a linear or nonlinear model can be established to describe this relationship. For example, using a linear model, the light utilization rate U = 1-Δθ / 90, where θ is the angle between the path direction and the light direction, and the difference from the vertical direction. When the difference is 0°, the light utilization rate is 100%; when the difference is 90°, the light utilization rate is 0%.

[0079] Step S40: Using the light utilization rate as a constraint condition of a preset optimization algorithm, and obtaining a target path based on the optimization algorithm.

[0080] In this embodiment, the calculated light utilization rate and the length of the feasible path are used as input parameters. A preset optimization algorithm, such as a genetic algorithm or a simulated annealing algorithm, is selected. Using light utilization rate as a constraint, the selected optimization algorithm is run to try different path combinations. When the algorithm reaches a termination condition (e.g., the number of iterations reaches an upper limit, the fitness value converges, etc.), the currently found optimal path is output as the target path, thereby obtaining a target path that maximizes light utilization rate.

[0081] Optionally, a minimum threshold of light utilization is preset, and the path found by the optimization algorithm is required to meet this threshold.

[0082] Optionally, the light utilization rate is directly incorporated into the optimization objective function, so that factors such as path length and light utilization rate are considered simultaneously when searching for the optimal path.

[0083] In this embodiment, a preset path search algorithm is used to perform path planning on a preset grid map to obtain a feasible path, providing the lawn mower with a preliminary feasible path from its starting point to its destination. Light utilization is determined based on the path direction and illumination direction, and this utilization is used as a constraint in a preset optimization algorithm to determine the target path. Lighting conditions are also considered when selecting the lawn mower's path, preventing backlight from reducing visual recognition accuracy when the lawn mower travels against sunlight, thereby improving the safety and accuracy of path planning.

[0084] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 3 In step S10, path planning is performed on a preset grid map based on a preset path search algorithm. Before obtaining a feasible path, steps S01 to S03 may also be included:

[0085] Step S01: determining the target position in a preset lawn boundary coordinate set.

[0086] In this embodiment, real-time kinematic (RTK) data is received from the lawn mower in real time. The data format is typically [lon, lat, alt], where lon is longitude, lat is latitude, and alt is altitude. The longitude and latitude coordinates are converted to a plane coordinate system using a geographic coordinate conversion library to obtain the lawn mower's position in the plane coordinate system.

[0087] The target position is a phased goal selected from the lawn boundary coordinate point set according to a specific planning strategy. It is the point that needs to be reached in the current planning stage. The coordinate points of the lawn boundary are pre-set in the system, and one or more are selected from the lawn boundary coordinate point set according to the preset planning strategy as the target position. If the strategy is to mow clockwise along the lawn boundary, then a point on the boundary can be selected as the current target position. For example, the lawn is a rectangular area, and the boundary coordinate point set includes four corner points. If the strategy is to mow clockwise from the upper left corner, then the first target position can be the corner point in the upper left corner, and the second target position can be the corner point in the upper right corner.

[0088] Step S02: acquiring image information using a visual sensor, identifying obstacles in the image information using a pre-trained target detection algorithm, and obtaining the location of the obstacles.

[0089] In this embodiment, a visual sensor, such as a camera, periodically or in real time captures image information in front of the lawn mower. The image information is then preprocessed, including denoising, contrast enhancement, and color space conversion. Optionally, Gaussian filtering or median filtering is applied to remove image noise. Image clarity is enhanced through histogram equalization or adaptive histogram equalization. The image is converted from RGB to HSV or grayscale for ease of subsequent processing.

[0090] Obstacle detection is performed using a pre-trained object detection algorithm, which can be a deep learning model such as YOLO or Faster R-CNN. The preprocessed image is fed into the object detection model, which outputs the detected obstacle bounding boxes and categories. A threshold is set based on application requirements. All detection results are iterated over, and those with a confidence score below the threshold are discarded. The camera's intrinsic parameters (focal length, optical center) and extrinsic parameters (rotation matrix, translation vector) are obtained using a calibration plate. The pixel coordinates in the image are converted to physical coordinates on the plane where the lawn mower is located. The actual physical dimensions of the obstacles are calculated based on the pixel size and depth information of the bounding box. The location information (center coordinates) and dimensions of each obstacle are combined into a tuple format. All obstacle tuples are stored in a list to form a coordinate set for each obstacle. Images are recaptured and the obstacle coordinate set is updated periodically to ensure real-time information.

[0091] Step S03: generating the grid map according to the current position of the lawn mower, the target position and the position of the obstacle.

[0092] In this embodiment, the working area of ​​the lawn mower is determined and divided into small grids. Each grid can be represented by an element in a two-dimensional array, where the subscript of the array corresponds to the position of the grid in the working area. A grid map is initialized and all grids are marked as passable, with 0 indicating passable and 1 indicating impassable. The current position of the lawn mower, the target position, and the position of the obstacle are converted to coordinates in the grid map by dividing the continuous coordinates by the grid size and rounding. The current position and target position of the lawn mower are marked in the grid map. For each obstacle, all grids covered by it are traversed and the values ​​of these grids are set to impassable.

[0093] Optionally, based on the range of the grid covered by the obstacle, it can be determined whether to mark the partially covered grid as impassable. Based on the position and size of the obstacle, determine the range of the grid it may cover. Convert the coordinates of the obstacle into a grid index. Traverse each grid that may be covered to determine the extent to which it is covered by the obstacle. For rectangular obstacles, calculate the range of grid rows and columns it covers. For circular obstacles, traverse each point or sampling point in the grid, and count the number of points located in the circle. Coverage ratio = number of points in the circle / total number of grid points. For polygonal obstacles, use the ray method or the point-in-polygon algorithm to count the number of points in the grid located in the polygon. Coverage ratio = number of points in the polygon / total number of grid points. Set a threshold based on application requirements and mark the grid whose coverage ratio exceeds the preset threshold as impassable.

[0094] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 4 Step S10, performing path planning on a preset grid map based on a preset path search algorithm to obtain a feasible path, may include steps S11 to S14:

[0095] Step S11 : Based on the path search algorithm, starting from the current position of the lawn mower as a starting node, traversing the grids in the grid map to generate neighbor nodes.

[0096] In this embodiment, the path search algorithm is an A* algorithm. The grid map represented by a two-dimensional array, the grid coordinates corresponding to the current position of the lawn mower, and the grid coordinates corresponding to the target position are input into the path search algorithm. Initialize the open list, closed list, and parent node dictionary. The open list is used to store the nodes to be expanded, sorted in ascending order by total cost. The closed list stores the expanded nodes to avoid repeated access. The parent node dictionary records the parent node of each node and is used to trace the path back from the grid corresponding to the current position of the lawn mower as the starting node. The starting node is added to the open list, the initial cost is set, and the path is gradually expanded to the surrounding nodes. The grids in the traversed grid map are the adjacent grids of a preset number of the starting node. For example, only up, down, left, and right movements are allowed, and the four adjacent grids of the starting node are traversed. During the traversal process, nodes beyond the map boundary, grids marked as inaccessible, and nodes already in the closed list are skipped to obtain neighbor nodes.

[0097] Step S12: Obtain the cost values ​​of the neighboring nodes and determine the target node corresponding to the minimum cost value.

[0098] In this embodiment, the cost value of each neighbor node is obtained, and the node with the smallest cost is selected as the target node for expansion until the target node is found or it is determined that there is no feasible path. The cost value is the sum of the actual cost g(neighbor) and the estimated cost g(current), where the actual cost represents the actual path length from the starting node to the current node; the estimated cost is the heuristic estimate from the current node to the target node. The estimated cost can be obtained based on the Manhattan distance, Euclidean distance or Chebyshev distance, and is used to guide the search direction to prioritize the expansion of nodes closer to the target and reduce the search space. If the neighbor node is not in the open list, it is added to the open list and the parent node is set to current; if the neighbor is already in the open list, but the newly calculated total cost is smaller, its cost value is updated and the parent node is reset.

[0099] The actual cost is the sum of the actual cost from the starting node to the current node, g(current), plus the cost of moving from current to the neighbor. The actual cost g(neighbor) = g(current) + the cost of moving. If up, down, left, and right movement is allowed, the cost is usually 1; if diagonal movement is allowed, the cost can be √2. h(neighbor) = heuristic function (neighbor, goal) = |x neighbor -x goal ∣+∣y neighbor -y goal|. For example, when the heuristic function is Manhattan distance, the current node current = (2, 2), g(current) + = 4, the neighbor node neighbor = (2, 3), the target node goa = (4, 4), and the movement cost = 1, then the actual cost g(neighbor) = g(current) + 1 = 4 + 1 = 5, the estimated cost h(neighbor) = |2-4|+|3-4|= 2+1=3, and the total cost f(neighbor) = g(neighbor) + h(neighbor) = 5+3=8.

[0100] Step S13: searching for a path according to the target node until the target location is found.

[0101] Step S14: tracing back from the target position to the current position of the lawn mower to obtain the feasible path.

[0102] In this embodiment, expansion is carried out according to the target node, and its parent node is recorded in the parent node dictionary, that is, the parent node from which the current node is expanded. When the current node reaches the target position, path backtracking is triggered. Using the parent node dictionary, starting from the current node, the parent nodes are accessed in sequence until the initial position (i.e. the current position of the lawn mower) is reached, and the path nodes are stored in order as a list. Since the backtracking obtains the reverse path, the list needs to be reversed to obtain the forward path. If the open list is empty and the target node is not found, it indicates that there is no feasible path and the search is terminated. Finally, the path obtained by backtracking may contain redundant nodes (such as broken lines). The path is optimized by the path smoothing algorithm to obtain a feasible path. The feasible path is an ordered list of node coordinates. Heuristic search is performed according to the A* algorithm. By combining the actual cost (g) and the estimated cost (h), the node with the smallest cost is preferentially expanded to avoid blindly searching the entire map.

[0103] Based on the first embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to above and will not be described in detail. On this basis, step S40 uses the light utilization rate as a constraint condition of the preset optimization algorithm, and obtains the target path based on the optimization algorithm, which may include steps S41 to S42:

[0104] Step S41: constructing an objective function according to the light utilization rate, path length and path smoothness.

[0105] In this embodiment, the path points in the feasible path are decision variables that determine the shape of the path. The objective function can be expressed as J = w1*L+w2*S+w3*U, where L is the path length, S is the path smoothness, and U is the light utilization rate. w1, w2, and w3 are the weights of the corresponding factors. The weights can be set based on the experience of similar projects in the past or the knowledge of experts in the field. When performing path planning, the initial weight values ​​are used to record the paths obtained for each planning and the related performance indicators such as path length, smoothness, and light utilization rate. The collected performance indicator data is analyzed, and the statistics such as the mean and standard deviation of each indicator under different weight settings are calculated to understand the performance of each indicator. Based on the performance indicator analysis and feedback, determine the direction in which the weights need to be adjusted.

[0106] Optionally, the weight corresponding to the light utilization rate is adjusted according to the light intensity, so as to control the degree of influence of the light direction on the path planning. Use a light sensor to monitor the ambient light intensity in real time, and judge whether the current environment is weak light, medium light or strong light according to the light intensity value. Obtain the corresponding weight parameter value according to the light intensity classification result, and adjust the weight parameter. When the light intensity is less than the preset first light intensity and is in a weak light environment, the light intensity is not enough to have a significant impact on the operation of the lawn mower, and the first weight is set to 0, ignoring the influence of light. When the light intensity is greater than or equal to the preset first light intensity and less than the second light intensity, the current environment is medium light. When the light intensity is greater than or equal to the third light intensity, the current environment is strong light.

[0107] Optionally, path smoothness is obtained based on curvature. For every three adjacent points P on the path i-1 、P i 、P i+1 , calculate the adjacent line segment P i-1 P i and P i P i+1 Using the dot product and modulus of the vector, calculate the adjacent line segment P i-1 P i and P i P i+1 Angle θ i The cosine value of . Curvature K i It can be approximated by dividing the sine of the angle by the product of the lengths of the adjacent line segments. The path length L can be calculated by calculating the Euclidean distances between adjacent points on the path and summing them.

[0108] Step S42: determining the optimal solution of the objective function based on the optimization algorithm to obtain the target path.

[0109] In this embodiment, the path optimization is performed according to the optimization algorithm. The objective function guides the algorithm to find a path that minimizes the total cost. The direction of the optimized path segment will be as close to perpendicular to the sunrise and sunset direction as possible.

[0110] Optionally, determining the target path based on a simulated annealing algorithm includes: randomly changing points on the current path to obtain an updated path; obtaining a first objective function value of the current path and a second objective function value of the updated path; if the first objective function value is less than the second objective function value, iterating according to the updated path until a termination condition is reached.

[0111] In each iteration, a new path is generated by randomly changing some points on the current path. The difference between the first objective function value of the current path and the second objective function value of the new path is obtained. If the difference is less than zero, the new path is accepted as the current path. If the difference is greater than zero, the new path is accepted with a certain probability, P = e-(T / ΔJ), where T is the current temperature and ΔJ is the difference. The temperature is lowered according to the temperature reduction strategy, and the above steps are repeated until the set termination condition is met, such as the number of iterations reaching the preset number or the temperature drops sufficiently low.

[0112] Optionally, the target path is determined based on a genetic algorithm. First, the objective function value of each path in the population is calculated, and the fitness of each path is determined based on the objective function value. Secondly, roulette wheel selection, tournament selection, and other methods are used to select paths with higher fitness from the current population to enter the next generation population. Then, a crossover operation is performed to randomly select two paths, exchange their path point information according to a certain crossover probability, and generate a new path. Finally, a mutation operation is performed to randomly change the path points in the path with a smaller mutation probability (such as 0.01). Repeat the selection, crossover, and mutation operations to generate the next generation population until the set termination condition is reached.

[0113] Based on the first embodiment of the present application, in the fifth embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 5 The lawn mower path planning based on the light direction may further include steps A10 to A20:

[0114] Step A10: When it is detected that the angle between the illumination direction and the driving direction of the lawn mower is smaller than a preset angle threshold, and the image exposure area is larger than a preset exposure area threshold, it is determined that the lawn mower is in a backlit area.

[0115] In this embodiment, the overexposure threshold is set according to the dynamic range of the camera and experimental data. For example, a grayscale value greater than 240 is considered overexposure. After the color image captured by the visual sensor is converted into a grayscale image, the pixels in the grayscale image that are higher than the threshold are set to 1, and the rest are set to 0 to generate a binary mask image. The overexposed area is marked by a connected domain algorithm (such as OpenCV's findContours). The total number of pixels with a value of 1 in the binary mask image is obtained, and the proportion of overexposed areas = the total number of pixels in the image × the number of overexposed pixels × 100%. By integrating the angular velocity data output by the gyroscope, the deflection angle of the lawn mower relative to the initial direction is obtained, and then its current driving direction is obtained. When it is detected that the angle between the driving direction of the lawn mower and the illumination direction is less than the preset angle threshold, and the overexposure in the image captured by the visual sensor exceeds the preset exposure area threshold, the lawn mower is traveling against the light, triggering the backlight emergency process and generating a turning speed perpendicular to the current driving direction.

[0116] Step A20: Generate a turning speed perpendicular to the illumination direction, and control the lawn mower to change direction at the turning speed.

[0117] In this embodiment, a velocity vector perpendicular to the illumination direction is generated and inserted into the candidate list of the path planning module as a new candidate path. An emergency flag is added to the candidate vertical velocity vector to ensure that it is given priority during path selection.

[0118] If the angle between the current path and the direction of illumination is too large, transition points are inserted to smooth the transition and prevent sudden turns that could destabilize the vehicle. A maximum allowable steering angle is pre-set; if the angle between the current path and the direction of illumination exceeds this maximum allowable steering angle, a transition point is inserted. The angle between the current path and the direction of illumination is broken down into multiple, smaller turns, gradually approaching the target direction. Transition points are interpolated using Bezier or spline curves to generate a smoother path. This combination of step-by-step steering and transition point interpolation allows for a smooth transition from the current path to a perpendicular path.

[0119] The present application provides a lawn mower path planning device based on light direction, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the lawn mower path planning method based on light direction in the above-mentioned embodiment 1.

[0120] Reference below Figure 6, which shows a schematic structural diagram of a lawn mower path planning device based on light direction suitable for implementing an embodiment of the present application. The lawn mower path planning device based on light direction in the embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, personal digital assistants (PDAs), tablet computers (portable Android devices), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The lawn mower path planning device based on light direction shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0121] like Figure 6 As shown, the path planning device for a lawn mower based on illumination direction may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. Various programs and data required for the operation of the path planning device for a lawn mower based on illumination direction are also stored in the RAM 1004. The processing device 1001, the read-only memory 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the lawn mower path planning device based on light direction to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a lawn mower path planning device based on light direction with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems can be implemented or have instead.

[0122] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are performed.

[0123] The lawn mower path planning device based on illumination direction provided in this application, which utilizes the lawn mower path planning method based on illumination direction described in the aforementioned embodiment, can solve the technical problem of how to prevent sunlight backlight from reducing the accuracy of visual recognition and improve the safety and accuracy of path planning. Compared to the prior art, the beneficial effects of the lawn mower path planning device based on illumination direction provided in this application are the same as those of the lawn mower path planning method based on illumination direction provided in the aforementioned embodiment. The other technical features of the lawn mower path planning device based on illumination direction are the same as those disclosed in the aforementioned embodiment and are not further elaborated here.

[0124] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0125] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

[0126] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, a computer program) stored thereon, wherein the computer-readable program instructions are used to execute the lawn mower path planning method based on light direction in the above embodiment.

[0127] The computer-readable storage medium provided in the present application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM, Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM, CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: an electric wire, an optical cable, a radio frequency (RF, Radio Frequency), etc., or any suitable combination thereof.

[0128] The computer-readable storage medium may be included in the path planning device for a lawn mower based on light direction, or may exist independently and not be incorporated into the path planning device for a lawn mower based on light direction. The computer-readable storage medium carries one or more programs. When executed by the path planning device for a lawn mower based on light direction, the one or more programs cause the path planning device for a lawn mower based on light direction to: perform path planning on a preset grid map based on a preset path search algorithm to obtain a feasible path; obtain the light direction based on the current date, time, and geographic location information; determine the light utilization rate based on the path direction of the feasible path and the light direction; and use the light utilization rate as a constraint condition of a preset optimization algorithm to obtain a target path based on the optimization algorithm.

[0129] Computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0130] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing 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 than that marked in the accompanying drawings. For example, two boxes represented in succession 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 flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0131] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.

[0132] The computer-readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned method for planning a lawn mower path based on illumination direction. This computer-readable storage medium can address the technical problem of preventing sunlight backlight from reducing the accuracy of visual recognition and improving the safety and accuracy of path planning. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the method for planning a lawn mower path based on illumination direction provided in the aforementioned embodiment, and are not further elaborated here.

[0133] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A lawn mower path planning method based on light direction, characterized in that: The lawn mower path planning method based on light direction includes: Based on the preset path search algorithm, path planning is performed on the preset grid map to obtain a feasible path; Get the lighting direction based on the current date, time and geographic location information; determining a light utilization rate according to the path direction of the feasible path and the light direction; The light utilization rate is used as a constraint condition of a preset optimization algorithm, and a target path is obtained based on the optimization algorithm.

2. The lawn mower path planning method based on light direction according to claim 1, characterized in that: The step of performing path planning on a preset grid map based on a preset path search algorithm to obtain a feasible path includes: Based on the path search algorithm, starting from the current position of the lawn mower as a starting node, traversing the grids in the grid map to generate neighbor nodes; Obtaining the mobility cost values ​​of the neighboring nodes and determining the target node corresponding to the minimum mobility cost value; Perform path search according to the target node until the target location is found; The feasible path is obtained by tracing back from the target position to the current position of the lawn mower.

3. The lawn mower path planning method based on light direction according to claim 2, characterized in that: Before the step of traversing the grids in the grid map from the current position of the lawn mower as the starting node based on the path search algorithm to generate neighbor nodes, the step further includes: Determining the target position in a preset lawn boundary coordinate set; Obtaining image information from a visual sensor, identifying obstacles in the image information using a pre-trained target detection algorithm, and obtaining the location of the obstacles; The grid map is generated according to the current position of the lawn mower, the target position and the obstacle position.

4. The lawn mower path planning method based on light direction according to claim 1, characterized in that: The step of obtaining the light direction according to the current date, time, and geographical location information includes: Inputting the current date, the time, and the geographical location information into a preset astronomical algorithm to obtain a solar azimuth; The solar azimuth angle is determined as the illumination direction.

5. The lawn mower path planning method based on light direction according to claim 1, characterized in that: The step of determining the illumination utilization rate according to the path direction of the feasible path and the illumination direction comprises: Determining the path direction according to the coordinates of adjacent path points on the feasible path; Obtaining an angle between the path direction and the illumination direction, and a difference between the angle and a vertical direction; The light utilization rate is determined according to the difference.

6. The lawn mower path planning method based on light direction according to claim 1, characterized in that: The step of using the light utilization rate as a constraint condition of a preset optimization algorithm and obtaining a target path based on the optimization algorithm includes: Constructing an objective function based on the light utilization rate, path length and path smoothness; An optimal solution of the objective function is determined based on the optimization algorithm to obtain the target path.

7. The lawn mower path planning method based on light direction according to claim 6, characterized in that: The step of determining the optimal solution of the objective function based on the optimization algorithm to obtain the target path includes: Randomly change the points on the current path to get the latest path; Obtaining a first objective function value of the current path and a second objective function value of the latest path; If the first objective function value is less than the second objective function value, iteration is performed according to the latest path until a termination condition is reached.

8. The lawn mower path planning method based on light direction according to claim 1, characterized in that: The lawn mower path planning method based on light direction also includes: When it is detected that the angle between the illumination direction and the driving direction of the lawn mower is less than a preset angle threshold, and the image exposure area is greater than a preset exposure area threshold, it is determined that the lawn mower is in a backlit area; A turning speed perpendicular to the light irradiation direction is generated, and the lawn mower is controlled to change direction at the turning speed.

9. A lawn mower path planning device based on light direction, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the lawn mower path planning method based on light direction according to any one of claims 1 to 8.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the lawn mower path planning method based on light direction as described in any one of claims 1 to 8 are implemented.