A robot path planning method and a computer readable storage medium
By upsampling and binary image processing of the grid map, contour points are extracted and smoothed, and path points are optimized. This solves the problem of missing boundary areas in traditional methods, achieving efficient cleaning and path smoothing, and improving the cleaning efficiency and quality of the cleaning robot.
Patent Information
- Application Number
- CN202511522692.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2045-10-23
AI Technical Summary
Traditional path planning methods ignore the boundaries of the cleaning area, causing cleaning robots to miss areas near the boundaries or corners, resulting in low cleaning efficiency and unsatisfactory results.
The process involves upsampling a raster map, creating a binary image and dilating it, extracting contour points and smoothing them, optimizing the orientation and starting point of path points, interpolating and sparsifying the contour points, and generating smooth paths using B-Spline basis functions.
It achieves efficient utilization of the cleaning area boundaries, improves the working efficiency and cleaning quality of the cleaning robot, reduces running time, extends battery life, and provides a better user experience.
Smart Images

Figure CN121323640B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robotics, and more particularly to a robot path planning method and a computer-readable storage medium. Background Technology
[0002] Path planning is one of the key technologies to ensure that robots can move autonomously and perform tasks. Traditional global path planning methods mainly focus on finding the shortest path from the starting point to the destination while avoiding collisions with obstacles. However, this method often neglects to make full use of the boundaries of the cleaning area. Due to this neglect, cleaning robots may miss areas near the boundaries or corners when performing cleaning tasks. These areas are often the most difficult to reach, which may lead to low cleaning efficiency and unsatisfactory cleaning results. Summary of the Invention
[0003] Therefore, there is a need to provide a robot path planning method and a computer-readable storage medium to solve the problem that existing path planning methods miss areas near the boundary, resulting in low cleaning efficiency and unsatisfactory cleaning effects.
[0004] To achieve the above objectives, the inventors provide a robot path planning method, comprising the following steps:
[0005] Acquire and upsample the raster map: Acquire the original raster map, calculate the upsampling ratio based on the target resolution, create a new upsampled map, and then upsample the data from the original raster map into the upsampled map;
[0006] Create a binary map: Obtain the polygon vertex information of the clean area corresponding to the user input on the upsampled map, obtain the minimum bounding rectangle bounding box based on the polygon vertex information, and create a binary map based on the minimum bounding rectangle bounding box;
[0007] Dilation process: Expand the obstacle grid in the clean area of the binary image outward by a preset pixel width to simulate a safe distance;
[0008] Extracting contour points: Extracting empty grid cells near the edge of obstacles from the binary image as candidate points and obtaining a set of candidate points. Obtaining a contour chain based on the candidate point set. Converting the pixel coordinates of each candidate point in the largest contour chain to world coordinates to obtain the contour points corresponding to each candidate point.
[0009] Contour point smoothing: Smooth the contour points to obtain smooth path points;
[0010] Calculate path point orientation: Calculate the orientation of each path point based on the world coordinates of adjacent path points, and set it into the pose of the corresponding path point;
[0011] Adjust the starting point of the path: Select the path point closest to the robot's current position as the starting point of the edge-fitting path.
[0012] Furthermore, after extracting the contour points and before smoothing them, the following steps are also included:
[0013] Contour point interpolation: Inserts an intermediate point between two adjacent contour points, and uses the intermediate point as the contour point.
[0014] Furthermore, the contour point interpolation also includes the following steps:
[0015] Determine if the distance between adjacent contour points is greater than the execution distance threshold. If so, insert multiple intermediate points proportionally.
[0016] Furthermore, after contour point interpolation and before contour point smoothing, the following steps are also included:
[0017] Contour point sparsification: Determine whether the angle of three consecutive contour points is greater than a specified angle threshold, or whether the distance between two consecutive contour points is less than the minimum distance threshold. If so, delete the contour point in the middle.
[0018] Furthermore, the contour point smoothing process also includes the following steps:
[0019] Obtain the curvature of the curve corresponding to the contour point sequence; multiple contour points form a contour point sequence.
[0020] Transition points are inserted at the points where the curvature of the curve corresponding to the contour point sequence changes abruptly, and used as contour points.
[0021] A non-uniform node vector U is dynamically generated based on the geometric changes between adjacent contour points:
[0022]
[0023] in, Indicate node parameters:
[0024]
[0025] in, Represents the weights for geometric changes:
[0026]
[0027] in, , These are weighting coefficients. The value is 0.5 to 1.0. The value is 0.5 to 1.0. Let be the local curvature of the curve corresponding to the contour point sequence. The average point spacing is the sum of the distances between two adjacent contour points divided by the number of contour points, and P is the world coordinate of the contour point.
[0028] The new transition point is obtained based on the non-uniform node vector, B-Spline basis function, and transition point calculation formula:
[0029] The B-Spline basis functions are:
[0030]
[0031] Where k=3;
[0032] The new formula for calculating the transition point is:
[0033] .
[0034] Furthermore, the sampling interval at the transition point Dynamically set based on the local curvature of the curve:
[0035]
[0036] in, As the baseline value, The range is 0 to 0.1. Scaling factor The local curvature of the curve corresponding to the contour point sequence.
[0037] Furthermore, it also includes the following steps:
[0038] Determine two adjacent transition points Q j Q j+1 Does the rate of change of the derivative exceed the preset value of the derivative? If so, then for three consecutive transition points Q... j-1 Q j Q j+1 Perform filtering and smoothing processing.
[0039] Furthermore, preset pixel width It can be obtained through the following formula:
[0040]
[0041] in, For a safe distance, This refers to the map resolution.
[0042] Furthermore, after creating the binary map but before the dilation process, the following steps are also included:
[0043] Image processing: Set the pixel value of the free grid cells in the clean area of the binary image to 255, the pixel value of the obstacle grid cells to 0, and the pixel value of the unknown grid cells to 0.
[0044] To achieve the above objectives, the inventors also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the robot path planning method described in any of the above embodiments.
[0045] Unlike existing technologies, the above technical solution has the following beneficial effects:
[0046] This technology enables efficient utilization of the cleaning area boundaries, significantly improving the working efficiency and cleaning quality of the cleaning robot. In particular, it solves the problem of potentially overlooking areas near the boundaries in traditional methods, providing a more comprehensive and meticulous cleaning service. Furthermore, through path optimization and smoothing, it can reduce robot runtime, extend battery life, and provide users with a better experience.
[0047] The above description of the invention is merely an overview of the technical solution of this application. In order to enable those skilled in the art to better understand the technical solution of this application and to implement it based on the description and drawings, and to make the above-mentioned objectives and other objectives, features and advantages of this application easier to understand, the following description is provided in conjunction with the specific embodiments and drawings of this application. Attached Figure Description
[0048] The accompanying drawings are only used to illustrate the principles, implementation methods, applications, features, and effects of specific embodiments of the present invention and other related contents, and should not be considered as limitations on this application.
[0049] Figure 1 This is one of the robot path planning methods described in this embodiment;
[0050] Figure 2 This is the second robot path planning method described in this embodiment;
[0051] Figure 3 This is a schematic diagram of the cleaning area and path points described in this embodiment;
[0052] Figure 4 This is a schematic diagram of the minimum bounding rectangle of this embodiment;
[0053] Figure 5 This is a flowchart of the contour point interpolation described in this embodiment. Detailed Implementation
[0054] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this application in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this application and are therefore intended to limit the scope of protection of this application.
[0055] In this document, the term "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The term "embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment, nor does it specifically limit its independence or connection with other embodiments. In principle, in this application, as long as there are no technical contradictions or conflicts, the technical features mentioned in each embodiment can be combined in any way to form corresponding implementable technical solutions.
[0056] Unless otherwise defined, the technical terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the use of related terms herein is merely for the purpose of describing particular embodiments and is not intended to limit this application.
[0057] In the description of this application, the term "and / or" is used to describe the logical relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A exists, B exists, and A and B exist simultaneously. Additionally, the character " / " in this document generally indicates that the preceding and following objects have an "or" logical relationship.
[0058] In this application, terms such as “first” and “second” are used only to distinguish one entity or operation from another, and do not necessarily require or imply any actual quantity, hierarchy or order relationship between these entities or operations.
[0059] Unless otherwise specified, the use of terms such as “comprising,” “including,” “having,” or other similar expressions in this application is intended to cover non-exclusive inclusion, which does not exclude the presence of additional elements in a process, method, or product that includes the stated elements, such that a process, method, or product that includes a list of elements may include not only those defined elements but also other elements not expressly listed, or elements inherent to such a process, method, or product.
[0060] As understood in the Examination Guidelines, in this application, expressions such as "greater than," "less than," and "exceeding" are understood to exclude the stated number; expressions such as "above," "below," and "within" are understood to include the stated number. Furthermore, in the description of the embodiments in this application, "multiple" means two or more (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups" and "multiple times," unless otherwise explicitly specified.
[0061] In the description of the embodiments of this application, the space-related expressions used, such as "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "vertical," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential," indicate the orientation or positional relationship based on the orientation or positional relationship shown in the specific embodiments or drawings. They are only for the purpose of describing the specific embodiments of this application or for the reader's understanding, and do not indicate or imply that the device or component referred to must have a specific position, a specific orientation, or be constructed or operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.
[0062] Unless otherwise expressly specified or limited, the terms "installation," "connection," "linking," "fixing," and "setting," as used in the description of the embodiments of this application, should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral setting; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal connection of two components or the interaction between two components. For those skilled in the art to which this application pertains, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0063] Please see Figures 1 to 5 This embodiment provides a robot path planning method, including the following steps:
[0064] S101, Obtain and Upsample Raster Map: Obtain the original raster map, calculate the upsampling ratio based on the target resolution, create a new upsampled map, and then upsample the data from the original raster map into the upsampled map;
[0065] Upsampling refers to increasing the resolution of the original raster map through interpolation operations to achieve higher spatial accuracy in path planning. Preferably, the upsampling operation is implemented using OpenCV's `cv::resize()` function. The principle is as follows: if the original map resolution is r0 and the target resolution is r... t Then the upsampling ratio s = r0 / r tThe upsampled map has more detailed obstacle boundary information, enabling subsequent contour extraction and path smoothing algorithms to fit the navigation area more accurately at the pixel level.
[0066] S102, Create a binary map: Obtain the polygon vertex information of the clean area corresponding to the user input on the upsampled map, obtain the minimum bounding rectangle bounding box based on the polygon vertex information, and create a binary map based on the minimum bounding rectangle bounding box;
[0067] Typically, users can directly mark the boundaries of the specific area they want to clean, i.e., the cleaning area, on a digital map (which may be a layout diagram displayed on the robot's operating interface). Figure 3 The quadrilateral labeled 'a' is used. Based on the coordinates of each vertex of the clean region, a binary map matching the size of the clean region is created, providing a foundation for subsequent image processing and contour extraction. Figure 4 The quadrilateral marked 'a' in the diagram represents the clean area, and 'd' represents the minimum bounding rectangle.
[0068] S103, Dilation Processing: Expand the obstacle grid in the clean area of the binary image outward by a preset pixel width to simulate a safe distance;
[0069] A grid map refers to discretizing a robot's workspace into a two-dimensional grid with a fixed resolution. Each grid cell contains occupancy status information for its corresponding location. This occupancy status information typically includes: Free: Indicates an area that the robot can traverse; the corresponding grid cell can be named an free grid cell. Occupied: Indicates an obstacle or impassable area; the corresponding grid cell can be named an obstacle grid cell. Unknown: Indicates an area not effectively covered by the robot's sensors; its status is unclear; the corresponding grid cell can be named an unknown grid cell.
[0070] In the binary graph, the robot marks the grids that the cleaning area passes through, as well as the grids within the polygons that are originally occupied or unknown. This ensures that the cleaning area is accurately represented in the binary graph, providing clear boundary information for subsequent path planning.
[0071] Safe distance refers to the minimum distance a robot must maintain when approaching an obstacle in order to avoid collisions or accidental contact.
[0072] S104, Extract contour points: Extract the empty grid near the edge of the obstacle from the binary image as candidate points, and obtain a set of candidate points. Obtain a contour chain based on the set of candidate points. Convert the pixel coordinates of each candidate point in the largest contour chain to world coordinates to obtain the contour points corresponding to each candidate point.
[0073] Starting from any unvisited candidate point, the direction vector is initialized. Then, a direction-guided adjacency search strategy is adopted to prioritize moving in the current direction or turning right in the eight neighborhoods to find the next boundary point, so as to build a contour chain with consistent direction. Whenever a new candidate point is added to the path, the current position and direction of travel are updated, and the visited points are removed from the set. This process continues to iterate until a closed or open contour chain is formed. Finally, the largest contour chain is selected as the object of subsequent processing to ensure that the path planning is based on the main clean area boundary and ignores possible small noise or discontinuities.
[0074] S107, Contour Point Smoothing: Smooth the contour points to obtain smooth path points, reducing the robot's frequent turning during navigation.
[0075] S108, Calculate the orientation of the path point: Calculate the orientation of each path point based on the world coordinates of the adjacent path points and set it into the pose of the corresponding path point, providing directional information for the robot's navigation and ensuring that the robot can move correctly along the planned path;
[0076] S109, Adjust the starting point of the path: Select the path point closest to the robot's current position as the starting point of the edge-fitting path, which improves the adaptability of path planning and ensures that the robot can start executing the planned path from the current position, thereby improving the practicality and flexibility of path planning.
[0077] The above technical solution has the following beneficial effects:
[0078] This technology enables efficient utilization of the cleaning area boundaries, significantly improving the working efficiency and cleaning quality of the cleaning robot. In particular, it solves the problem of potentially overlooking areas near the boundaries in traditional methods, providing a more comprehensive and meticulous cleaning service. Furthermore, through path optimization and smoothing, it can reduce robot runtime, extend battery life, and provide users with a better experience.
[0079] Please see Figure 2 In some embodiments, after extracting contour points and before smoothing the contour points, the robot path planning method further includes the following steps:
[0080] S105, Contour Point Interpolation: Inserts an intermediate point between adjacent contour points, which is then used as a contour point.
[0081] To make the path more refined and smoother, the extracted contour points are interpolated to increase the density of the contour points, which can eliminate gaps between the contour points and improve the continuity of the curve.
[0082] Please see Figure 5 In some embodiments, during S105, the contour point interpolation further includes the following steps:
[0083] Determine if the distance between two contour points of adjacent wheels is greater than the execution distance threshold. If it is, insert multiple intermediate points proportionally on the line segment between the two contour points of adjacent wheels. If not, no intermediate points need to be added.
[0084] Number of intermediate points Calculation formula:
[0085]
[0086] in, This is the distance (Euclidean distance) between two contour points of adjacent wheels. The distance threshold is set to 0.01 to 0.1 meters.
[0087] Please see Figure 2 In some embodiments, after contour point interpolation and before contour point smoothing, the following steps are further included:
[0088] S106, Contour point sparsification: Determine whether the angle of three consecutive contour points is greater than a specified angle threshold, or whether the distance between two consecutive contour points is less than the minimum distance threshold. If so, delete the contour point located in the middle.
[0089] The increased number of points after interpolation increases the computational burden. To improve path planning efficiency, the robot performs sparsification and corner removal on the interpolated contour points (including interpolated intermediate points and initial contour points) to remove unnecessary points. This step reduces the number of path points by selecting key contour points while preserving the main features of the path.
[0090] Specifically:
[0091] Continuous contour points: P i-1 ,P i ,P i+1 ,
[0092] Adjacent vectors: ,
[0093] included angle:
[0094] When the cumulative path length L > the minimum distance threshold L min or corner >Specify angle threshold If the point is a critical turning point, it is considered a key turning point and should be retained. Otherwise, it indicates that the path is relatively smooth and short locally, and the point can be ignored.
[0095] In some embodiments, the path planning method inputs a sequence of contour points P that has undergone sparsification and corner point processing:
[0096] ,
[0097] Where n≥4.
[0098] Then output the smoothed curve point sequence Q:
[0099] ,
[0100] Where m > n.
[0101] In S107, the robot path planning method further includes the following steps during contour point smoothing:
[0102] S1071, Obtain the curvature of the curve corresponding to the contour point sequence; multiple contour points form a contour point sequence; Calculate the input contour point P. i-1 ,P i ,P i+1 The discrete curvature is given by the following formula:
[0103]
[0104] Where “×” represents the cross product of two-dimensional vectors.
[0105] If the following conditions are met: Then the contour point P i This is the point of abrupt change in curvature.
[0106] S1072, Insert transition points at the curvature abrupt change points of the curve corresponding to the contour point sequence, and use them as contour points;
[0107] S1073, dynamically generates a non-uniform node vector U based on the geometric changes between adjacent contour points:
[0108]
[0109] in, Indicate node parameters:
[0110]
[0111] in, Represents the weights for geometric changes:
[0112]
[0113] in, , These are weighting coefficients. The value is 0.5 to 1.0. The value is 0.5 to 1.0. Let be the local curvature of the curve corresponding to the contour point sequence. The average distance between points is the sum of the distances between two adjacent contour points divided by the number of contour points, where P is the world coordinate of the contour point. For example, if there are 5 contour points and the distance between two adjacent points is 0.1 meters, then the average distance between points is (0.1 + 0.1 + 0.1 + 0.1) / 4 = 0.1.
[0114] The new transition point is obtained based on the non-uniform node vector, B-Spline basis function, and transition point calculation formula:
[0115] The B-Spline basis functions are:
[0116]
[0117] Where k=3, it is the third order of B-Spline;
[0118] The new formula for calculating the transition point is:
[0119]
[0120] After contour point extraction and sparsification, the resulting contour point sequence, while representing the main navigation area boundary, may still contain issues such as local corners, abrupt changes in direction, or uneven spacing. Directly using this for path planning or navigation control would cause frequent changes in the mobile robot's heading and jitter in control commands, affecting stability and positioning accuracy. Therefore, smoothing the contour point sequence to obtain a transition point sequence and an optimized path curve can improve the smoothness and controllability of the generated curve. This allows for denser node density and finer sampling in high-curvature regions, thus preserving the geometric characteristics of the path.
[0121] In some embodiments, the sampling interval of the transition point Dynamically set based on the local curvature of the curve:
[0122]
[0123] in, As the baseline value, The range is 0 to 0.1. Scaling factor The local curvature of the curve corresponding to the contour point sequence.
[0124] The sampling density is automatically increased in areas of high curvature to ensure smooth curve fitting without distortion.
[0125] In some embodiments, during the contour point smoothing process in S107, the following steps are further included:
[0126] S1074, Continuity Detection: Determine the transition points Q between two adjacent points.j Q j+1 If the rate of change of the derivative is greater than the preset value of the derivative, then perform local filtering and smoothing: for three consecutive transition points Q j-1 Q j Q j+1 Perform filtering and smoothing processing.
[0127] If the rate of change of the first derivative of adjacent segments satisfies:
[0128]
[0129] This indicates that the derivative "jumps," exhibiting a discontinuity, specifically a transition point Q. j The curve is not smooth.
[0130] in, The values [0.05, 0.3] are acceptable.
[0131] The local filtering and smoothing operation is as follows:
[0132] Perform three-point weighted smoothing on the outlier regions:
[0133]
[0134] Boundary handling:
[0135] Apply fixed boundary conditions to the beginning and end segments of the curve: if it is a closed profile, the derivatives at the beginning and end are equal; if it is an open profile, the derivatives at both ends are zero (natural boundary conditions).
[0136] In short, the smoothing method first performs curvature analysis on the contour point sequence, automatically inserting transition control points in regions of abrupt curvature changes. Secondly, it dynamically generates non-uniform node vectors based on the geometric changes between contour points and adaptively adjusts the parameter sampling density to obtain denser curve points in high-curvature regions. Subsequently, it generates smooth curve points through standard B-spline basis function recursion and weighted summation. Finally, when necessary, it performs derivative continuity detection and local filtering on boundary segments to ensure that the curve possesses high accuracy, high smoothness, and geometric consistency in scenarios such as contour fitting and path planning.
[0137] In S103, during the dilation process, the preset pixel width is... It can be obtained through the following formula:
[0138]
[0139] in, For a safe distance, This refers to the map resolution.
[0140] In some embodiments, after creating the binary map in S102 and before the dilation process in S103, the following steps are further included:
[0141] Image processing: Set the pixel value of the free grid cells in the clean area of the binary image to 255, the pixel value of the obstacle grid cells to 0, and the pixel value of the unknown grid cells to 0.
[0142] The initial free grid has a pixel value of 0, and the obstacle grid has a pixel value of 255. Image processing performs a binary inversion, which reverses the colors of the obstacle grid (black) and the free grid (white) to facilitate subsequent dilation operations. At this point, the unknown grid is assigned to the obstacle grid.
[0143] In some embodiments, the outermost pixels of the image can be set to 0 to avoid interference from boundary effects in subsequent operations.
[0144] In some embodiments, when extracting contour points in S104, the following steps are included:
[0145] After selecting empty grid cells near the obstacle edge from the binary image as candidate points, the algorithm uses one of the starting points and direction vectors as the initial state. It then searches for the next candidate point in its eight neighborhoods, prioritizing the current direction or the right turn direction. The algorithm terminates when a path closure is detected or no subsequent feasible points are found. This method balances contour continuity and direction consistency, effectively avoiding the broken or noisy contour problems that occur in complex obstacle scenes with the traditional cv::findContours() algorithm. Specific implementation details are as follows:
[0146] Construction of the candidate point (or boundary point) set: Define candidate points as "empty cells near the edge of obstacles" in the image. Pixels with a pixel value of 255 (empty) and at least one eight-neighbor pixel of 0 (occupied / obstacle) are considered as candidate points.
[0147] Starting point selection strategy (ensuring determinism): To ensure the method is repeatable and easy to debug, a deterministic selection rule is adopted: select the leftmost (or smallest x, then smallest y) pixel from the set as the starting point.
[0148] Termination conditions (closed and open contours): Closure determination: If p_next == p0, and C.length > min_close_length (minimum closed length threshold to avoid direct backlinks), then it is determined to be a closed contour, and the current chain generation is terminated; No neighbor determination (open contour): If no unvisited candidate point is found in the eight neighborhoods, then the current chain is "broken", considered an open contour, and the current chain generation is terminated; Other terminations: When the chain length exceeds max_chain_length (to prevent infinite loops) or a duplicate point (not the starting point) is encountered, the chain is terminated and marked as an abnormal chain. After a chain terminates, if there are still points in the set, a new starting point is selected again according to deterministic rules, and the operation is repeated until all candidate points have been visited or the maximum number of attempts is reached.
[0149] Contour selection rules (selecting the main contour): For each chain Ck, calculate the following metrics: number of points (length), geometric length (perimeter or arc length), and area estimate (if the chain is closed). Prioritize selecting the closed chain with the largest number of points or the largest perimeter. If no closed chain exists, select the chain with the largest perimeter.
[0150] The pixel coordinates of the candidate points are converted to world coordinates to obtain the contour points corresponding to each candidate point by following these steps:
[0151] Converting pixel coordinates (x_p, y_p) to ROS map coordinates:
[0152] X=(xp+min_cx) resolution + origin.x
[0153] Y=(yp+min_cy) resolution + origin.y
[0154] In some embodiments, after adjusting the path starting point, the following steps are also included:
[0155] Output the entire path, such as Figure 3 The curve path is indicated by label b, and several transition points near the curve are indicated by label c.
[0156] In some embodiments, before acquiring the raster map and upsampling, the following steps are also included:
[0157] S100, Initialize System: When the robot system starts, it first checks whether it has been initialized. If it has not been initialized, it acquires relevant parameters, such as the safe distance between the path and obstacles, the number of B-Spline operations, the maximum allowable distance between points, the upsampling value of the grid map resolution, the magnification factor of the smoothed path points, and robot size-related parameters.
[0158] This embodiment also provides a computer-readable storage medium storing a computer program, which, when run by a processor, executes the robot path planning method described in any of the above embodiments.
[0159] In a preferred embodiment, the robot is a cleaning robot. A cleaning robot is an intelligent device capable of automatically performing cleaning tasks and is widely used in homes, offices, and other indoor environments. These robots typically possess the following characteristics:
[0160] Autonomous navigation: It uses built-in sensors (such as LiDAR, cameras, ultrasonic sensors, etc.) to perceive the surrounding environment, build maps, and plan routes.
[0161] Automatic obstacle avoidance: It can identify obstacles and avoid them to prevent collisions.
[0162] Multiple cleaning modes: Supports multiple cleaning methods such as sweeping, vacuuming, and mopping.
[0163] Intelligent control: It can be remotely controlled via a mobile application, allowing you to set parameters such as cleaning area and time.
[0164] This application has the following beneficial effects:
[0165] 1. This invention achieves path continuity, smoothness, and high coverage through a complete link including map refinement, robust boundary extraction, point set optimization, curve smoothing, safety distance assurance, and dynamic starting point adaptation, balancing efficiency and safety, and improving the adaptability and robustness of the robot in planning edge-fitting paths in complex environments.
[0166] 2. An improved directed boundary tracking method is proposed, which combines direction-guided adjacency search to extract complete boundary contours even in the presence of noise or local discontinuities. Small pseudo-contours are automatically ignored, ensuring that path generation is based on the main navigation region and avoiding path deviations caused by local anomalies.
[0167] 3. An improved B-Spline curve smoothing method is adopted, which generates a smooth and geometrically consistent path through curvature analysis, adaptive node distribution, and transition control point insertion. This effectively reduces frequent turning and sudden stops during robot movement, reduces energy consumption and mechanical losses, and improves the overall efficiency of navigation.
[0168] Finally, it should be noted that although the above embodiments have been described in the text and drawings of this application, this should not limit the scope of patent protection of this application. Any technical solutions that are based on the essential concept of this application and utilize the content described in the text and drawings of this application, resulting in equivalent structural or procedural substitutions or modifications, as well as the direct or indirect application of the technical solutions of the above embodiments to other related technical fields, are all included within the scope of patent protection of this application.
Claims
1. A robot path planning method, characterized in that, Includes the following steps: Acquire and upsample the raster map: Acquire the original raster map, calculate the upsampling ratio based on the target resolution, create a new upsampled map, and then upsample the data from the original raster map into the upsampled map; Create a binary map: Obtain the polygon vertex information of the clean area corresponding to the user input on the upsampled map, obtain the minimum bounding rectangle bounding box based on the polygon vertex information, and create a binary map based on the minimum bounding rectangle bounding box; Dilation process: Expand the obstacle grid in the clean area of the binary image outward by a preset pixel width to simulate a safe distance; Extracting contour points: Extracting empty grid cells near the edge of obstacles from the binary image as candidate points and obtaining a set of candidate points. Obtaining a contour chain based on the candidate point set. Converting the pixel coordinates of each candidate point in the largest contour chain to world coordinates to obtain the contour points corresponding to each candidate point. Contour point smoothing: Smooth the contour points to obtain smooth path points; Calculate path point orientation: Calculate the orientation of each path point based on the world coordinates of adjacent path points, and set it into the pose of the corresponding path point; Adjust the path starting point: Select the path point closest to the robot's current position as the starting point of the edge-fitting path; The contour point smoothing process also includes the following steps: Obtain the curvature of the curve corresponding to the contour point sequence; multiple contour points form a contour point sequence. Transition points are inserted at the points where the curvature of the curve corresponding to the contour point sequence changes abruptly, and used as contour points. A non-uniform node vector U is dynamically generated based on the geometric changes between adjacent contour points: in, Indicate node parameters: in, Represents the weights for geometric changes: in, , These are weighting coefficients. The value is 0.5 to 1.
0. The value is 0.5 to 1.
0. Let be the local curvature of the curve corresponding to the contour point sequence. The average point spacing is the sum of the distances between two adjacent contour points divided by the number of contour points, and P is the world coordinate of the contour point. The new transition point is obtained based on the non-uniform node vector, B-Spline basis function, and transition point calculation formula: The B-Spline basis functions are: in, This indicates that when the parameter value is At time t, the function value of the i-th k-th B-Spline basis function, k=3; The new formula for calculating the transition point is: 。 2. The robot path planning method according to claim 1, characterized in that, After extracting the contour points and before smoothing them, the following steps are also included: Contour point interpolation: Inserts an intermediate point between two adjacent contour points, and uses the intermediate point as the contour point.
3. The robot path planning method according to claim 2, characterized in that, The following steps are also included in contour point interpolation: Determine if the distance between adjacent contour points is greater than the execution distance threshold. If so, insert multiple intermediate points proportionally.
4. The robot path planning method according to claim 2, characterized in that, After contour point interpolation and before contour point smoothing, the following steps are also included: Contour point sparsification: Determine whether the angle of three consecutive contour points is greater than a specified angle threshold, or whether the distance between two consecutive contour points is less than the minimum distance threshold. If so, delete the contour point in the middle.
5. The robot path planning method according to claim 1, characterized in that, Sampling interval at transition point Dynamically set based on the local curvature of the curve: in, As the baseline value, The range is 0 to 0.
1. Scaling factor This represents the local curvature of the curve corresponding to the contour point sequence.
6. The robot path planning method according to claim 1, characterized in that, It also includes the following steps: Determine two adjacent transition points Q j Q j+1 Does the rate of change of the derivative exceed the preset value of the derivative? If so, then for three consecutive transition points Q... j-1 Q j Q j+1 Perform filtering and smoothing processing.
7. The robot path planning method according to claim 1, characterized in that, Preset pixel width It can be obtained through the following formula: in, For a safe distance, This refers to the map resolution.
8. The robot path planning method according to claim 1, characterized in that, After creating the binary image and before dilation, the following steps are also included: Image processing: Set the pixel values of free grid cells in the clean area of the binary image to 255, the pixel values of obstacle grid cells to 0, and the pixel values of unknown grid cells to 0.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is run by the processor, it executes the robot path planning method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Rapid path planning method based on improved views and track optimization method based on ESDF (Extensible Software Definition Function) map
CN117075612A
Path planning method and system based on visibility graph and D*Lite algorithm
CN117419738A