Path optimization method, device, robot and computer-readable storage medium

By using the spatial grid map and key point screening and updating technology in the path optimization algorithm, the problem of poor path optimization accuracy in the existing technology is solved, and more efficient and accurate path optimization is achieved.

CN118070996BActive Publication Date: 2024-09-20SHENZHEN PUDU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410471980.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-19
Publication Date
2024-09-20
Estimated Expiration
2044-04-19

AI Technical Summary

Technical Problem

In the existing technology, the path optimization algorithm has poor accuracy when dealing with small obstacles in space, resulting in poor path optimization results.

Method used

By obtaining the path to be optimized in the spatial grid map, sampling key points, filtering the target raster based on the raster value of the candidate raster, determining the adjustment vector of the key point, updating the path, and generating the target optimization path for the robot. Path navigation.

Benefits of technology

It improves the efficiency and accuracy of the robot's perception of obstacle distance, reduces the computational burden, and enhances the accuracy and efficiency of path optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118070996B
    Figure CN118070996B
Patent Text Reader

Abstract

The present application relates to a path optimization method, device, robot and computer-readable storage medium. The method includes: obtaining a path to be optimized located in a spatial grid map, sampling the path to be optimized, and obtaining corresponding key points; the spatial grid map includes the position information of each obstacle in the space, and each grid of the spatial grid map contains a corresponding grid value, and the grid value is used to characterize the distance between the current grid and the nearest obstacle; screening the grid values ​​of the candidate grids corresponding to each key point respectively, and determining the corresponding target grid; determining the adjustment vector of the corresponding key point based on the target grid and the adjacent grids of the target grid; based on the adjustment vector corresponding to each key point, updating the position information corresponding to each key point respectively, and generating a target optimization path based on the updated key points, the target optimization path is used for the path navigation of the robot, and can improve the accuracy and optimization efficiency of path optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of robotics technology, and in particular to a path optimization method, device, robot and computer-readable storage medium. Background Art

[0002] With the development of robot technology, sensing the position information of obstacles in space and realizing efficient optimization of its own initial navigation path is of great significance to the development of robot-related businesses.

[0003] In the prior art, small obstacles in space are usually clustered into large continuous obstacles to reduce the number of obstacles, thereby achieving the purpose of reducing the calculation amount of the path optimization algorithm, but the accuracy of path optimization is poor. Summary of the invention

[0004] Based on this, it is necessary to provide a path optimization method, device, robot and computer-readable storage medium to address the above-mentioned technical problems, which can improve the accuracy and efficiency of path optimization.

[0005] In a first aspect, the present application provides a path optimization method, comprising:

[0006] Obtain the path to be optimized located in the spatial grid map, sample the path to be optimized, and obtain the corresponding key points; the spatial grid map includes the location information of each obstacle in the space, and each grid of the spatial grid map contains the corresponding grid value, which is used to represent the distance between the current grid and the nearest obstacle;

[0007] Screening is performed according to the grid value of the candidate grid corresponding to each key point to determine the corresponding target grid; the adjustment vector of the corresponding key point is determined based on the target grid and the adjacent grids of the target grid;

[0008] Based on the adjustment vector corresponding to each key point, the position information corresponding to each key point is updated respectively, and a target optimization path is generated based on the updated key points. The target optimization path is used for the path navigation of the robot.

[0009] In one embodiment, before screening the candidate grids according to the grid values ​​of each key point and determining the corresponding target grid, the method further includes:

[0010] Determine the candidate grid corresponding to each key point based on the angle information corresponding to each key point and the size information of the robot;

[0011] Each key point includes corresponding position information and angle information, and the angle information is used to characterize the angle orientation of the robot when it moves to the corresponding key point.

[0012] In one embodiment, determining a candidate grid corresponding to each key point based on angle information corresponding to each key point and size information of the robot includes:

[0013] Project the chassis outline of the robot onto the spatial grid map to obtain the corresponding outline range of the robot;

[0014] Based on the angle information corresponding to each key point, the contour range is adjusted in angle to obtain the projection area corresponding to each key point, and the grids in the projection area corresponding to each key point are taken as candidate grids of the corresponding key point.

[0015] In one embodiment, determining an adjustment vector corresponding to a key point based on a target grid and adjacent grids of the target grid includes:

[0016] Linear interpolation is performed based on the grid value of the target grid and the grid values ​​of the adjacent grids of the target grid to obtain the continuous distance function corresponding to the target grid;

[0017] Based on the continuous distance function, the adjustment vector corresponding to the key point is determined.

[0018] In one embodiment, determining an adjustment vector corresponding to a key point based on a target grid and adjacent grids of the target grid includes:

[0019] Based on the target grid and the adjacent grids of the target grid, a continuous distance function corresponding to the target grid is determined;

[0020] Obtain the maximum distance parameter corresponding to the robot, which is determined based on the size information of the robot and the spatial characteristics of the spatial grid map;

[0021] Calculate the difference feature between the maximum distance parameter and the continuous distance function, and perform proportional calculation on the difference feature and the maximum distance parameter to obtain a proportional calculation result;

[0022] The ratio calculation result is fused with the maximum distance parameter to obtain the cost function of the corresponding key point, and the derivative of the cost function corresponding to the target grid is calculated to obtain the adjustment vector of the corresponding key point.

[0023] In one embodiment, based on the adjustment vector corresponding to each key point, the position information corresponding to each key point is updated respectively, and a target optimization path is generated based on each updated key point, including:

[0024] Based on each updated key point, generate the corresponding update path and obtain the current update number corresponding to the update;

[0025] If the current update number does not reach the threshold, the update path is sampled to obtain the corresponding key points, and the step of screening the candidate grids corresponding to each key point is returned to determine the corresponding target grid;

[0026] If the current update times reaches the threshold, the updated path is used as the target optimization path.

[0027] In one embodiment, generating a target optimization path based on each updated key point includes:

[0028] Get the starting point and target point corresponding to the path to be optimized;

[0029] A smooth curve fitting is performed based on the starting point, the updated key points and the target point to generate the target optimization path.

[0030] In a second aspect, the present application also provides a path optimization device, including:

[0031] The acquisition module is used to acquire the path to be optimized located in the spatial grid map, sample the path to be optimized, and obtain the corresponding key points; the spatial grid map includes the location information of each obstacle in the space, and each grid of the spatial grid map contains the corresponding grid value, and the grid value is used to represent the distance between the current grid and the nearest obstacle;

[0032] The calculation module is used to screen the grid values ​​of the candidate grids corresponding to each key point and determine the corresponding target grid; and determine the adjustment vector of the corresponding key point based on the target grid and the adjacent grids of the target grid;

[0033] The optimization module is used to update the position information corresponding to each key point based on the adjustment vector corresponding to each key point, and generate a target optimization path based on the updated key points. The target optimization path is used for the path navigation of the robot.

[0034] In a third aspect, the present application provides a robot equipped with a depth camera and a lidar, and also includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above-mentioned path optimization method when executing the computer program.

[0035] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the processor executes the steps of the above-mentioned path optimization method.

[0036] The above-mentioned path optimization method, device, robot and computer-readable storage medium obtain the path to be optimized located in the spatial grid map, and sample the path to be optimized to obtain the corresponding key points; based on the grid value of the candidate grid corresponding to each key point in the spatial grid, the target grid is screened, so that the distance between the current robot and the nearest obstacle can be quickly and accurately determined according to the grid value of the target grid, replacing the method of using a ranging sensor to measure the distance to each obstacle in real time and then performing distance screening in the traditional method, greatly improving the robot's perception efficiency and accuracy of the obstacle distance, effectively saving the data calculation burden and improving the accuracy of distance perception, and finally calculating the adjustment vector corresponding to each key point according to the target grid corresponding to each key point, optimizing the position of each key point through the adjustment vector, and obtaining the target optimized path, thereby effectively improving the accuracy and optimization efficiency of path optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] FIG1 is a schematic diagram of a flow chart of a path optimization method in one embodiment;

[0038] FIG2 is a schematic plan view of the position of obstacles in a spatial grid map in one embodiment;

[0039] FIG3 is a schematic plan view of a candidate grid within a contour range corresponding to a robot in one embodiment;

[0040] FIG4 is a schematic plan view of a path optimization method in one embodiment;

[0041] FIG5 is a structural block diagram of a path optimization device in one embodiment;

[0042] FIG. 6 is a diagram showing the internal structure of a robot in one embodiment. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0044] The path optimization method provided in the embodiment of the present application can be implemented independently by a robot, or by interaction between a robot and a server, or by interaction between robots, etc., and is not specifically limited here.

[0045] In one embodiment, as shown in FIG1 , a path optimization method is provided, which is described by taking the method applied to a robot as an example, and includes the following steps:

[0046] Step S102, obtaining the path to be optimized located in the spatial grid map, sampling the path to be optimized, and obtaining corresponding key points.

[0047] Among them, the spatial grid map includes the location information of each obstacle in the space. Each grid of the spatial grid map contains a corresponding grid value. The grid value is used to represent the distance between the current grid and the nearest obstacle. The grid value of the grid outside the obstacle is a positive number, while the grid value of the grid inside the obstacle is a negative number. The distance between the grid and the obstacle can be a straight-line distance or a path distance under other preset rules (for example, in urban navigation, Manhattan distance can be used to reflect the actual situation that only right-angle driving can be carried out along the street; in natural terrain, Euclidean distance may be weighted according to the difficulty of the terrain and the energy required for passing; in scenarios where the number of turns needs to be minimized, the number and angle of turns may be considered in the selection of the path; and in obstacle avoidance navigation, a path that keeps a long distance from the obstacle may be preferred.); the path to be optimized may be an initial path calculated according to a commonly used path planning algorithm (such as Dijkstra algorithm, Astar algorithm, etc.), or it may be an initial path manually drawn by relevant operators, etc.

[0048] Specifically, the robot samples the path to be optimized according to a preset interval distance to obtain each key point on the path to be optimized, wherein the size of the preset interval distance can be determined according to the spatial layout characteristics of the spatial grid map (such as reduction ratio, obstacle position characteristics, etc.), and can be flexibly set by technical personnel according to the spatial layout characteristics.

[0049] Step S104, screening is performed according to the grid value of each key point corresponding to the candidate grid to determine the corresponding target grid.

[0050] Among them, the candidate grid can be the grid occupied by the robot chassis contour range when the robot is at the corresponding key point, or it can be flexibly set by the technician according to the spatial characteristics of the robot activity space / spatial grid map (for example, in an environment full of obstacles, technicians can select those grids that are far away from common obstacle paths as candidates to reduce the risk of collision. In an open and crowded public space, the setting of candidate grids may take into account the dynamic distribution of the crowd, giving priority to areas with less traffic to improve safety and efficiency. In addition, if the robot needs to move in special terrain, such as uneven ground or inclined areas, technicians can adjust the candidate grids according to these terrain characteristics to ensure stable driving of the robot. This flexibility allows the robot navigation system to better adapt to various environments and improve its applicability and efficiency.), without specific limitations here.

[0051] Specifically, for each key point, the robot obtains the candidate grid corresponding to each key point, and then screens the grid values ​​of each candidate grid, wherein the screening method can be to compare the grid values ​​of each candidate grid, and the candidate grid with the smallest grid value can be determined as the target grid, or the candidate grid corresponding to the corresponding grid value can be determined as the target grid in a manner of other preset rules (for example, when an emergency task is executed, the grid close to the obstacle but with the shortest path can be selected as the target grid to shorten the arrival time, even if this increases the difficulty of obstacle avoidance. Conversely, for low-priority tasks, a grid that is far away from the obstacle, has a longer path but is safer can be selected to save energy and reduce the risk of collision. In addition, the current energy state of the robot can also be considered. When the battery is sufficient, a more direct path may be taken, while when the battery is low, a safe path with lower energy consumption may be selected. This flexible rule setting allows robot navigation to better adapt to different environments and task requirements.).

[0052] It can be understood that the grid value of the candidate grid represents the distance between the grid and the nearest obstacle. The larger the grid value, the greater the distance between the grid and the nearest obstacle, and the smaller the grid value, the smaller the distance between the grid and the nearest obstacle. Therefore, using the candidate grid with the smallest grid value (closest distance) as the target grid for key point optimization can ensure that when the robot travels to the corresponding key point according to the optimized path, it can meet a sufficient safety distance with the obstacle, thereby effectively improving the accuracy and reliability of the optimized path.

[0053] Step S106: determining an adjustment vector of a corresponding key point based on the target grid and the grids adjacent to the target grid.

[0054] The adjacent grid of the target grid refers to at least one grid among eight grids adjacent to the target grid in the spatial grid map, and may also be one or more grids within a preset distance range corresponding to the target grid, without specific limitation.

[0055] Specifically, the robot can use the center point of the target grid and the corresponding adjacent grid (or any point inside it) as the model point corresponding to each grid, and then use the corresponding grid value as the value of the model point. Based on the position of the model point and the size of the value, it performs linear interpolation on it to obtain a continuous distance function at the target grid model point, and then determines the adjustment vector at the corresponding key point based on the continuous distance function.

[0056] Step S108, based on the adjustment vector corresponding to each key point, the position information corresponding to each key point is updated respectively, and a target optimization path is generated based on each updated key point.

[0057] Among them, the target optimization path is used for the robot's path navigation, and the adjustment vector of the key point includes the adjustment / update direction and step size of the key point; the step size refers to the distance the key point moves along the direction of its adjustment vector when adjusting or updating the position of the key point in the robot's navigation path. The setting of the step size affects the flexibility and accuracy of the path adjustment: a smaller step size means that the robot can adjust its path more finely, which is suitable for obstacle avoidance in narrow or complex environments; while a larger step size makes the robot adjust the path more quickly, which is suitable for open environments with fewer obstacles. For example, if the robot is navigating in a warehouse full of obstacles, it may need to set a smaller step size to ensure that it can carefully bypass the obstacles; when navigating in an open park, a larger step size can be set to improve the efficiency of the robot's movement from one point to another.

[0058] Specifically, the robot adjusts / updates each key point from the current position to the target position according to the direction and step size corresponding to the adjustment vector, thereby obtaining each updated key point, and generates a target optimization path based on the updated key points.

[0059] In this embodiment, the path to be optimized located in the spatial grid map is obtained, and the path to be optimized is sampled to obtain the corresponding key points; based on the grid value of the candidate grid corresponding to each key point in the spatial grid, the target grid is screened, so that the distance between the current robot and the nearest obstacle can be quickly and accurately determined according to the grid value of the target grid, instead of the traditional method of using a ranging sensor to measure the distance to each obstacle in real time and then performing distance screening, which greatly improves the robot's perception efficiency and accuracy of the obstacle distance, effectively saves the data calculation burden and improves the accuracy of distance perception, and finally calculates the adjustment vector corresponding to each key point according to the target grid corresponding to each key point, optimizes the position of each key point through the adjustment vector, and obtains the target optimized path, thereby effectively improving the accuracy and optimization efficiency of path optimization.

[0060] In one embodiment, before screening the candidate grids according to the grid values ​​of each key point and determining the corresponding target grid, the method further includes:

[0061] Each key point includes corresponding position information and angle information; the angle information is used to characterize the angle orientation of the robot when it moves to the corresponding key point.

[0062] Based on the angle information corresponding to each key point and the size information of the robot, the candidate grid corresponding to each key point is determined.

[0063] It is understandable that the chassis contour of the robot can be any shape. Therefore, when the robot moves to the corresponding key point, when the chassis contour of the robot is not a standard circle, as the robot's orientation changes, the position of the grid covered by the shadow part of its bottom contour projected on the spatial grid map is different. Therefore, the robot determines the candidate grid corresponding to the key point based on the angle information corresponding to each key point and the size information of the robot.

[0064] In this embodiment, the robot determines the grid occupied by the robot when it moves at the corresponding key point based on the angle information corresponding to each key point and the size information of the robot, and uses the occupied grid as the candidate grid corresponding to the key point. In this way, the candidate grid at the corresponding key point can be accurately determined according to the size and angle information of the robot, thereby improving the accuracy and reliability of path optimization.

[0065] In one embodiment, based on the angle information corresponding to each key point and the size information of the robot, determining the candidate grid corresponding to each key point includes:

[0066] Step S202, projecting the chassis outline of the robot on the spatial grid map to obtain the corresponding outline range of the robot. Specifically, the robot can vertically project its own chassis outline on the spatial grid map to obtain the projection range of the robot on the spatial grid map, that is, the outline range.

[0067] Step S204, adjusting the angle of the contour range based on the angle information corresponding to each key point, obtaining the projection area corresponding to each key point, and taking the grids in the projection area corresponding to each key point as candidate grids corresponding to the key point.

[0068] Specifically, the robot adjusts the contour range based on the angle information corresponding to each key point so that the contour range of the robot matches the corresponding angle information, and uses the grids in the projection area corresponding to each key point as candidate grids for the corresponding key point. Optionally, when determining the candidate grids for the corresponding key point, the existence of suspended obstacles and non-suspended obstacles in the obstacle grid map are considered separately. Specifically, when there is a suspended obstacle, the vertical projection of the suspended obstacle may fall into the inside of the contour range of the key point. At this time, in order to fully calculate the relative position information between the obstacle and the robot, all grids in the contour range of the corresponding key point (including the inside of the projection area) are used as candidate grids for the corresponding key point; if there is no suspended obstacle, only the contour range of the corresponding key point (excluding the inside of the projection area), that is, the outermost circle / outermost grid in the projection area, can be used as the candidate grid for the corresponding key point, so that the redundant grids in the contour range including the projection area can be effectively eliminated, the calculation burden can be reduced, the calculation resources can be saved, and the efficiency of determining the candidate grids can be effectively improved, thereby effectively improving the efficiency and accuracy of the target optimization path generated based on the candidate grids.

[0069] In this embodiment, the chassis contour of the robot is projected onto the spatial grid map to obtain the contour range corresponding to the robot. The angle of the contour range is adjusted based on the angle information corresponding to each key point to obtain the projection area corresponding to each key point. The grids in the projection area corresponding to each key point are used as candidate grids for the corresponding key points. Therefore, the candidate grids corresponding to each key point can be determined in a targeted manner according to the size and angle information of the robot, thereby effectively improving the reliability of the determination of the candidate grids.

[0070] In one embodiment, determining the adjustment vector of the corresponding key point based on the target grid and the adjacent grids of the target grid includes:

[0071] Step S302 , performing linear interpolation based on the grid value of the target grid and the grid values ​​of the adjacent grids of the target grid, to obtain a continuous distance function corresponding to the target grid.

[0072] Specifically, the robot performs bilinear interpolation based on the grid values ​​of the center point of the target grid and the center points of its adjacent grids and performs smooth curve fitting to obtain the corresponding continuous distance function at the target grid. Specifically, the robot interpolates and fills the intermediate values ​​based on the positions of the center point of the target grid and the center points of its adjacent grids and the corresponding grid values, so that each point has a continuously changing state value, and finally fits the continuously changing continuous distance function based on the grid values ​​corresponding to each point and the state values ​​between points. Among them, the reason for interpolation is to obtain a continuous state representation from the discrete grid map data, so that smooth and continuous changes can be obtained in the space between grids, rather than just discrete jumps. This continuous state representation provides more detailed information for robot path planning, which helps to more accurately determine the adjustment vectors of key points, thereby optimizing path planning. Bilinear interpolation can effectively provide a smoothly transitioned state value when processing two-dimensional spatial data. Bilinear interpolation can take into account the grid values ​​of the surrounding four grid points by performing linear interpolation in two directions, generating a continuous function that is closer to the actual physical world. This method provides a more accurate estimate of the intermediate value than simple linear interpolation (only in one direction or considering only two points) because it integrates more surrounding information. In addition, the continuous distance function generated by bilinear interpolation can better reflect the physical distance and obstacle layout in the real world, allowing the algorithm to calculate the adjustment direction and step size of key points based on more accurate information, ultimately achieving better path planning.

[0073] Step S304: determining an adjustment vector corresponding to the key point based on the continuous distance function.

[0074] Specifically, the robot constructs a cost function at the corresponding key point according to the continuous distance function, and determines the adjustment vector of the corresponding key point based on the derivative function of the cost function at the center point of the target grid.

[0075] In this embodiment, linear interpolation is performed based on the grid values ​​of the target grid and the grid values ​​of the adjacent grids of the target grid to obtain the continuous distance function corresponding to the target grid. Based on the continuous distance function, the adjustment vector of the corresponding key point is determined, so that the derivative function of the key point cost function can be constructed according to the grid values ​​of the target grid and its adjacent grids, and the adjustment vector at the corresponding key point can be accurately and quickly determined, thereby improving the accuracy and efficiency of path optimization.

[0076] In one embodiment, determining the adjustment vector of the corresponding key point based on the target grid and the adjacent grids of the target grid includes:

[0077] Step S402: determining a continuous distance function corresponding to the target grid based on the target grid and the adjacent grids of the target grid.

[0078] Specifically, the robot can determine the corresponding continuous distance function based on the change characteristics / rules between the grid values ​​of the target grid and the grid values ​​of the adjacent grids. Optionally, the grid values ​​of the target grid and the grid values ​​of the adjacent grids are interpolated using a bilinear interpolation method, and then fitted to obtain a continuous distance function; or the grid values ​​of the target grid and the grid values ​​of the adjacent grids are input into a trained prediction model (such as a neural network, a deep learning network, etc.) to output the corresponding continuous distance function; or the Gaussian process regression (GPR) method can be used to provide a probability model of continuous changes in grid values ​​between grids, thereby providing more accurate and reliable information for path planning. These methods provide new ways to transform from discrete grid data to more continuous and detailed spatial descriptions, which helps to improve the path planning effect of the robot.

[0079] Step S404, obtaining the maximum distance parameter corresponding to the robot.

[0080] Among them, the maximum distance parameter is determined based on the size information of the robot and the spatial characteristics of the spatial grid map. For example, the maximum distance parameter corresponding to the robot can be determined according to the layout characteristics (quantity, volume or density, etc.) of each obstacle in the spatial grid map. For example, the greater the density of obstacles, the more limited the adjustment range of the robot in space, and the corresponding adjustment step is smaller, so the maximum distance parameter value is smaller; if the obstacle density is smaller, it indicates that the idle area range / area available for robot activities in the spatial grid map is larger, and the maximum distance parameter value is larger.

[0081] Step S406, calculating the difference feature between the maximum distance parameter and the continuous distance function, and performing a proportional calculation on the difference feature and the maximum distance parameter to obtain a proportional calculation result.

[0082] The difference feature can be calculated by subtracting the maximum distance parameter from the continuous distance function, or by taking the proportional difference between the two or by one or more operations of addition, subtraction, multiplication and division. The specific method is not limited. The difference feature refers to the difference between the maximum distance parameter and the continuous distance function calculated in order to adjust the position of the key point to generate the target optimization path during the path optimization process. This difference can reflect the degree of deviation between the current position of the robot and its ideal path, and then guide the adjustment direction and step size of the key point. The maximum distance parameter is a threshold determined based on the size information of the robot and the spatial characteristics of the spatial grid map, while the continuous distance function represents the position information of the robot on the actual path in the grid map. The difference feature can be calculated in various ways, which can be a simple arithmetic difference, that is, the maximum distance parameter is directly subtracted from the value of the continuous distance function; it can also be a proportional difference, that is, the ratio between the two or the difference between their ratio and a fixed value; in addition, the difference between the two can be comprehensively considered through more complex combinations of addition, subtraction, multiplication and division. This flexibility allows the most appropriate difference feature calculation method to be selected according to specific application scenarios and optimization goals. The calculated difference feature not only helps determine the direction and size of the adjustment vector, but also serves as a feedback in the optimization process, indicating the degree of deviation between the current path and the optimal path. For example, if the difference feature is small, it may mean that the current position of the key point is close to the optimal solution and only requires a small adjustment; if the difference feature is large, a larger adjustment may be required. This approach increases the flexibility and accuracy of the path optimization algorithm, enabling it to more accurately plan paths for specific environments and task requirements.

[0083] Step S408 , the ratio calculation result is merged with the maximum distance parameter to obtain the cost function corresponding to the key point, and the derivative of the cost function corresponding to the target grid is calculated to obtain the adjustment vector corresponding to the key point.

[0084] The fusion method may be to fuse the ratio calculation result with the maximum distance parameter by performing one or a combination of operations such as addition, subtraction, multiplication and division, including weighting, square root and the like; and the cost function is a continuous function.

[0085] Specifically, the robot can fuse the ratio calculation results determined in the above steps with the maximum distance parameter to obtain the cost function of the corresponding key point, derive the derivative function corresponding to the cost function, calculate the corresponding derivative at the target grid based on the derivative function, and use the derivative as the adjustment vector of the corresponding key point.

[0086] For example, the robot can construct the cost function as shown in the following formula 1:

[0087] , formula 1

[0088] in, is the cost function, is the maximum distance parameter, is a continuous distance function.

[0089] In this embodiment, the maximum distance parameter corresponding to the robot is obtained, the difference feature between the maximum distance parameter and the continuous distance function is calculated, and the difference feature is proportionally calculated with the maximum distance parameter to obtain the proportional calculation result, which is fused with the maximum distance parameter to obtain the cost function of the corresponding key point, and the derivative of the cost function corresponding to the target grid is calculated to obtain the adjustment vector of the corresponding key point. The cost function is constructed based on the continuous distance function of the corresponding key point, and the adjustment direction and adjustment step size at the key point are quickly determined according to its derivative function, which effectively simplifies the calculation method, saves computing resources, and improves the efficiency of the robot in calculating the adjustment vector.

[0090] In one embodiment, based on the adjustment vector corresponding to each key point, the position information corresponding to each key point is updated respectively, and a target optimization path is generated based on each updated key point, including:

[0091] Step S502: Generate a corresponding update path based on each updated key point, and obtain the current update number corresponding to the update.

[0092] It can be understood that one update number means that the position information of each key point is updated once, and a corresponding update path is generated based on the updated key points.

[0093] Step S504, if the current update times do not reach the threshold, the update path is sampled to obtain the corresponding key points, and the step of screening the candidate grids corresponding to each key point is returned to determine the corresponding target grid.

[0094] The threshold value may be determined based on the motion characteristics of the robot (such as acceleration characteristics, etc.), or may be flexibly set by technical personnel based on specific business needs.

[0095] Step S506: If the current update times reaches the threshold, the updated path is used as the target optimization path.

[0096] In this embodiment, the robot compares the current update number with the threshold to determine whether the current iteration / update number reaches the maximum iteration / update number, thereby realizing multiple iterative updates in the path optimization process, thereby effectively improving the accuracy of the generated target optimization path.

[0097] In one embodiment, generating a target optimization path based on each updated key point includes:

[0098] Step S602, obtaining the starting point and the target point corresponding to the path to be optimized.

[0099] Step S604, performing smooth curve fitting based on the starting point, each updated key point and the target point to generate a target optimization path.

[0100] Among them, the target optimization path must pass through the starting point and the target point.

[0101] Specifically, the robot performs curve fitting on the starting point, each updated key point and the target point, so that the generated target optimization path passes through each key point as much as possible.

[0102] In this embodiment, by using the smooth curve fitting method to fit the starting point, updated key points and target points, the generated target optimization path can be made more consistent with the robot's motion characteristics, making the robot move more smoothly and orderly when following the target optimization path, thereby improving the reliability of the generated target optimization path.

[0103] The present application also provides an application scenario, which applies the above-mentioned path optimization method, and the method is applied to the scenario of robot path planning. Specifically, the application of the path optimization method in this application scenario is as follows:

[0104] The robot obtains a spatial grid map corresponding to the target activity space, which includes multiple obstacles. Figure 2 shows a local grid map corresponding to one of the obstacles, where the grid position occupied by the black circle is the obstacle outline, the gray circular area inside the black circle is the grid area occupied by the obstacle, and the gray area outside the black circle is the other area outside the obstacle. Each grid in the local grid map corresponds to a grid value, which is used to represent the distance between the current grid and the nearest obstacle, that is, the larger the grid value, the larger the distance between the grid and the nearest obstacle corresponding to it, and the grid value corresponding to the grid occupied by the obstacle is a negative number. The spatial grid map is composed of multiple local grid maps mentioned above.

[0105] The robot uses common path search algorithms (such as the Astar algorithm) to generate an initial path from the robot's current position to the target position in the spatial grid map. However, due to the limitations of traditional path search algorithms when generating the initial path, the generated initial path often does not meet the robot's motion constraints. For example, the motion trajectory corresponding to the initial path is not smooth enough, the distance to obstacles is close, etc., which may cause the robot to collide with obstacles due to untimely braking when navigating along the initial path.

[0106] The key points of the initial path are sampled according to the preset sampling interval to generate corresponding key points, where each key point includes coordinate information and angle information. The angle information is used to characterize the orientation of the robot when the robot drives to the corresponding key point according to the initial path. The range of the grid (candidate grid) occupied by the robot on the spatial grid map is determined according to the chassis contour of the robot, as shown in Figure 3. Figure 3 shows the local grid (candidate grid) occupied by a robot on the spatial grid map. The eight edges and the octagonal area surrounded by the eight edges are the grid positions occupied by the robot in the spatial grid map, that is, the contour range. The grid area occupied by the eight edges is the contour of the robot, and the grid area occupied by the eight edges is the grid area occupied by the robot.

[0107] Based on the position and angle information of each key point, the robot determines the candidate grid corresponding to each key point on the spatial grid map, and then determines the candidate grid with the smallest grid value from the candidate grids corresponding to each key point, and uses it as the target grid. According to the position and grid value of the target grid and its adjacent grids, bilinear interpolation is performed to obtain the continuous distance function corresponding to the target grid. , and construct the cost function at the corresponding key point based on the continuous distance function.

[0108] The robot then calculates the derivative / gradient at the target grid according to the derivative function of the cost function, thereby obtaining the adjustment vector of the corresponding key point, and updates the position of the key point based on the adjustment vector at each key point, and determines whether the current update number of the robot reaches the threshold. If not, the above process continues to update each key point until the current update number of the robot reaches the threshold, then stops updating, and generates the target optimization path based on the updated key points and the starting point and destination of the initial path, as shown in Figure 4. Figure 4 is a schematic diagram of path optimization in a spatial grid map in a certain scenario, where the circles of the starting point and the destination point represent the chassis contour of the robot, other ovals and irregular squares represent obstacles, the solid line with an arrow from the starting point to the destination point represents the initial path (path to be optimized), and the dotted line with an arrow from the starting point to the destination point represents the target optimization path. The robot obtains the initial path at the starting point, and adjusts and optimizes the initial path to obtain the target optimization path.

[0109] In this embodiment, the path to be optimized located in the spatial grid map is obtained, and the path to be optimized is sampled to obtain the corresponding key points; based on the grid value of the candidate grid corresponding to each key point in the spatial grid, the target grid is screened, so that the distance between the current robot and the nearest obstacle can be quickly and accurately determined according to the grid value of the target grid, instead of the traditional method of using a ranging sensor to measure the distance to each obstacle in real time and then performing distance screening, which greatly improves the robot's perception efficiency and accuracy of the obstacle distance, effectively saves the data calculation burden and improves the accuracy of distance perception, and finally calculates the adjustment vector corresponding to each key point according to the target grid corresponding to each key point, optimizes the position of each key point through the adjustment vector, and obtains the target optimized path, thereby effectively improving the accuracy and optimization efficiency of path optimization.

[0110] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0111] In one embodiment, as shown in FIG. 5 , a path optimization device is provided. The device may adopt a software module or a hardware module, or a combination of the two to become a part of a computer device. The device specifically includes: an acquisition module 502, a calculation module 504, and an optimization module 506, wherein:

[0112] The acquisition module 502 is used to acquire the path to be optimized located in the spatial grid map, sample the path to be optimized, and obtain the corresponding key points; the spatial grid map includes the position information of each obstacle in the space, and each grid of the spatial grid map contains a corresponding grid value, and the grid value is used to represent the distance between the current grid and the nearest obstacle;

[0113] The calculation module 504 is used to screen the grid values ​​of the candidate grids corresponding to each key point to determine the corresponding target grid; and determine the adjustment vector of the corresponding key point based on the target grid and the adjacent grids of the target grid;

[0114] The optimization module 506 is used to update the position information corresponding to each key point based on the adjustment vector corresponding to each key point, and generate a target optimization path based on the updated key points. The target optimization path is used for the path navigation of the robot.

[0115] In one embodiment, the calculation module 504 is also used to determine the candidate grid corresponding to each key point based on the angle information corresponding to each key point and the size information of the robot; wherein each key point includes corresponding position information and angle information, and the angle information is used to characterize the angle orientation of the robot moving to the corresponding key point.

[0116] In one embodiment, the computing module 504 is also used to project the chassis contour of the robot onto the spatial grid map to obtain the contour range corresponding to the robot; based on the angle information corresponding to each key point, the contour range is adjusted to obtain the projection area corresponding to each key point, and the grids within the projection area corresponding to each key point are used as candidate grids for the corresponding key points.

[0117] In one embodiment, the calculation module 504 is further used to perform linear interpolation based on the grid value of the target grid and the grid values ​​of the adjacent grids of the target grid to obtain the corresponding continuous distance function at the target grid; based on the continuous distance function, determine the adjustment vector of the corresponding key point.

[0118] In one embodiment, the calculation module 504 is also used to determine the continuous distance function corresponding to the target grid based on the target grid and the adjacent grids of the target grid; obtain the maximum distance parameter corresponding to the robot, the maximum distance parameter is determined based on the size information of the robot and the spatial characteristics of the spatial grid map; calculate the difference characteristics between the maximum distance parameter and the continuous distance function, and perform proportional calculation on the difference characteristics and the maximum distance parameter to obtain the proportional calculation result; fuse the proportional calculation result with the maximum distance parameter to obtain the cost function of the corresponding key point, and calculate the derivative of the cost function corresponding to the target grid to obtain the adjustment vector of the corresponding key point.

[0119] In one embodiment, the optimization module 506 is also used to generate a corresponding update path based on each updated key point, and obtain the current update number corresponding to the update; if the current update number does not reach the threshold, the update path is sampled to obtain the corresponding key points, and the grid values ​​of the candidate grids corresponding to each key point are returned to screen and determine the corresponding target grid; if the current update number reaches the threshold, the update path is used as the target optimization path.

[0120] In one embodiment, the optimization module 506 is further used to obtain the starting point and the target point corresponding to the path to be optimized; perform smooth curve fitting based on the starting point, each updated key point and the target point to generate a target optimized path.

[0121] The above-mentioned path optimization device obtains the path to be optimized located in the spatial grid map, and samples the path to be optimized to obtain the corresponding key points; based on the grid value of the candidate grid corresponding to each key point in the spatial grid, the target grid is screened, so that the distance between the current robot and the nearest obstacle can be quickly and accurately determined according to the grid value of the target grid, replacing the traditional method of using a ranging sensor to measure the distance to each obstacle in real time and then performing distance screening, which greatly improves the robot's perception efficiency and accuracy of the obstacle distance, effectively saves the data calculation burden and improves the accuracy of distance perception, and finally calculates the adjustment vector corresponding to each key point according to the target grid corresponding to each key point, optimizes the position of each key point through the adjustment vector, and obtains the target optimized path, thereby effectively improving the accuracy and optimization efficiency of path optimization.

[0122] For the specific definition of the path optimization device, please refer to the definition of the path optimization method above, which will not be repeated here. Each module in the above-mentioned path optimization device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0123] In one embodiment, a robot is provided, which can be a terminal, and its internal structure diagram can be shown in FIG6. The robot includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the robot is used to provide computing and control capabilities. The memory of the robot includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the robot is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a path optimization method is implemented. The display screen of the robot can be a liquid crystal display screen or an electronic ink display screen, and the input device of the robot can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the robot shell, or an external keyboard, touchpad or mouse, etc.

[0124] Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the robot to which the scheme of the present application is applied. A specific robot may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0125] In one embodiment, a robot is provided. The robot is provided with a depth camera and a laser radar, and also includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps in the above-mentioned method embodiments are implemented.

[0126] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0127] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a robot reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the robot performs the steps in the above-mentioned method embodiments.

[0128] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0129] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0130] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A path optimization method, characterized in that: The method comprises: Acquire a path to be optimized located in a spatial grid map, sample the path to be optimized, and obtain corresponding key points; the spatial grid map includes position information of obstacles in space, each grid of the spatial grid map includes a corresponding grid value, and the grid value is used to represent the distance between the current grid and the nearest obstacle, and the path to be optimized includes an initial path calculated according to a common path planning algorithm; Based on the angle information corresponding to each key point and the size information of the robot, determine the candidate grid corresponding to each key point; wherein each key point includes corresponding position information and angle information, and the angle information is used to characterize the angle orientation of the robot moving to the corresponding key point; According to the grid value of the candidate grid corresponding to each key point, the corresponding target grid is determined, and the screening method includes comparing the grid values ​​of each candidate grid and determining the candidate grid with the smallest grid value as the target grid; Determining the adjustment vector of the corresponding key point based on the target grid and the adjacent grids of the target grid, including: performing linear interpolation based on the grid value of the target grid and the grid value of the adjacent grid of the target grid to obtain the continuous distance function corresponding to the target grid; determining the adjustment vector of the corresponding key point based on the continuous distance function, including: constructing a cost function at the corresponding key point according to the continuous distance function, and determining the adjustment vector of the corresponding key point based on the derivative function of the cost function at the center point of the target grid; Based on the adjustment vector corresponding to each key point, the position information corresponding to each key point is updated respectively, and a target optimization path is generated based on each updated key point, and the target optimization path is used for path navigation of the robot.

2. The method according to claim 1, characterized in that: When determining the candidate grids corresponding to the key points, the cases where there are suspended obstacles and non-suspended obstacles in the obstacle grid map are performed separately.

3. The method according to claim 1, characterized in that The determining of the candidate grid corresponding to each key point based on the angle information corresponding to each key point and the size information of the robot includes: Projecting the chassis outline of the robot onto the spatial grid map to obtain the outline range corresponding to the robot; Based on the angle information corresponding to each key point, the contour range is angle-adjusted to obtain the projection area corresponding to each key point, and the grids in the projection area corresponding to each key point are used as candidate grids corresponding to the key point.

4. The method according to claim 1, characterized in that: The method performs linear interpolation based on the grid values ​​of the target grid and the grid values ​​of the adjacent grids of the target grid to obtain the continuous distance function corresponding to the target grid, including: performing bilinear interpolation based on the grid values ​​of the center point of the target grid and the center point of its adjacent grids and performing smooth curve fitting to obtain the continuous distance function corresponding to the target grid.

5. The method according to claim 1, characterized in that The step of determining the adjustment vector of the corresponding key point based on the target grid and the adjacent grids of the target grid includes: Determine a continuous distance function corresponding to the target grid based on the target grid and adjacent grids of the target grid; obtain a maximum distance parameter corresponding to the robot, wherein the maximum distance parameter is determined based on size information of the robot and spatial features of the spatial grid map; Calculating a difference feature between the maximum distance parameter and the continuous distance function, and performing a proportional calculation on the difference feature and the maximum distance parameter to obtain a proportional calculation result; The ratio calculation result is merged with the maximum distance parameter to obtain a cost function corresponding to the key point, and the derivative of the cost function corresponding to the target grid is calculated to obtain an adjustment vector corresponding to the key point.

6. The method according to claim 1, characterized in that The updating of the position information corresponding to each key point based on the adjustment vector corresponding to each key point, and generating a target optimization path based on each updated key point, includes: Based on each updated key point, a corresponding update path is generated, and a current update number corresponding to the update is obtained; If the current update number does not reach the threshold, the update path is sampled to obtain the corresponding key points, and the step of screening the candidate grids corresponding to each key point is returned to determine the corresponding target grid; If the current update times reaches the threshold, the updated path is used as the target optimization path.

7. The method according to claim 1, characterized in that The generating of the target optimization path based on each updated key point includes: Obtaining a starting point and a target point corresponding to the path to be optimized; A smooth curve fitting is performed based on the starting point, the updated key points and the target point to generate a target optimization path.

8. A path optimization device, characterized in that: The device comprises: An acquisition module is used to acquire a path to be optimized located in a spatial grid map, sample the path to be optimized, and obtain corresponding key points; the spatial grid map includes position information of obstacles in space, each grid of the spatial grid map includes a corresponding grid value, and the grid value is used to represent the distance between the current grid and the nearest obstacle, and the path to be optimized includes an initial path calculated according to a common path planning algorithm; A calculation module is used to determine the candidate grid corresponding to each key point based on the angle information corresponding to each key point and the size information of the robot; wherein each key point includes corresponding position information and angle information, and the angle information is used to characterize the angle orientation of the robot moving to the corresponding key point; the candidate grids corresponding to each key point are screened according to their grid values, and the corresponding target grid is determined in a screening manner including comparing the grid values ​​of each candidate grid and determining the candidate grid with the smallest grid value as the target grid; the adjustment vector of the corresponding key point is determined based on the target grid and the adjacent grids of the target grid, including: linear interpolation is performed based on the grid value of the target grid and the grid value of the adjacent grids of the target grid to obtain the continuous distance function corresponding to the target grid; based on the continuous distance function, the adjustment vector of the corresponding key point is determined, including: a cost function at the corresponding key point is constructed according to the continuous distance function, and the adjustment vector of the corresponding key point is determined based on the derivative function of the cost function at the center point of the target grid; The optimization module is used to update the position information corresponding to each key point based on the adjustment vector corresponding to each key point, and generate a target optimization path based on the updated key points, wherein the target optimization path is used for the path navigation of the robot.

9. A robot, provided with a depth camera and a laser radar, further comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.