Path optimization method and device and readable storage medium
By combining static and dynamic maps to adjust the robot path, the collision risk caused by environmental changes and positioning deviations in the existing technology is solved, and safer and more efficient path planning is achieved, which is especially suitable for complex environments such as restaurants and other scenes.
Patent Information
- Application Number
- CN202410615432.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-08-30
AI Technical Summary
Existing robot path planning methods can easily cause the robot to get too close to obstacles when the environment changes or positioning deviations occur, increasing the risk of collision, especially in complex environments such as restaurants, affecting safety.
By combining static maps and dynamic maps, the obstacle distance grid map is expanded, the offset parameter value is determined, the initial planning path is adjusted, and the target planning path is generated to ensure that the path is more consistent with the real-time environment, reduce the impact of positioning deviation, and avoid collisions.
It effectively reduces the possibility of collision between robots and obstacles, improves operational safety and path centering in complex environments, and improves the safety and efficiency of path planning.
Smart Images

Figure CN118565503A
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of robot path planning, and in particular, relates to a path optimization method, device and readable storage medium. Background Art
[0002] In modern industry and service sectors, the widespread application of robotics has become a key factor in improving efficiency and reducing costs. However, there is a common challenge in many robot application scenarios, that is, when planning paths and moving within the work area, it is necessary to ensure that the robot can effectively avoid obstacles.
[0003] However, when the environment changes or the robot positioning deviation is large, especially in complex environments such as restaurants, the path planned by the currently available robot path planning methods is often too close to obstacles, causing the robot to easily collide when moving along the path, making it impossible for the robot to safely reach its destination. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a path optimization method, device and readable storage medium, which can optimize the path of the robot and reduce the possibility of collision of the robot, thereby improving the safety of the robot operation, especially in complex environments.
[0005] A first aspect of an embodiment of the present application provides a path optimization method, including: determining a dynamic map of an area where a robot is currently located.
[0006] The obstacles in the dynamic map are expanded to obtain an obstacle distance grid map; a grid in the obstacle distance grid map records the distance between the grid and its nearest obstacle.
[0007] The offset parameter value is determined according to the initial planned path and the obstacle distance grid map, and the initial planned path is obtained according to the static map and the dynamic map.
[0008] The initial planned path is adjusted according to the offset parameter value to obtain the target planned path.
[0009] In a first possible implementation manner of the first aspect, determining an offset parameter value according to an initial planned path and an obstacle distance grid map includes:
[0010] A gradient grid map is obtained based on the obstacle distance grid map, and grids in the gradient grid map have corresponding distance cost values.
[0011] The offset parameter value is determined according to the initial planning path and the gradient grid map; wherein the initial planning path is composed of multiple initial position nodes, the target planning path is composed of multiple target position nodes, and each initial position node in the initial planning path is converted into a corresponding target position node on the target planning path after being offset; the offset parameter value is a specific quantitative value of the offset parameter, and the offset parameter is used to indicate the offset of each initial position node in the initial planning path.
[0012] In a second possible implementation manner of the first aspect, determining a dynamic map of a current area includes:
[0013] When the traveling channel is detected as a target channel, a dynamic map of the current area is determined; wherein the difference between the width of the target channel and the width of the robot is within a preset threshold range.
[0014] In a third possible implementation manner of the first aspect, determining the offset parameter value according to the initial planned path and the gradient grid map includes:
[0015] The objective function is constructed with the goal of minimizing the sum of the distance cost values of the target position nodes corresponding to the target planning path after the initial position nodes in the initial planning path are offset.
[0016] According to the objective function, the offset parameter value is determined.
[0017] In a fourth possible implementation manner of the first aspect, determining the offset parameter value according to the objective function includes:
[0018] The objective function is solved multiple times until the preset stop condition is met to determine the offset parameter value.
[0019] The preset stop condition includes: the number of times the objective function is solved reaches a preset number of iterations or the gradient of the objective function is within a preset gradient range.
[0020] In a fifth possible implementation manner of the first aspect, obtaining a gradient grid map based on the obstacle distance grid map includes:
[0021] The distances between the grids in the obstacle distance grid map and their nearest obstacles are respectively mapped into preset value ranges according to preset mapping relationships to obtain a gradient grid map; the preset mapping relationship is a nonlinear mapping relationship.
[0022] In a sixth possible implementation manner of the first aspect, the path optimization method is executed by the robot according to a preset execution cycle, and the preset execution cycle is used to instruct the robot to periodically execute the path optimization method according to a preset time interval.
[0023] In the path optimization method provided in the embodiment of the present application, the initial planned path is obtained by combining the static map and the dynamic map, so that the initial planned path takes into account both the static environment and the real-time environment, and the map features such as obstacles and non-traffic areas are considered more comprehensively. The initial planned path is then adjusted according to the dynamic map to obtain the target planned path, so that the target planned path is more in line with the real-time environment, reducing the impact of positioning deviations, and effectively reducing the possibility of robot collisions.
[0024] A second aspect of an embodiment of the present application provides a path optimization device, including:
[0025] The first processing module is used to determine a dynamic map of the area where the robot is currently located.
[0026] The second processing module is used to perform expansion processing on the obstacles in the dynamic map to obtain an obstacle distance grid map; the grid in the obstacle distance grid map records the distance between the grid and its nearest obstacle.
[0027] The third processing module is used to determine the offset parameter value according to the initial planned path and the obstacle distance grid map, and the initial planned path is obtained according to the static map and the dynamic map of the robot.
[0028] The fourth processing module is used to adjust the initial planned path according to the offset parameter value to obtain the target planned path.
[0029] A third aspect of an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the electronic device implements the steps of the path optimization method described in any one of the first aspects above.
[0030] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, comprising: a computer program stored therein, wherein when the computer program is executed by a processor, the electronic device implements the steps of the path optimization method as described in any one of the first aspects above.
[0031] A fifth aspect of an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the path optimization method described in any one of the first aspects above.
[0032] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1A This is a schematic diagram of a path planned according to an optional method in a narrow passage scenario provided by an embodiment of the present application;
[0035] Figure 1B is a schematic diagram of a target planning path and an initial planning path provided in an embodiment of the present application;
[0036] Figure 1C This is a schematic diagram of an application scenario of a path optimization method provided by an embodiment of the present application;
[0037] Figure 2 It is a flowchart of a path optimization method provided by an embodiment of the present application;
[0038] Figure 3 is a schematic diagram of a process for determining an offset parameter value provided by an embodiment of the present application;
[0039] Figure 4 is a schematic diagram of the structure of a path optimization device provided in an embodiment of the present application;
[0040] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0042] The path optimization method provided in the embodiment of the present application can be applied to various robots such as service robots and industrial robots. In this case, the robot is the executor of the path optimization method provided in the embodiment of the present application. The embodiment of the present application is particularly suitable for service robots, such as delivery robots, especially delivery robots in restaurant environments, which often carry dishes for delivery in scenes with changeable environments (large differences in channel widths, high mobility of personnel, and frequent changes of items), and have higher requirements for the stability and safety of delivery.
[0043] With the continuous advancement of technology and the reduction of costs, robots are more widely integrated into all aspects of human production and life. Path planning is one of the main research areas of robotics. Robot path planning refers to planning a path for the robot to travel between the starting position and the target position, so that the robot can effectively avoid obstacles and reach the target position. When the environment changes, the path planned by the currently available robot path planning methods is often too close to obstacles.
[0044] When planning the robot path, an optional method is to first establish a static map and a dynamic map of the robot's current working area, and then combine the static map and the dynamic map to plan a path that can safely reach the target location. Among them, the static map refers to a map that reflects the fixed features in the environment, and these features will basically not change for a long time. Exemplarily, in the mapping stage before the robot officially works, it can traverse the entire working environment, and establish an original map as a static map based on sensors such as laser radar, stereo vision, etc., or obtain a static map used by the robot when working based on the user's modification on the original map. The static map provides basic structural information of the environment, including real fixed obstacles and virtual obstacles. For example, the static map can include real walls, tables and chairs, ornaments, and virtual walls. Among them, the virtual wall is a virtual obstacle set by software or system. The role of the virtual wall is similar to that of a real wall, which is used to block the robot's path and affect its navigation and movement. When generating a static map, the virtual wall and the environmental information obtained by the sensor carried by the robot can be combined to generate a static map. The dynamic map refers to a map that reflects the actual environmental information and is updated in real time or according to a preset period. For example, a dynamic map can include temporary obstacles, moving personnel, real walls, tables and chairs, etc. When generating a dynamic map, the sensors carried by the robot (for example, lidar, camera, ultrasonic sensor, infrared sensor, inertial measurement unit, etc.) can obtain environmental information in real time or according to a preset period, and then generate a dynamic map based on this environmental information. It can be seen that there will be certain differences in the environmental information displayed in the static map and the dynamic map, so the positions that the robot needs to avoid shown on the static map will also be different from the positions that the robot needs to avoid shown on the dynamic map. In some solutions, only dynamic maps are considered for path planning, but sensor detection will have blind spots and errors. In order to improve the safety of robot operation, dynamic maps can be combined with static maps for path planning.
[0045] In some scenarios where space is limited (such as narrow passages), this optional method can combine static maps and dynamic maps to plan a path. Figure 1A, is a schematic diagram of a path planned according to the optional method in a narrow passage scenario. In the schematic diagram, the planned path L is marked 1 , the areas i and i' that the robot needs to avoid are shown in the static map on both sides of the narrow passage. For example, i and i' can be virtual walls, obstacles, physical walls, etc. in the static map, and the areas ii and ii' that the robot needs to avoid are shown in the dynamic map on both sides of the narrow passage. For example, ii and ii' can be physical walls, obstacles existing in the environment in real time, etc. When planning a path through this optional method, the static map and the dynamic map are combined at the same time. As can be seen from the figure, the path L planned by this optional method 1 The distance and path L between i 1 The distance between ii' is the same as that between ii', that is, path L 1 It is between i and ii'. For the same side of the robot, i is farther from the robot than ii, and i' is closer to the robot than ii'. Especially in narrow passages, the passage itself is narrow, and the planned path makes it easier for the robot to collide.
[0046] By the above Figure 1A From the relevant description of the illustrated embodiment, it can be seen that although a path can be planned by combining a static map and a dynamic map at the same time, and although static obstacles are taken into account, the path planned by this method is often too close to obstacles on one side of the actual road, such as closer to ii, making it easy for the robot to collide with the close side, such as side ii, when moving along the path, reducing the safety of the robot, especially in narrow passages and complex environments, which has a greater impact on the safety of the robot's operation.
[0047] In order to better maintain the centering of the path when the robot moves in a limited space, reduce the possibility of collision of the robot, and thus improve the safety of the robot, a path optimization method is provided in an embodiment of the present application. Figure 1B , Figure 1B The scene and Figure 1A The scene is the same scene. Figure 1B As a schematic diagram of a target planning path and an initial planning path, the target planning path L is shown. 2 and the initial planning path L 1 The target planning path is obtained by optimizing the initial planning path using the path optimization method provided in the embodiment of the present application.
[0048] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.
[0049] Figure 2A flow chart of an implementation of a path optimization method provided in Embodiment 1 of the present application is shown. The path optimization method is applied to a robot and is described in detail as follows:
[0050] S201, determining a dynamic map of the area where the robot is currently located.
[0051] In a scenario where path optimization is required, a dynamic map of the area where the robot is currently located is first determined. Dynamic map. A dynamic map refers to a map that reflects actual environmental information and is updated in real time or according to a preset period. In an embodiment of the present application, the dynamic map may be a grid map.
[0052] As an optional embodiment of the present application, in the scenario where the passage that the robot needs to travel is relatively narrow or other space limits, the path optimization method can be used to obtain a more reasonable target planning path, greatly improving the operation safety of the robot in a narrow environment. The scenario where the passage that the robot needs to travel is relatively narrow includes that the robot needs to travel in the target passage. Exemplarily, the target passage may include a dynamic narrow passage and a static narrow passage. The static narrow passage is a narrow passage corresponding to a static map, and the dynamic narrow passage is a narrow passage corresponding to a dynamic map. A static narrow passage refers to a passage in which the distance between the areas that the robot needs to avoid on both sides of the passage in the static map (called the static width, denoted as s) is within a preset threshold range; a dynamic narrow passage refers to a passage in which the distance between the areas that the robot needs to avoid on both sides of the passage in the dynamic map (called the dynamic width, denoted as d) is within a preset threshold range. At this time, the above step S201 can be replaced by: S201′, when the traveling passage is detected as the target passage, a dynamic map of the current area is determined; wherein the difference between the width of the target passage and the width of the robot is within a preset threshold range. Among them, the specific preset threshold range can be set by the technician according to the actual situation, and is not limited here. For example, the preset threshold range can be set to "robot width + 5 cm ~ robot width + 10 cm". Figure 1C .exist Figure 1C In the example, the distance s between i and i' is within the preset threshold range, which meets the condition of a static narrow channel. The distance d between ii and ii' is within the preset threshold range, which meets the condition of a dynamic narrow channel. Optionally, the target channel is determined to be both a dynamic narrow channel and a static narrow channel, thereby reducing the calculation load of route optimization during the robot navigation movement.
[0053] As another optional embodiment of the present application, the path optimization method provided by the present application is applicable in scenarios where the space in the area where the robot is located is limited. Therefore, in scenarios where the channel that the robot needs to travel is relatively wide and not narrow, the path optimization method provided by the present application can also be used to obtain the target planning path, thereby reducing the possibility of the robot colliding. At this time, it is not necessary to determine the dynamic map of the area where the robot is currently located only when it is detected that the robot's travel channel is the target channel. The following embodiments of the present application are all described by taking the path planning method as an example in scenarios where the channel that the robot needs to travel is relatively narrow, so as to better achieve a balance between the robot's computing load and safety.
[0054] It is understandable that for some scenarios where the robot's travel area is relatively limited, it will be more difficult for the robot to move to the target position without collision. At this time, since the dynamic map is a map that reflects the actual environment information and is updated in real time or according to a preset period, it displays physical obstacles. The static map is a pre-built map that displays areas that the robot needs to avoid, such as virtual walls, fixed obstacles, etc., but virtual walls are only virtual obstacles, and fixed obstacles may also change, and they are not physical obstacles that are currently determined to exist. Therefore, if you want to plan a path that allows the robot to avoid obstacles more effectively in a scenario with limited space, when considering the obstacles in the area where the robot is located, you can consider more of the physical obstacles displayed in the dynamic map.
[0055] S202, dilating the obstacles in the dynamic map to obtain an obstacle distance grid map; the grid in the obstacle distance grid map records the distance between the grid and its nearest obstacle.
[0056] After obtaining the dynamic map of the current area, the robot performs expansion processing on the obstacles in the dynamic map to obtain an obstacle distance grid map. The grid in the obstacle distance grid map records the distance between the grid and its nearest obstacle. Since the dynamic map in the embodiment of the present application is in the form of a grid map, the obstacles in the dynamic map can be expanded.
[0057] In a possible embodiment, when the obstacles in the dynamic map are expanded to obtain the obstacle distance grid map, all grids occupied by obstacles on the dynamic map can be determined first; then, the grids occupied by each obstacle are expanded according to the distance to the surrounding grids, and each grid on the dynamic map records the distance between the grid and the grid occupied by the nearest obstacle, so that the obstacle distance grid map can be obtained. Exemplarily, the Euclidean distance method can be used to calculate the distance. It should be noted that when the obstacles in the dynamic map are expanded, there will be grids occupied by different obstacles as the center, and the expansion process will be performed. At this time, the grids that were originally adjacent to the obstacle but not occupied may become grids occupied by the obstacle after the expansion process. After the expansion process, for the grids that are still not occupied by obstacles, there may be multiple obstacle grids around them. At this time, the distance between them and the nearest obstacle grid is recorded as the distance between them and the nearest obstacle.
[0058] Optionally, when the obstacles in the dynamic map are expanded to obtain an obstacle distance grid map, for the obstacle distance grid map, each grid in the obstacle distance grid map may record the distance between the grid and its nearest obstacle. Correspondingly, when the obstacles in the dynamic map are expanded, all obstacles in the dynamic map may be expanded. In order to reduce the consumption of time and memory, when the obstacles in the dynamic map are expanded to obtain an obstacle distance grid map, for the obstacle distance grid map, each grid in the target area of the obstacle distance grid map may record the distance between each grid and its nearest obstacle. The target area includes at least the area where the channel that the robot needs to travel is located. Correspondingly, when the obstacles in the dynamic map are expanded, only the obstacles in the target area on the dynamic map may be expanded.
[0059] Optionally, the dilation process is exponential dilation. As the distance to the obstacle increases, the grid cost value decreases.
[0060] S203, determining an offset parameter value according to an initial planned path and an obstacle distance grid map, wherein the initial planned path is obtained according to a static map and a dynamic map.
[0061] The robot can determine the offset parameter value according to the initial planning path and the obstacle grid map, and the initial planning path is obtained according to the static map and the dynamic map. The robot stores the initial planning path, which can be the path generated by the robot according to the previously optional method, that is, according to the static map and the dynamic map of the current area of the robot. For example, the passage boundaries (including obstacles, virtual walls, physical walls, etc.) in the static map and the dynamic map are considered at the same time, and the passage boundaries closest to the robot on both sides are generated in the center. Among them, the initial planning path is composed of multiple initial position nodes, and the target planning path is composed of multiple target position nodes. Each initial position node in the initial planning path is converted to a corresponding target position node on the target planning path after being offset. The offset parameter is used to indicate the offset of each initial position node in the initial planning path. Among them, the target position node can be represented by a coordinate point. The offset parameter value is the specific quantitative value of the offset parameter. Optionally, the offset parameter may include a translation parameter and a rotation parameter. Each initial position node in the initial planning path is converted to a corresponding target position node on the target planning path after being translated and rotated. When the offset parameter includes a translation parameter and a rotation parameter, the offset parameter value includes the translation parameter value and the rotation parameter value. By determining the translation parameter and the rotation parameter, the initial planning path can be quickly and accurately converted into the target planning path.
[0062] As an optional embodiment of the present application, a gradient grid map can be obtained based on an obstacle grid map, wherein the grids in the grid gradient map have corresponding distance cost values. Then, the offset parameter value is determined based on the initial planned path and the gradient grid map. Among them, the grid gradient map can be understood as a grid map with cost information. The distribution of cost information of the environment around the robot can be understood through the gradient grid map, thereby facilitating the robot to more accurately determine a better target planning path.
[0063] In a specific embodiment, a gradient grid map can be obtained by mapping the distance between each grid in the obstacle distance grid map and its nearest obstacle to a preset numerical range according to a preset mapping relationship. The preset mapping relationship is a nonlinear mapping relationship. The preset numerical range can be set by a technician according to actual conditions and is not limited here. For example, the preset numerical range can be a range of [0, 1]. It should be noted that the greater the distance between the grid in the obstacle distance grid map and its nearest obstacle, the smaller the distance cost value. Exemplarily, the nonlinear mapping can be to square the distance cost value and then map it to a preset numerical range, so that the cost value of the grid close to the obstacle is significantly greater than the grid far from the obstacle, so that the target planning path is further away from the obstacles on the dynamic map, thereby improving safety.
[0064] Optionally, when a gradient grid map is obtained based on an obstacle grid map, for a grid gradient map, each grid in the grid gradient map may have a corresponding distance cost value. Correspondingly, when a gradient grid map is obtained based on an obstacle grid map, the distance between each grid in the obstacle distance grid map and its nearest obstacle may be mapped to a preset numerical range according to a preset mapping relationship to obtain the gradient grid map. When a gradient grid map is obtained based on an obstacle grid map, for a grid gradient map, each grid in a target area in the grid gradient map may have a corresponding distance cost value. The target area includes at least: the area where the channel through which the robot needs to travel is located. Correspondingly, when a gradient grid map is obtained based on an obstacle grid map, the distance between each grid in the target area on the obstacle distance grid map and its nearest obstacle may be mapped to a preset numerical range according to a preset mapping relationship to obtain a gradient grid map.
[0065] As another optional embodiment of the present application, reference may be made to Figure 3 , Figure 3 A schematic diagram of a process for determining an offset parameter value is shown, which is described in detail as follows:
[0066] S301, constructing an objective function with the goal of minimizing the sum of distance cost values of target position nodes corresponding to the target planning path after the initial position nodes in the initial planning path are offset.
[0067] Each initial position node in the initial planning path can be converted into each corresponding target position node on the target planning path after being offset according to the offset parameter. 1 ,y 1 ), P2(x 2 ,y 2 ) and P3(x 3 ,y 3 ), then these nodes can be converted into the target position node P1′(x 1 ',y 1 '), P2′(x 2 ',y 2 ') and P3′(x 3 ',y 3'). Wherein the target position node P1′ corresponds to the initial position node P1; the target position node P2′ corresponds to the initial position node P2; the target position node P3′ corresponds to the initial position node P3. Therefore, the objective function can be constructed with the goal of minimizing the sum of the distance cost values of the target position nodes corresponding to the target planning path after the initial position nodes in the initial planning path are offset. The objective function not only defines the optimization goal, but also provides a direction for finding the optimal solution. During the optimization process, the variables are continuously adjusted to approach the optimal solution. This process is essentially a continuous improvement of the objective function value. Among them, the parameters in the objective function include offset parameters, and the offset parameters are variables whose specific values need to be continuously adjusted during the optimization process.
[0068] S302: Determine an offset parameter value according to the objective function.
[0069] Constructing the objective function according to the position node offset to determine the offset parameter value can efficiently determine the offset parameter value and reduce the computing load of the robot.
[0070] After the objective function is obtained, the offset parameter value is determined according to the objective function. In some embodiments, a possible implementation of S302 includes the following steps, which are described in detail as follows:
[0071] S3021, initializing the values of the offset parameters in the objective function, where the offset parameters include translation parameters and rotation parameters.
[0072] After constructing the objective function, the values of the offset parameters in the objective function may be initialized. The offset parameters may include translation parameters and rotation parameters.
[0073] S3022, calculate the gradient of the objective function relative to the value of the current offset parameter.
[0074] Then calculate the gradient of the objective function relative to the current offset parameter value. Optionally, the gradient can be obtained by using a numerical gradient method or an analytical gradient method.
[0075] S3023: Update the value of the current offset parameter according to the gradient of the objective function relative to the value of the current offset parameter.
[0076] After the gradient of the objective function relative to the current offset parameter value is obtained, the value of the current offset parameter is updated according to the gradient of the objective function relative to the current offset parameter value (hereinafter referred to as the current gradient).
[0077] In one possible embodiment, the value of the current offset parameter can be updated based on the value of the current offset parameter, the current gradient and the learning rate. Among them, the learning rate is used to control the step size of the parameter update in the objective function, which determines whether the objective function can converge to the ideal value and when it converges to the ideal value. Too large a learning rate may cause the convergence process to be unstable, while too small a learning rate may cause the objective function to converge too slowly. A suitable learning rate can enable the objective function to converge to the ideal value within an appropriate time. The specific learning rate can be set according to the actual situation and is not limited here.
[0078] In a specific embodiment, the value of the current offset parameter may be updated by the following formula:
[0079] Updated offset parameter value = (current offset parameter value - learning rate) × current gradient
[0080] It can be understood that after the current offset parameter value is updated, the offset parameter value becomes the updated offset parameter value.
[0081] S3024, repeating steps S3022 and S3023 to iteratively solve the objective function for multiple times until a preset stop condition is met, and determining that the value of the offset parameter at this time is the final offset parameter value.
[0082] In order to determine a better offset parameter so that the target planning path determined according to the offset parameter is more effective, steps S3022 and S3023 need to be repeated until the preset stop condition is met, and the value of the offset parameter at this time is determined to be the final offset parameter value.
[0083] In an optional embodiment, when determining the offset parameter value according to the objective function, it can be achieved by iteratively solving the objective function until a preset stop condition is met. Wherein, the preset stop condition includes: the number of times the objective function is solved reaches a preset number of iterations or the gradient of the objective function is within a preset gradient range. It should be noted that the specific preset number of iterations and the preset gradient range can be set by the technician according to the actual situation and are not limited here. By iteratively solving the objective function until the preset stop condition is met, determining that the value of the offset parameter at this time is the final offset parameter value, a better offset parameter value can be determined. Moreover, by adjusting the preset stop condition, different optimization requirements for the offset parameter value can be met. In addition, setting the preset stop condition when iteratively solving the objective function can avoid unnecessary calculations when determining the offset parameter value that meets the requirements, thereby reducing the computing load of the robot.
[0084] Considering that within a certain range of iterations, as the number of iterations of solving the objective function increases, the solution of the objective function will gradually approach the optimal solution. When the number of times the objective function is solved reaches a preset number of iterations, the solution of the objective function will be in a stable state, and continuing to iterate the solution at this time will not bring significant improvement. Therefore, a better offset parameter can be determined by solving the objective function multiple times until the preset stop condition that the number of times the objective function is solved reaches the preset number of iterations is met. The gradient of the objective function indicates the rate of change and direction of change of the objective function at the current parameter value. When the gradient of the objective function is small enough, it can be considered that the parameter value at this time is as close to the optimal solution as possible. Therefore, a better offset parameter can also be determined by solving the objective function multiple times until the preset stop condition that the gradient of the objective function is in a preset gradient range is met.
[0085] S204: Adjust the initial planned path according to the offset parameter value to obtain a target planned path.
[0086] After determining the offset parameter value, the initial planning path is adjusted according to the offset parameter value to obtain the target planning path. It can be seen from the foregoing that the initial planning path is a path obtained according to both the static map and the dynamic map, and it is composed of multiple initial position nodes. Therefore, in a possible embodiment, after each initial position node in the initial planning path is converted into a corresponding target position node according to the offset parameter value, the target position nodes corresponding to each initial position node are connected and smoothed in the order in which each initial position node is connected on the initial planning path. At this point, the operation of centering the initial planning path according to the offset parameter value to obtain the target planning path can be completed. Optionally, the adjustment method is to center the initial planning path according to the offset parameter value. Reduce the risk of the machine being too close to the dynamic obstacle due to deviations in the positioning or control of the robot, thereby causing scratches and the like. This is because the initial planning path is a plan planned by combining dynamic and static maps, and once the positioning is deviated, the route cannot be dynamically centered, but the actual dynamic width may be a scene with a width that a robot can safely pass, but the robot is squeezed to the edge of the dynamic obstacle by the static map. Especially in narrow channel environments, in order to ensure smooth passage of the robot, it is safer for the robot to drive in the center. In non-narrow channel environments, the robot can drive on one side to facilitate the passage of pedestrians.
[0087] Exemplarily, the process of the technical solution of the present application can be as follows: (1) the robot drives normally and detects narrow passages; (2) the robot generates a dynamic obstacle gradient map after detecting the narrow passage; (3) the initial planned path is mapped to the gradient map and an optimization function is constructed; (4) optimization is performed to obtain a route transformation relationship, i.e., an offset parameter; (5) the initial planned path is corrected through the transformation relationship to obtain a centered target planned path.
[0088] In the path optimization method provided in the embodiment of the present application, the initial planning path is obtained by combining the static map and the dynamic map, so that the initial planning path takes into account both the static environment and the real-time environment, and the map features such as obstacles and non-travel areas are more comprehensive. Then, the target planning path is obtained after adjusting the initial planning path according to the dynamic map, so that the target planning path is more in line with the real-time environment, reducing the influence of positioning deviation, and effectively reducing the possibility of robot collision. In addition, when the robot needs to face a scene with a relatively limited space of the passageway when working, since in the path optimization method provided in the embodiment of the present application, the target planning path is obtained by optimizing the initial planning path generated by the robot before, the path optimization method provided in the embodiment of the present application is more efficient in generating the target planning path than the method based on the search-based path planning algorithm to regenerate the target planning path. Because the method based on the search-based path planning algorithm to regenerate the target planning path often needs to find the best route by exhaustive or searching a large number of paths, which consumes a lot of time and resources. In addition, since the path planning path provided in the embodiment of the present application is a target planning path obtained by adjusting the initial planning path, it is not necessary to pay special attention to the position of the starting node and the end node of the target path as in the method of regenerating the target planning path based on the search-based path planning algorithm.
[0089] Considering that the working environment of the robot is dynamically changing, the positions of some obstacles will change, such as people or tables and chairs. Therefore, in order to ensure that the robot can avoid obstacles more effectively and not collide during the passage, it is necessary to re-optimize the initial planning path in time to obtain a new target planning path, and the new target planning path can better adapt to the real-time environment. Therefore, as an optional embodiment of the present application, the robot can execute the above-mentioned path optimization method according to a preset execution cycle, and the preset execution cycle is used to instruct the robot to periodically execute the above-mentioned path optimization method according to a preset time interval. Among them, the specific preset time interval can be set by the technician according to actual needs and is not limited here. Specifically, when the robot needs to start traveling in a certain channel, the target planning path can be obtained by the above-mentioned path optimization method, so that the robot can maintain the center as much as possible when traveling in the channel, reducing the risk of collision of the robot. And before the robot has completed the passage, the robot can execute the above-mentioned path optimization method according to the preset execution cycle to realize the real-time dynamic centering of the robot.
[0090] Corresponding to the path optimization method described in the above embodiment, Figure 4 A schematic diagram of the structure of a path optimization device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0091] Reference Figure 4 , the path optimization device 400 includes:
[0092] The first processing module 401 is used to determine a dynamic map of a current area.
[0093] The second processing module 402 is used to perform expansion processing on the obstacles in the dynamic map to obtain an obstacle distance grid map; the grid in the obstacle distance grid map records the distance between the grid and its nearest obstacle.
[0094] The third processing module 403 is used to determine the offset parameter value according to the initial planned path and the obstacle distance grid map, and the initial planned path is obtained according to the static map and the dynamic map.
[0095] The fourth processing module 404 is used to perform a centering adjustment on the initial planned path according to the offset parameter value to obtain a target planned path.
[0096] The process of each module in the path optimization device provided in the embodiment of the present application realizing its own function can be specifically referred to the aforementioned Figure 2 The description of the illustrated embodiment and other related method embodiments will not be repeated here.
[0097] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0098] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0099] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0100] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0101] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0102] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish descriptions, and cannot be understood as indicating or suggesting relative importance. It should also be understood that although the terms "first", "second", etc. are used to describe various elements in some embodiments of the present application in the text, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, the first table can be named as the second table, and similarly, the second table can be named as the first table without departing from the scope of the various described embodiments. The first table and the second table are both tables, but they are not the same table.
[0103] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0104] The path optimization method provided in the embodiments of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, laptop computers, industrial computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0105] Figure 5 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 5 As shown, the electronic device 500 of this embodiment includes: at least one processor 502 ( Figure 5 Only one is shown in the figure), a memory 601, in which a computer program 503 that can be run on the processor 502 is stored. When the processor 502 executes the computer program 503, the steps in the above-mentioned various path optimization method embodiments are implemented, such as Figure 2 Alternatively, when the processor 502 executes the computer program 503, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 4 Functionality of the modules shown.
[0106] The electronic device 500 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device may include, but is not limited to, a memory 601 and a processor 502. Those skilled in the art will appreciate that Figure 5 It is only an example of the electronic device 500 and does not constitute a limitation of the electronic device 500. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include an input sending device, a network access device, a bus, etc.
[0107] The processor 502 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0108] In some embodiments, the processor 502 may be an internal storage unit of the electronic device 500, such as a hard disk or memory of the electronic device 500. The processor 502 may also be an external storage device of the electronic device 500, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 500. Further, the processor 502 may also include both an internal storage unit of the electronic device 500 and an external storage device. The processor 502 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program. The processor 502 may also be used to temporarily store data that has been sent or is to be sent.
[0109] In addition, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0110] An embodiment of the present application also provides an electronic device, which includes at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor. When the processor executes the computer program, the electronic device implements the steps of any of the above-mentioned method embodiments.
[0111] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0112] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0113] An embodiment of the present application also provides a chip system, which includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement the steps in the above-mentioned method embodiments.
[0114] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0115] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0116] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0117] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0118] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A path optimization method, characterized in that: The path optimization method is applied to a robot, and the path optimization method comprises: Determine a dynamic map of the area where the robot is currently located; The obstacles in the dynamic map are expanded to obtain an obstacle distance grid map; the grid in the obstacle distance grid map records the distance between the grid and the nearest obstacle; Determining an offset parameter value according to an initial planned path and the obstacle distance grid map, wherein the initial planned path is obtained according to a static map and the dynamic map; The initial planned path is adjusted according to the offset parameter value to obtain a target planned path.
2. The path optimization method according to claim 1, characterized in that: The determining of the offset parameter value according to the initial planned path and the obstacle distance grid map includes: Obtaining a gradient grid map based on the obstacle distance grid map, wherein grids in the gradient grid map have corresponding distance cost values; The offset parameter value is determined according to the initial planning path and the gradient grid map; wherein the initial planning path is composed of a plurality of initial position nodes, the target planning path is composed of a plurality of target position nodes, and each initial position node in the initial planning path is converted into a corresponding target position node on the target planning path after being offset; the offset parameter value is a specific quantized value of the offset parameter, and the offset parameter is used to indicate the offset status of each initial position node in the initial planning path.
3. The path optimization method according to claim 1, characterized in that: The step of determining a dynamic map of the area where the robot is currently located comprises: When the traveling channel is detected as a target channel, a dynamic map of the area where the robot is currently located is determined; wherein the difference between the width of the target channel and the width of the robot is within a preset threshold range.
4. The path optimization method according to claim 2, characterized in that: The determining of the offset parameter value according to the initial planned path and the gradient grid map includes: The objective function is constructed with the goal of minimizing the sum of the distance cost values of the target position nodes corresponding to the target position nodes on the target planning path after the initial position nodes in the initial planning path are offset; The offset parameter value is determined according to the objective function.
5. The path optimization method according to claim 4, characterized in that: Determining the offset parameter value according to the objective function includes: Iteratively solving the objective function until a preset stop condition is met, and determining the offset parameter value; The preset stop condition includes: the number of times the objective function is solved reaches a preset number of iterations or the gradient of the objective function is within a preset gradient range.
6. The path optimization method according to claim 2, characterized in that: The step of obtaining a gradient grid map based on the obstacle distance grid map comprises: The distances between the grids in the obstacle distance grid map and their nearest obstacles are respectively mapped into a preset value range according to a preset mapping relationship to obtain the gradient grid map; the preset mapping relationship is a nonlinear mapping relationship.
7. The path optimization method according to claim 2, characterized in that: The offset parameters include a translation parameter and a rotation parameter.
8. The path optimization method according to any one of claims 1 to 7, characterized in that: The path optimization method is executed by the robot according to a preset execution cycle, and the preset execution cycle is used to instruct the robot to periodically execute the path optimization method according to a preset time interval.
9. A path optimization device, characterized in that: include: A first processing module is used to determine a dynamic map of the area where the robot is currently located; A second processing module is used to perform expansion processing on the obstacles in the dynamic map to obtain an obstacle distance grid map; the grid in the obstacle distance grid map records the distance between the grid and its nearest obstacle; A third processing module, used to determine an offset parameter value according to an initial planned path and the obstacle distance grid map, wherein the initial planned path is obtained according to a static map and the dynamic map; The fourth processing module is used to adjust the initial planned path according to the offset parameter value to obtain a target planned path.
10. A computer-readable storage medium storing a computer program, 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 8 are implemented.
Citation Information
Cited By
Intelligent navigation method for robot
CN120702480A
Robot navigation resumption planning method based on obstacle inflation processing
WO2026130450A1
