Path optimization method, electronic device, storage medium, and program product
Patent Information
- Application Number
- CN202610873963.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-16
- Publication Date
- 2026-10-09
AI Technical Summary
[0004]因此,现有路径优化方法存在优化效果差的问题
[0048]本申请实施例提供了一种路径优化方法、电子设备、存储介质及程序产品,方法包括:获取目标设备的第一路径,基于路径能量模型和降低路径能量的约束对第一路径进行迭代优化,确定第二路径,其中,第一路径中包括多个路径节点的位置信息,路径能量模型是用于量化路径节点分布特性的数学函数,路径能量模型包括表征路径节点的分布特征的路径能量项,路径能量项包括表征路径弯曲程度的曲率能量项、表征路径与障碍物距离关系的障碍物势能项以及表征路径整体长度的路径长度能量项。这样,通过获取目标设备的第一路径,并基于路径能量模型和降低路径能量的约束对第一路径进行迭代优化,能够从路径节点分布特性出发,对表征路径弯曲程度的曲率能量项、表征路径与障碍物距离关系的障碍物势能项以及表征路径整体长度的路径长度能量项进行协同平衡,有效优化路径节点分布,消除转角突变问题,实现路径曲率连续过渡,从而在保障机器人安全避障的同时,大幅降低路径整体弯曲程度,避免行进过程中出现速度、方向突变,显著提升储能机器人的运动平稳性、导航精度与运行安全性,充分适配机器人运动学约束要求,提升路径的优化效果。
Smart Images

Figure CN122881684A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent navigation, and more particularly to a path optimization method, electronic device, storage medium, and program product. Background Technology
[0002] As the application scenarios of energy storage robots continue to expand, the requirements for their autonomous navigation and motion performance are increasing. Smooth and continuous travel paths are a key prerequisite for ensuring reliable operation of robots. Therefore, research on path optimization for energy storage robots has important practical significance.
[0003] Among existing related technologies, some solutions use gradient descent to adjust path nodes and gradually eliminate sharp corners to achieve smoothing; other solutions rely on the rate of curvature change to construct an energy function and directly solve for the polyline path with the minimum total cost; still other technologies first use mainstream path planning algorithms to select the optimal original path without collisions, then identify the points to be optimized, remove redundant nodes, and complete the path smoothing through iteration.
[0004] Therefore, existing path optimization methods suffer from poor optimization performance. Summary of the Invention
[0005] This application provides a path optimization method, electronic device, storage medium, and program product to improve the path optimization effect.
[0006] In a first aspect, embodiments of this application provide a path optimization method, including:
[0007] Obtain the first path of the target device, which includes the location information of multiple path nodes;
[0008] The first path is iteratively optimized based on the path energy model and the constraint of reducing path energy to determine the second path;
[0009] The path energy model is a mathematical function used to quantify the distribution characteristics of path nodes. The path energy model includes a path energy term that characterizes the distribution characteristics of path nodes. The path energy term includes a curvature energy term that characterizes the curvature of the path, an obstacle potential energy term that characterizes the distance relationship between the path and obstacles, and a path length energy term that characterizes the overall length of the path.
[0010] In one possible embodiment, a larger calculated value for the curvature energy term indicates a greater curvature of each path node in the path;
[0011] The larger the calculated value of the obstacle potential energy term, the closer the distance between each path node and the obstacle in the path;
[0012] A larger calculated value for the path length energy term indicates a longer path length.
[0013] In one possible embodiment, the curvature energy term is calculated as a statistical value of the curvature of each path node in the path, the obstacle potential energy term is calculated as the sum of the reciprocals of the distances between each path node and the obstacle in the path, and the path length energy term is calculated as the sum of the distances between each adjacent path node in the path.
[0014] In one possible embodiment, the path energy model is used to calculate the path energy of a path, which is a weighted statistical value of the calculated values of the curvature energy term, the obstacle potential energy term, and the path length energy term.
[0015] In one possible embodiment, the first path is iteratively optimized based on the path energy model and constraints to reduce path energy, including:
[0016] During the Nth iteration of optimization, the gradient vector and path energy of the first path are determined based on the path energy model and the position information of each path node in the first path.
[0017] Using the gradient descent method, based on the gradient vector and the path energy corresponding to the first path, the order of at least one target node in the first path is adjusted to generate the adjusted first path. The target nodes are the path nodes in the first path other than the start node and the end node.
[0018] If the energy of the adjusted first path is less than the preset energy threshold, then the adjusted first path is determined to be the second path.
[0019] If the path energy corresponding to the adjusted first path is greater than or equal to the preset energy threshold, then the adjusted first path is optimized in the (N+1)th iteration based on the path energy model.
[0020] In one possible embodiment, the method further includes:
[0021] Based on the position information of the path nodes in the adjusted first path, determine the curvature corresponding to the target node in the adjusted first path;
[0022] For each target node, if the curvature of the target node is greater than the preset curvature threshold, the position information corresponding to the target node is iteratively corrected based on the position information of the two path nodes adjacent to the target node before and after it, until the curvature of each target node is less than or equal to the preset curvature threshold.
[0023] In one possible embodiment, the method further includes:
[0024] Based on the location information of the path nodes in the adjusted first path and the location information of at least one target obstacle, determine the distance between the target node and the target obstacle in the adjusted first path.
[0025] For each target node, if the distance between the target node and the target obstacle is less than the preset safe distance, the position information of the target node is moved and updated in the target direction, which is the direction from the target obstacle to the target node.
[0026] In one possible embodiment, the method further includes:
[0027] Obtain the position information of the predecessor and successor nodes corresponding to each target node in the second path;
[0028] For each target node, determine whether the target node is a redundant node based on the location information of the target node, the location information of the predecessor node, and the location information of the successor node. A redundant node is a path node that causes a dense distribution of path nodes in the second path but does not affect path turning.
[0029] If the target node is a redundant node, then the target node will be removed from the second path.
[0030] In one possible embodiment, determining whether a target node is a redundant node based on the location information of the target node, the location information of the predecessor node, and the location information of the successor node includes:
[0031] The first vector is determined based on the position information of the target node and the position information of the predecessor node, and the second vector is determined based on the position information of the target node and the position information of the successor node.
[0032] If the length of the first vector and / or the second vector is less than or equal to a preset distance threshold, check whether the angle between the first vector and the second vector is less than the angle threshold.
[0033] If the angle between the first vector and the second vector is less than the angle threshold, the target node is determined to be a redundant node.
[0034] In one possible embodiment, the method further includes:
[0035] If the length of the first vector is greater than the preset distance threshold, then a new path node is inserted between the target node and the predecessor node based on the location information of the target node and the predecessor node.
[0036] If the length of the second vector is greater than the preset distance threshold, then a new path node is inserted between the target node and the successor node based on the location information of the target node and the location information of the successor node.
[0037] In one possible embodiment, the method further includes:
[0038] The path nodes in the second path are fitted with a preset spline curve to generate the second path after curve fitting.
[0039] Secondly, embodiments of this application provide a path optimization apparatus, comprising:
[0040] The acquisition module is used to acquire the first path of the target device, which includes the location information of multiple path nodes;
[0041] The optimization module is used to iteratively optimize the first path based on the path energy model and the constraint of reducing path energy, and determine the second path;
[0042] The path energy model is a mathematical function used to quantify the distribution characteristics of path nodes. The path energy model includes a path energy term that characterizes the distribution characteristics of path nodes, a curvature energy term that characterizes the curvature of the path, an obstacle potential energy term that characterizes the distance relationship between the path and obstacles, and a path length energy term that characterizes the overall length of the path.
[0043] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0044] The memory stores the instructions that the computer executes;
[0045] The processor executes computer execution instructions stored in memory, causing the processor to perform the methods provided above.
[0046] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided above.
[0047] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the methods provided above.
[0048] This application provides a path optimization method, an electronic device, a storage medium, and a program product. The method includes: obtaining a first path of a target device; iteratively optimizing the first path based on a path energy model and constraints to reduce path energy; and determining a second path. The first path includes the location information of multiple path nodes. The path energy model is a mathematical function used to quantify the distribution characteristics of path nodes. The path energy model includes a path energy term characterizing the distribution characteristics of path nodes. The path energy term includes a curvature energy term characterizing the curvature of the path, an obstacle potential energy term characterizing the distance relationship between the path and obstacles, and a path length energy term characterizing the overall length of the path. In this way, by obtaining the first path of the target device and iteratively optimizing the first path based on the path energy model and the constraint of reducing path energy, it is possible to start from the distribution characteristics of path nodes and coordinately balance the curvature energy term representing the curvature of the path, the obstacle potential energy term representing the distance relationship between the path and obstacles, and the path length energy term representing the overall length of the path. This effectively optimizes the distribution of path nodes, eliminates the problem of sudden corner changes, and achieves a continuous transition of path curvature. Thus, while ensuring the robot's safe obstacle avoidance, it significantly reduces the overall curvature of the path, avoids sudden changes in speed and direction during movement, significantly improves the motion stability, navigation accuracy, and operational safety of the energy storage robot, fully adapts to the robot's kinematic constraints, and improves the optimization effect of the path. Attached Figure Description
[0049] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0050] Figure 1 Flowchart of the path optimization method provided in the embodiments of this application Figure 1 ;
[0051] Figure 2 Flowchart of the path optimization method provided in the embodiments of this application Figure 2 ;
[0052] Figure 3 A schematic diagram of the path optimization device provided in this application;
[0053] Figure 4 A schematic diagram of the structure of the electronic device provided in this application.
[0054] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0055] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0056] In the fields of warehousing and logistics, industrial automation, and intelligent manufacturing, mobile robots, handling robots, and energy storage robots typically need to navigate and track paths autonomously in complex environments such as factories, warehouses, sorting centers, and production line aisles, based on environmental maps and task instructions. These scenarios are often characterized by dense shelving, narrow aisles, numerous fixed facilities, and frequent interactions between personnel and vehicles. Therefore, it is not only necessary to plan a passable path from the starting point to the destination for the robot, but also to ensure that the planned path is suitable for the robot's actual movement.
[0057] Understandably, in practical applications, robots often need to repeatedly start, stop, turn, and avoid obstacles within limited spaces. Therefore, the distribution of path nodes, the curvature of the path, and the distance between the path and obstacles directly affect navigation quality, operational efficiency, and operational safety. Especially in areas such as shelf corners, intersections, and loading / unloading station entrances, if the path itself is discontinuous or the turns are too abrupt, even if the planned result is geometrically achievable, it may cause speed fluctuations, frequent attitude adjustments, and increased trajectory tracking deviations at the execution level, thereby affecting the stable operation of the entire logistics or manufacturing system.
[0058] In existing path planning, robots typically first use path planning algorithms such as A*, Dijkstra, and Rapidly-exploring Random Trees (RRT) to generate a feasible path from the starting point to the ending point in a grid map, topology map, or sampling space. This path is usually formed by connecting multiple discrete path nodes to form a polyline structure. In order to improve the abrupt change problem caused by polyline paths, some solutions will optimize the path, such as adding curve fitting, local node correction, or smoothing processing based on heuristic rules after path planning.
[0059] For example, some schemes shorten the path length by deleting collinear nodes and redundant inflection points, some schemes adjust the position of intermediate nodes by local averaging or gradient methods to reduce the turning angle, and some schemes use spline fitting to generate a smoother trajectory based on discrete nodes.
[0060] Understandably, from the perspective of their working principles, these technologies mostly revolve around a single objective, either focusing on shortening the total path length, reducing local curvature, or moving the path away from obstacles, lacking unified quantification and collaborative optimization of multiple key factors.
[0061] For example, since the original path nodes often come from discrete searches, their node spacing is not uniform. In open areas, the nodes may be sparse, while in areas near obstacles, the nodes may be dense, which makes the input conditions for subsequent smoothing unstable. When using simple curve fitting, if the relationship between the path curvature and the distance to obstacles is not fully considered, the fitted trajectory may have local outward convexity, intruding into the safety boundary of obstacles, or although smooth, it may deviate excessively from the efficient travel route. If a local correction method is used, it is easy to only solve the problem of a certain sharp corner, without ensuring the continuity of the entire path and the global coordination.
[0062] In view of the above, embodiments of this application provide a path optimization method, an electronic device, a storage medium, and a program product. The method includes: obtaining a first path of a target device; iteratively optimizing the first path based on a path energy model and constraints for reducing path energy; and determining a second path. The first path includes the location information of multiple path nodes. The path energy model is a mathematical function used to quantify the distribution characteristics of path nodes. The path energy model includes a path energy term characterizing the distribution characteristics of path nodes. The path energy term includes at least a curvature energy term characterizing the curvature of the path, an obstacle potential energy term characterizing the distance relationship between the path and obstacles, and a path length energy term characterizing the overall length of the path. In this way, by obtaining the first path of the target device and iteratively optimizing the first path based on the path energy model and the constraint of reducing path energy, it is possible to start from the distribution characteristics of path nodes and coordinately balance the curvature energy term representing the curvature of the path, the obstacle potential energy term representing the distance relationship between the path and obstacles, and the path length energy term representing the overall length of the path. This effectively optimizes the distribution of path nodes, eliminates the problem of sudden corner changes, and achieves a continuous transition of path curvature. Thus, while ensuring the robot's safe obstacle avoidance, it significantly reduces the overall curvature of the path, avoids sudden changes in speed and direction during movement, significantly improves the motion stability, navigation accuracy, and operational safety of the energy storage robot, fully adapts to the robot's kinematic constraints, and improves the optimization effect of the path.
[0063] Figure 1 Flowchart of the path optimization method provided in the embodiments of this application Figure 1In this embodiment, the temperature control method is applied to an electronic device. This electronic device can be the target device itself, a path optimization module deployed in the target device controller, or a host computer, edge computing node, or cloud scheduling server communicatively connected to the target device. It is understood that the target device can be, but is not limited to, the device to be path optimized; it can be any device capable of moving along a planned path, such as an energy storage robot, a sweeping robot, a transport robot, or an intelligent vehicle. (Refer to...) Figure 1 The method may include:
[0064] S101, Obtain the first path of the target device.
[0065] The first path includes the location information of multiple path nodes.
[0066] Here, the target device may refer to, but is not limited to, the device for which path optimization is to be performed. It can be any electronic device that can move along a planned path, such as energy storage robots, sweeping robots, transport robots, and intelligent vehicles.
[0067] This application plans the path to the target device; therefore, the first path to the target device can be obtained first.
[0068] Here, the first path can refer to the path initially planned by the target device based on the current starting point and the desired destination, which is the input path before path optimization. In the embodiments of this application, the first path includes the location information of multiple path nodes, which can be represented as a sequence of node identifiers corresponding to multiple path nodes, where each node identifier corresponds to its location information. For example, the representation can be P = {p1, p2, p3, …, p}. n}, where p n This is the node identifier for the nth node.
[0069] It is understandable that the location information of a path node can be two-dimensional coordinate information, for example, p i =(x i , y i ) represents the two-dimensional coordinates of the i-th node in the path; correspondingly, it can also be three-dimensional spatial coordinate information. The coordinate form is related to the application scenario. For example, in planar navigation scenarios such as warehousing and logistics, industrial automation and intelligent manufacturing, the position of each path node in the map coordinate system is usually represented by two-dimensional coordinates, and heading angle, timestamp, node type or speed limit mark are added when needed so that the equipment motion constraints can be considered in the subsequent optimization process.
[0070] Regarding the method of obtaining the first path, in one possible implementation, an external path planning device performs path planning for the target device. Therefore, the first path can be obtained by communicating with the external device. The communication method can be wired communication or wireless communication according to a preset communication protocol.
[0071] In another possible implementation, after obtaining the current starting point and the desired destination of the target device, a first path is planned automatically according to a preset path planning algorithm. At this time, the first path can be obtained by reading the preset storage location of the first path. Here, the preset storage location can be located in the cache or in memory.
[0072] It is understandable that the first path is not limited to a specific path planning algorithm; any discrete path that can output the location information of multiple path nodes is acceptable.
[0073] To ensure stable calculation of the subsequent path energy model, after obtaining the first path, this embodiment of the application can further perform preprocessing on the first path. For example, the path nodes can be sorted sequentially according to their node indices to eliminate duplicate nodes, abnormal jump nodes, and erroneous nodes that exceed the map boundaries; the original coordinates can be transformed into a unified coordinate system to ensure that the path nodes are aligned with the environment. Figure 1 In the reference frame, the starting and ending nodes can be locked by combining the target equipment size, wheelbase, minimum turning radius and channel boundary information, so that the starting and ending points remain unchanged during the iterative optimization process.
[0074] For example, regarding the process of reducing redundant nodes, for any three consecutive nodes p in the first path i-1 p i p i+1 Calculate vector v1=p i -p i-1 and v2=p i+1 -p i The angle between the path segments corresponding to the two vectors is calculated using the vector angle formula. It can be understood that when this angle is greater than a preset angle threshold, it indicates that the three path nodes are approximately collinear, and in this case, the intermediate node p can be deleted. i In this way, by traversing the entire first path, a large number of redundant nodes can be removed, resulting in a simplified first path. Node simplification reduces the number of path nodes while maintaining the overall shape of the first path, improving the efficiency of subsequent optimization processes.
[0075] Regarding application scenarios, in an exemplary warehouse robot scenario, the task scheduling module issues a transport task from the shelving area to the loading / unloading station to the transport robot (target device). The global planner can output a polyline path based on the current grid map, i.e., the first path. This first path can be understood as including multiple path nodes such as the starting point, several corner points, and the ending point. After obtaining the first path, the coordinates (i.e., position information) of each path node can be stored in the path buffer and arranged into an ordered list according to the node number. If the distance between two adjacent nodes is too large, intermediate nodes are added between them using linear interpolation. If three consecutive nodes are found to be approximately collinear and the intermediate nodes contribute little to the path shape, the redundant nodes can be deleted without disrupting the path connectivity. In this way, a well-structured first path that is easy to model uniformly can be obtained and used as the direct input for the next step.
[0076] S102, the first path is iteratively optimized based on the path energy model and the constraint of reducing path energy to determine the second path.
[0077] The path energy model is a mathematical function used to quantify the distribution characteristics of path nodes. The path energy model includes a path energy term that characterizes the distribution characteristics of path nodes. The path energy term includes a curvature energy term that characterizes the curvature of the path, an obstacle potential energy term that characterizes the distance relationship between the path and obstacles, and a path length energy term that characterizes the overall length of the path.
[0078] In this embodiment of the application, the path energy model is used to map the spatial distribution state of multiple path nodes in the first path into a computable evaluation value, thereby providing a unified optimization objective for path adjustment.
[0079] It is understood that the path energy term is a component of the path energy model, used to measure path quality from different dimensions. In the embodiments of this application, the path energy term includes a curvature energy term that characterizes the curvature of the path, an obstacle potential energy term that characterizes the distance relationship between the path and obstacles, and a path length energy term that characterizes the overall length of the path.
[0080] Here, the curvature energy term is used to characterize the curvature of the path. An increase in the value usually means that there are obvious sharp turns or changes in posture in the path. The obstacle potential energy term is used to characterize the distance relationship between the path and the obstacle. An increase in the value usually means that some path nodes are close to the obstacle or enter a high-risk area. The path length energy term is used to characterize the overall length of the path. An increase in the value usually means that the path has a large detour or the total length of the node connection is long.
[0081] Therefore, a larger calculated value for the curvature energy term indicates a greater curvature of each path node in the path; a larger calculated value for the obstacle potential energy term indicates a closer distance between each path node and the obstacle; and a larger calculated value for the path length energy term indicates a longer path.
[0082] In this way, by constraining and optimizing the relationship of energy value changes, the probability of abrupt path turns, close encounters with obstacles, and excessive detours can be reduced, making the output path more suitable for continuous tracking and stable execution of mobile robots, and helping to improve navigation safety and operational efficiency in complex warehousing and industrial environments.
[0083] Regarding the calculated values of each path energy term, in one possible implementation, the calculated value of the curvature energy term is the statistical value of the curvature of each path node in the path, the calculated value of the obstacle potential energy term is the cumulative value of the reciprocal of the distances between each path node and the obstacle in the path, and the calculated value of the path length energy term is the sum of the distances between each adjacent path node in the path.
[0084] For example, the formula for calculating the curvature energy term can be found in Formula 1 below:
[0085] EC=Σk i ² Formula 1
[0086] Where, k i Let represent the curvature at the i-th path node, and EC characterize the calculated value of the curvature energy term. Regarding the method of curvature calculation, in one possible implementation, for three consecutive nodes q... i-1 q i q i+1 First, calculate the angle between two adjacent path segments, and then calculate the path curvature based on the distance between nodes.
[0087] Understandably, the curvature value increases significantly when the path makes a sharp turn. By summing the squares of the curvature, we can obtain the curvature energy term. By constraining the curvature energy, we can effectively reduce sharp turns in the path, making the curvature changes of the path smoother and more continuous.
[0088] For example, the formula for calculating the obstacle potential energy term can be found in Formula 2 below:
[0089] EO = Σ1 / do(q i ) Formula 2
[0090] Where EO is the calculated value of the obstacle potential energy term, do(q) i ) represents the distance of the i-th node from the nearest obstacle.
[0091] Here, the coordinates of the obstacle can be provided by upstream sensing devices or software modules, such as infrared sensors or navigation devices. Understandably, as a path node approaches an obstacle, this distance value decreases, causing the calculated value of the obstacle's potential energy term to increase rapidly. Constraining the obstacle's potential energy term can push the optimized path away from the obstacle area, thereby improving path safety.
[0092] For example, the formula for calculating the path length energy term can be found in Formula 3 below:
[0093] EL = Σ||q i+1 -q i || Formula 3
[0094] Here, EL is the calculated value of the path length energy term.
[0095] It is understandable that path length energy reflects the efficiency of a path. When a path is too long, this energy value will increase. Therefore, by constraining the path length energy term, the path can be adjusted towards a shorter path during the optimization process.
[0096] In this way, by uniformly quantifying the path curvature, obstacle safety distance, and path length into a calculable energy term, path optimization can simultaneously consider smoothness, obstacle avoidance, and efficiency. Since the curvature term directly suppresses sharp turns, the obstacle potential energy term directly constrains the risk of the path approaching obstacles, and the path length term directly limits unnecessary detours, the optimized path is more suitable for continuous tracking and stable execution of mobile robots, reducing the frequency of attitude adjustments and improving operational safety.
[0097] In this embodiment, the path energy model consists of multiple path energy terms—curvature energy term, obstacle potential energy term, and path length energy term. In one possible implementation, the statistical value of the calculated values of the three energy terms is the path energy.
[0098] Based on the foregoing embodiments, the path energy model is used to calculate the path energy of a path. The path energy is a weighted statistical value of the calculated values of the curvature energy term, the obstacle potential energy term, and the path length energy term.
[0099] Here, path energy is used to uniformly quantify the overall quality of a path, making it easier to incorporate path smoothness, obstacle avoidance safety, and length efficiency into the same evaluation framework during path optimization.
[0100] It is understandable that the curvature energy term, obstacle potential energy term, and path length energy term together constitute the basic quantization components of the path energy model.
[0101] In this embodiment of the application, the weighted calculation value obtained by weighting the calculated values of the three energy terms is the path energy.
[0102] The calculation method for path energy can be found in Formula 4 below:
[0103] E = αEL + βEC + γEO (Formula 4)
[0104] Where E represents the path energy, and α, β, and γ are weighting coefficients used to adjust the influence of different energy terms on the path optimization result. By setting the weighting parameters appropriately, a balance can be achieved between path length, smoothness, and safety distance.
[0105] In this way, by using weighted calculations, path smoothness, obstacle avoidance, and length efficiency can be uniformly mapped to a single evaluation index, thereby improving the consistency and controllability of path optimization. Since path energy is composed of multiple weighted statistics, the optimization process can take into account the balance between different objectives, reducing the deviation caused by only pursuing short paths or only pursuing smoothness, and thus improving the robot's motion stability, tracking accuracy, and operational safety in complex environments.
[0106] Regarding the process of iteratively optimizing the first path based on the path energy model and the constraint of reducing path energy, in one possible implementation, the initial total energy value can be calculated first based on the position information of each path node in the first path and the obstacle information in the current map, and then the node positions can be updated according to the preset optimization strategy.
[0107] Regarding iterative optimization based on path energy capability, one possible implementation is gradient descent. For each adjustable point (excluding the start and end points), the partial derivative of the total energy function with respect to that node's coordinates is calculated to obtain the corresponding update direction. The node position is then corrected according to the step size parameter. The step size parameter can be set to a fixed value or adaptively adjusted based on the number of iterations, the energy decrease magnitude, or the local spatial congestion level. When local obstacles are dense, the step size can be reduced to prevent excessive node updates from exceeding the feasible region; when the path is in an open region, the step size can be appropriately increased to improve the convergence speed.
[0108] In another possible implementation, block coordinate descent, Newton iteration, quasi-Newton method, projection gradient method, or a combination of heuristic search and local continuous optimization can be used to simultaneously or segmentally correct multiple path nodes.
[0109] Understandably, the constraint of reducing path energy plays a crucial role in this step. For example, an energy monotonically decreasing constraint can be set, that is, only node updates that reduce the total energy are accepted, or different decreasing constraints can be set for different path energy terms.
[0110] For example, during each round of path energy reduction, different variable soft constraints can be set. For instance, a safety distance constraint can be set, requiring that the distance from any updated path node to the nearest obstacle is not less than a preset safety threshold, to ensure that sufficient gaps are maintained between the target equipment and shelves, walls, equipment stations, and dynamic obstacles. A curvature threshold constraint can be set, ensuring that the discrete curvature formed by adjacent path segments does not exceed the upper limit corresponding to the minimum turning capability allowed by the equipment. A displacement amplitude constraint can also be set, limiting the movement distance of a single node in a single iteration to not exceed a preset value, in order to avoid excessive oscillation of the path shape.
[0111] Understandably, some fixed hard constraints can also be set. For example, fixed constraints are usually used to keep the starting point and the ending point unchanged. For key nodes near loading and unloading stations, docking points or docking points, area locking constraints can also be set to ensure that these nodes retain the docking accuracy required for task execution.
[0112] Thus, if a path node in the updated path violates any constraint, it can be corrected by backtracking, reducing the step size, reprojecting to the feasible region, or recalculating the local gradient.
[0113] In some implementations, after obtaining the second path, curve fitting can be performed on the second path to make the path smoother.
[0114] In one possible implementation, the curve fitting process may include: performing curve fitting on the path nodes in the second path according to a preset spline curve to generate the curve-fitted second path.
[0115] Among them, the preset spline curve is used to make the discrete path nodes in the second path continuous. Its mathematical form can smoothly transition the local polyline while preserving the overall direction of the node sequence.
[0116] In this embodiment, the preset spline curve can be implemented using a cubic spline curve or a cubic B-spline (BasisSpline) curve. In practical applications, other spline curves that meet the path smoothing requirements can also be selected, and this embodiment does not limit this.
[0117] Understandably, the second path after curve fitting can serve as the input trajectory for the robot's subsequent path tracking control, so that the drive unit can adjust its attitude and control its speed based on the continuous curve.
[0118] In this way, by using curve fitting, the second path, which includes discrete nodes, is transformed into a continuous trajectory, making the second path geometrically smoother and reducing abrupt attitude changes at path turning points. This reduces steering impact and trajectory tracking errors during the execution of the target equipment. Furthermore, since spline curves can continuously constrain the transitions between nodes, they can also reduce local oscillations and unnecessary path fluctuations, thereby improving path continuity, motion smoothness, and operational efficiency, and helping to reduce frequent braking and wear of the drive mechanism.
[0119] In the above embodiments, by obtaining the first path of the target device and iteratively optimizing the first path based on the path energy model and the constraint of reducing path energy, it is possible to start from the path node distribution characteristics and coordinately balance the curvature energy term representing the curvature of the path, the obstacle potential energy term representing the distance relationship between the path and obstacles, and the path length energy term representing the overall length of the path. This effectively optimizes the path node distribution, eliminates the problem of sudden corner changes, and achieves a continuous transition of path curvature. Thus, while ensuring the robot's safe obstacle avoidance, it significantly reduces the overall curvature of the path, avoids sudden changes in speed and direction during movement, significantly improves the motion stability, navigation accuracy, and operational safety of the energy storage robot, fully adapts to the robot's kinematic constraint requirements, and improves the optimization effect of the path.
[0120] Figure 2 Flowchart of the path optimization method provided in the embodiments of this application Figure 2 . Reference Figure 2 The process of step S102, "iteratively optimizing the first path based on the path energy model and the constraint of reducing path energy," may include:
[0121] S201, during the Nth iteration of optimization, the gradient vector and path energy of the first path are determined based on the path energy model and the position information of each path node in the first path.
[0122] S202, using the gradient descent method, based on the gradient vector and the path energy corresponding to the first path, adjusts the order of at least one target node in the first path to generate the adjusted first path.
[0123] S203, if the path energy corresponding to the adjusted first path is less than the preset energy threshold, then the adjusted first path is determined to be the second path.
[0124] S204. If the path energy corresponding to the adjusted first path is greater than or equal to the preset energy threshold, then the adjusted first path is optimized in the N+1th iteration based on the path energy model.
[0125] The target node is any path node in the first path other than the start node and the end node.
[0126] It is understandable that the first path here refers to the input path that will undergo an iterative optimization. If the current iteration is the first time, the first path is the unoptimized path. If the current iteration is not the first time, the first path is the path that has undergone N iterations of optimization but has not yet met the path optimization requirements.
[0127] Regarding the calculation method for the path energy corresponding to the first path, you can refer to Formulas 1 to 4 above. Substitute the position information of each path node in the first path into the formula to calculate the path energy corresponding to the first path.
[0128] In this embodiment, gradient descent is used for iterative optimization. Accordingly, the gradient vector corresponding to this iteration needs to be calculated. Here, the gradient vector is used to indicate the adjustment direction of the target node. Its calculation result can reflect the decreasing trend of path energy as the node position information changes. Therefore, the partial derivatives of the energy model with respect to the coordinates of each path node in the first path can also be calculated to form the gradient vector.
[0129] In the embodiments of this application, the target node is a path node that participates in the order adjustment. Its position change can cause a change in the shape of the path polyline, while the start node and the end node are used to fix the path endpoints so that the optimization process does not change the task start and end point constraints.
[0130] After determining the gradient vector and path energy corresponding to this iteration, the relative order or position of the target nodes can be adjusted based on the gradient vector, so that the adjusted path changes towards the direction of lower energy, thereby obtaining the adjusted first path.
[0131] It is understandable that after determining the adjusted first path, the optimization requirements can be judged based on the path energy corresponding to the adjusted first path.
[0132] Here, the path energy corresponding to the adjusted first path can be compared with a preset energy threshold to determine whether the adjusted first path is the final output second path.
[0133] Here, the preset energy threshold is used to limit the output conditions of the second path after one iteration of optimization. Its value can be set in combination with the requirements of the target device's motion stability, obstacle avoidance safety margin and path efficiency.
[0134] Understandably, if the energy of the path corresponding to the adjusted first path is lower than the energy threshold, then the adjusted first path is determined to be the second path; if the threshold is still not met, then the adjusted first path is used as the new input to continue iterative optimization calculation until a second path that meets the requirements is obtained.
[0135] In the above embodiments, by iteratively calculating the gradient vector and driving the target nodes to adjust towards lower energy directions, the path curvature, distance to obstacles, and overall length converge collaboratively under a unified model. Since the starting and ending nodes remain unchanged, the optimization result stably corresponds to the original task start and end points, while avoiding any deviation from the task objective. As the path energy continuously decreases, the output second path typically exhibits better continuity and trackability, reducing sharp turns and frequent braking during the target device's movement and improving the path optimization effect. It is understandable that for the first path adjusted after one round of iterative optimization, constraints need to be set on the position information of each target node, and the adjusted first path needs to be checked for rationality based on these constraints. For example, the curvature of each target node should not be too large, and the distance between each target node and the nearest obstacle should not be too small. Based on the detection results, appropriate corrections are made to avoid the problem of unreasonable position information of each path node despite low path energy. It is understood that during the correction process, the requirement of unchanged or reduced path energy must be met.
[0136] Based on the foregoing embodiments, the method further includes: determining the curvature of the target node in the adjusted first path according to the position information of the path nodes in the adjusted first path; for each target node, if the curvature of the target node is greater than a preset curvature threshold, iteratively correcting the position information of the target node according to the position information of the two path nodes adjacent to the target node before and after it, until the curvature of each target node is less than or equal to the preset curvature threshold.
[0137] Curvature is used to characterize the degree of curvature of the path at the target node. The larger the value, the sharper the turn of the path at that node. The preset curvature threshold is used to limit the maximum degree of curvature allowed at the target node in order to avoid the path forming excessively large angles locally.
[0138] In this embodiment of the application, the geometric curvature at the target node can be calculated based on the spatial coordinate relationship between adjacent path nodes in the adjusted first path, and the curvature corresponding to each target node can be used as the basis for determining whether subsequent correction should continue.
[0139] For example, the target nodes in the adjusted first path can be traversed, and local geometric units can be constructed and the curvature corresponding to the local geometric unit (i.e. the target node) can be calculated based on the position information of the two adjacent path nodes before and after the target node and the position information of the target node itself. If the curvature of a target node is detected to be greater than the preset curvature threshold, the target node is used as the adjustment object, and its coordinates are iteratively corrected in combination with the position relationship of its adjacent nodes before and after, so that the target node gradually moves closer to the smooth transition position of the path segments before and after.
[0140] Regarding the iterative correction process, in one possible implementation, for each round of iterative correction, the curvature corresponding to the uncorrected target node can be calculated, and the relationship between the calculation result and a preset curvature threshold can be compared. When the curvature exceeds the limit, the target node is adjusted based on the position information of the adjacent path nodes, so that it continuously shrinks in the direction of the connection between the adjacent path nodes. For example, the calculation process of the position information corresponding to the target node after one iteration of correction can refer to the following formula 5:
[0141] q i , =(1-μ)×q i +μ×(q i-1 +q i+1 ) / 2 Formula 5
[0142] Where, q i , To correct the position information of the target node, μ is a smoothing coefficient. This method can be used to continuously update the position information of the target node until the curvature of the target node is less than the preset curvature threshold.
[0143] Understandably, when the adjusted first path includes multiple target nodes, each target node can be processed sequentially or iteratively corrected so that each target node ultimately satisfies the curvature threshold constraint.
[0144] In the above embodiments, the adjusted first path can further reduce local sharp corners and abrupt turns while maintaining the original continuity of passage, so as to avoid the robot from frequently turning, speed fluctuations or posture jitters due to excessive curvature when tracking the path, thereby improving the continuity of the path and motion stability, and reducing trajectory tracking errors and mechanical execution load.
[0145] Based on the foregoing embodiments, the method further includes: determining the distance between the target node and the target obstacle in the adjusted first path according to the position information corresponding to the path node in the adjusted first path and the position information of at least one target obstacle; for each target node, if the distance between the target node and the target obstacle is less than a preset safe distance, the position information of the target node is moved and updated in the target direction, where the target direction is the direction from the target obstacle to the target node.
[0146] The target obstacle is used to characterize the obstacle object that needs to participate in the obstacle avoidance judgment. Its location information can come from environmental map, LiDAR, visual sensor or multi-sensor fusion results. The location information includes two-dimensional coordinates or three-dimensional coordinates. In the embodiments of this application, the target obstacle can be the obstacle closest to the target node. It is understood that the target obstacles corresponding to each target node are different, and the number of target obstacles can be multiple or only one.
[0147] Here, the preset safety distance is used to limit the minimum interval that should be maintained between the target node and the obstacle. This interval can be preset according to the robot's external dimensions, braking distance, positioning error, and channel width.
[0148] Here, the target direction is used to indicate the direction of movement when correcting the target node. It is essentially the vector direction from the obstacle to the node, which is used to ensure that the node moves away from the obstacle after the update.
[0149] For example, the position information of each target node in the adjusted first path can be read, and the position information of at least one target obstacle can be obtained, and then the distance between the target node and the target obstacle can be calculated.
[0150] In this embodiment of the application, if the determined distance is less than the preset safe distance, the unit direction vector is calculated according to the direction of the line connecting the target obstacle to the target node, and the position information of the target node is corrected according to the preset movement amount or the way to make the distance reach the safe threshold, so as to obtain the updated position information of the target node.
[0151] The formula for calculating the updated target node's location information can be found in Formula 6 below:
[0152] q i , =q obs +d safe ×(q i -q safe ) / ||q i -q obs || Formula 6
[0153] Here, q i, To correct the position information of the target node, q obs It is the location information of the target obstacle, d safe It is the threshold of the constraint obstacle potential energy term, q safe It is a preset safe distance.
[0154] It is understood that the position correction of the target node can be calculated in conjunction with the distance deficiency, obstacle shape parameters, and local path curvature, but this application embodiment does not limit this.
[0155] In the above embodiments, by reviewing the distance between the path nodes and the target obstacle in the adjusted first path, and correcting the node position in the direction away from the obstacle when the safe distance is insufficient, the path can maintain accessibility while further satisfying obstacle avoidance constraints. Furthermore, since the node movement direction is consistent with the line connecting the obstacle to the node, the correction result can directly increase the safe distance, reduce the risk of the robot colliding in narrow passages, corner areas, or areas with dense obstacles, and at the same time reduce the number of temporary obstacle avoidances in subsequent trajectory tracking, thereby improving the continuity and stability of path execution.
[0156] It is understandable that after determining the second path, there may be redundant nodes in the second path. Therefore, the second path still needs to be simplified.
[0157] Based on the aforementioned embodiments, the method further includes: obtaining the location information of the predecessor node and successor node corresponding to each target node in the second path; for each target node, determining whether the target node is a redundant node based on the location information of the target node, the location information of the predecessor node and the location information of the successor node, wherein a redundant node is a path node that causes a dense distribution of path nodes in the second path but does not affect path turning; if the target node is a redundant node, then the target node is deleted from the second path.
[0158] Here, the predecessor node is the path node that is adjacent to the target node in the second path and is located before the target node in the sorting, and the successor node is the path node that is adjacent to the target node in the second path and is located after the target node in the sorting.
[0159] Redundant nodes are used to characterize nodes that contribute to the path node density but do not change the local turning trend. Deleting them will not change the basic turning relationship of the second path. Therefore, the second path can be simplified by deleting redundant nodes.
[0160] In one possible implementation, the target nodes in the second path can be traversed and their redundancy can be checked. If they are redundant, the target node can be deleted.
[0161] Regarding the process of determining whether a target node is a redundant node, in one possible implementation, the process may include: determining a first vector based on the location information of the target node and the location information of the predecessor node; determining a second vector based on the location information of the target node and the location information of the successor node; if the vector length of the first vector and / or the second vector is less than or equal to a preset distance threshold, detecting whether the angle between the first vector and the second vector is less than an angle threshold; if the angle between the first vector and the second vector is less than the angle threshold, determining that the target node is a redundant node.
[0162] Here, the first vector is used to characterize the geometric relationship between the target node and the predecessor node, and the second vector is used to characterize the geometric relationship between the target node and the successor node.
[0163] In this embodiment, the vector length is used to measure the distance between adjacent nodes, the preset distance threshold can be used to limit whether the distance between each node is too small, and the included angle threshold can be used to limit whether adjacent path segments are approximately collinear, thereby helping to identify whether the target node is a redundant node that does not affect the path change trend.
[0164] For example, the location information of the target node, the predecessor node, and the successor node can all be obtained from the path node coordinate data, which can be two-dimensional planar coordinates or three-dimensional spatial coordinates.
[0165] In this embodiment of the application, after obtaining the target node location information, it can be differentially calculated with the coordinates of the predecessor node and the successor node to form a first vector and a second vector, and the magnitude of the two vectors can be further calculated.
[0166] If the magnitude of the first vector and / or the second vector is not greater than the preset distance threshold, it indicates that the distance between the target node and its neighboring nodes is small, and the path nodes may be too densely distributed. In this case, the angle between the first vector and the second vector is calculated and compared with the angle threshold.
[0167] Here, the included angle can be calculated using the relationship between the vector dot product and the magnitude.
[0168] In this embodiment of the application, when the included angle is less than the included angle threshold, it indicates that the direction change of the path segments before and after the target node is small, and the target node has a limited contribution to the path turning. Therefore, the target node is determined to be a redundant node.
[0169] Here, the preset distance threshold and included angle threshold can be preset according to the robot's minimum turning radius, control accuracy and path sampling density. In actual applications, they can also be adjusted according to the scene map resolution. This application embodiment does not limit this.
[0170] In the above embodiments, it is possible to identify and delete overly dense and nearly collinear nodes while retaining necessary turning nodes, making the path node distribution simpler.
[0171] Based on the foregoing embodiments, the method further includes: if the vector length of the first vector is greater than a preset distance threshold, then inserting a new path node between the target node and the predecessor node according to the location information of the target node and the location information of the predecessor node; if the vector length of the second vector is greater than the preset distance threshold, then inserting a new path node between the target node and the successor node according to the location information of the target node and the location information of the successor node.
[0172] It is understandable that if the length of the first vector is greater than the preset distance threshold, or if the length of the second vector is greater than the preset distance threshold, it can be determined that the path nodes of the local path segment where the target node is located are too sparse, and a new path node needs to be inserted.
[0173] Here, new path nodes are used to supplement intermediate nodes when the spacing between path nodes is too large, thereby improving the path expressiveness and fitting accuracy.
[0174] In this embodiment of the application, the target node is a path node in the second path that is located at the connection position of adjacent path segments, and the predecessor node and the successor node are nodes that are adjacent to the target node in the path topology.
[0175] The preset distance threshold is used to limit the maximum allowable distance between adjacent nodes. When the distance between adjacent nodes exceeds the threshold, it indicates that the local path nodes are sparsely distributed and intermediate nodes need to be inserted to enhance the discrete expression density of the path.
[0176] For example, the length of the first vector can be calculated based on the coordinate difference between the target node and the predecessor node, and this length can be compared with a preset distance threshold. When the length of the first vector is greater than the preset distance threshold, a new path node can be inserted proportionally between the target node and the predecessor node, according to the direction of the line connecting the two nodes, so that the new node is located in the middle position between the two nodes. Similarly, the length of the second vector can be calculated based on the coordinate difference between the target node and the successor node, and when the length of the second vector is greater than the preset distance threshold, a new path node can be inserted between the target node and the successor node.
[0177] In this embodiment, the location information of the new path node can be determined by linear interpolation based on the location information of the two end nodes, so as to take into account the spatial continuity with the preceding and following nodes, thereby facilitating subsequent path tracking and control.
[0178] In this way, the number of nodes in local sparse sections can be increased without changing the overall topology of the path, thereby improving the continuous expression accuracy and local fitting accuracy of the second path, improving the stability and trackability of the robot running along the path, and reducing control jitter and trajectory deviation caused by excessive node spacing.
[0179] In the above embodiments, the dense nodes in the second path can be effectively compressed, and the remaining nodes can better reflect the true turning characteristics of the path, thereby reducing the complexity of subsequent trajectory generation and control calculations, and reducing the robot's tracking of invalid discrete points on straight segments. Furthermore, since the deletion of redundant nodes is constrained to not affect the path turning, the drivability and overall geometry of the path can be maintained, thereby improving the stability and computational efficiency of path execution.
[0180] Figure 3 A schematic diagram of the path optimization device provided in this application is shown below. Figure 3 As shown, the path optimization device 300 provided in this embodiment includes:
[0181] The acquisition module 301 is used to acquire the first path of the target device, the first path including the location information of multiple path nodes;
[0182] The optimization module 302 is used to iteratively optimize the first path based on the path energy model and the constraint of reducing path energy, and determine the second path;
[0183] The path energy model is a mathematical function used to quantify the distribution characteristics of path nodes. The path energy model includes a path energy term that characterizes the distribution characteristics of path nodes. The path energy term includes a curvature energy term that characterizes the curvature of the path, an obstacle potential energy term that characterizes the distance relationship between the path and obstacles, and a path length energy term that characterizes the overall length of the path.
[0184] In some embodiments, a larger calculated value for the curvature energy term indicates a larger curvature of each path node in the path; a larger calculated value for the obstacle potential energy term indicates a closer distance between each path node and the obstacle; and a larger calculated value for the path length energy term indicates a longer path length.
[0185] In some embodiments, the curvature energy term is calculated as a statistical value of the curvature of each path node in the path, the obstacle potential energy term is calculated as the sum of the reciprocals of the distances between each path node and the obstacle in the path, and the path length energy term is calculated as the sum of the distances between each adjacent path node in the path.
[0186] In some embodiments, the path energy model is used to calculate the path energy of a path, which is a weighted statistical value of the calculated values of the curvature energy term, the obstacle potential energy term, and the path length energy term.
[0187] In some embodiments, the optimization module 302 includes:
[0188] The computational unit is used to determine the gradient vector and path energy of the first path based on the path energy model and the position information of each path node in the first path during the Nth iteration optimization process.
[0189] The adjustment unit is used to adjust the order of at least one target node in the first path using the gradient descent method, based on the gradient vector and the path energy corresponding to the first path, to generate the adjusted first path. The target nodes are the path nodes in the first path other than the start node and the end node.
[0190] The judgment unit is used to determine the adjusted first path as the second path if the path energy corresponding to the adjusted first path is less than the preset energy threshold; if the path energy corresponding to the adjusted first path is greater than or equal to the preset energy threshold, the adjusted first path is optimized for the N+1th iteration based on the path energy model.
[0191] In some embodiments, the apparatus further includes:
[0192] The first soft constraint unit is used to determine the curvature of the target node in the adjusted first path based on the position information of the path node in the adjusted first path. For each target node, if the curvature of the target node is greater than the preset curvature threshold, the position information of the target node is iteratively corrected based on the position information of the two path nodes adjacent to the target node before and after it, until the curvature of each target node is less than or equal to the preset curvature threshold.
[0193] In some embodiments, the apparatus further includes:
[0194] The second soft constraint unit determines the distance between the target node and the target obstacle in the adjusted first path based on the position information of the path node in the adjusted first path and the position information of at least one target obstacle. For each target node, if the distance between the target node and the target obstacle is less than the preset safe distance, the position information of the target node is moved and updated in the target direction, which is the direction from the target obstacle to the target node.
[0195] In some embodiments, the apparatus further includes:
[0196] The secondary optimization module is used to obtain the position information of the predecessor and successor nodes corresponding to each target node in the second path. For each target node, it determines whether the target node is a redundant node based on the position information of the target node, the position information of the predecessor node, and the position information of the successor node. A redundant node is a path node that causes a dense distribution of path nodes in the second path but does not affect path turning. If the target node is a redundant node, the target node is deleted from the second path.
[0197] In some embodiments, the secondary optimization module includes:
[0198] The simplified unit is used to determine a first vector based on the position information of the target node and the position information of the predecessor node, and to determine a second vector based on the position information of the target node and the position information of the successor node; if the vector length of the first vector and / or the second vector is less than or equal to a preset distance threshold, it detects whether the angle between the first vector and the second vector is less than the angle threshold; if the angle between the first vector and the second vector is less than the angle threshold, it determines that the target node is a redundant node.
[0199] In some embodiments, the secondary optimization module includes:
[0200] The insertion node unit is used to insert a new path node between the target node and the predecessor node based on the position information of the target node and the position information of the predecessor node if the vector length of the first vector is greater than a preset distance threshold; and to insert a new path node between the target node and the successor node based on the position information of the target node and the position information of the successor node if the vector length of the second vector is greater than the preset distance threshold.
[0201] In some embodiments, the apparatus further includes:
[0202] The fitting module is used to perform curve fitting on the path nodes in the second path according to a preset spline curve, generating the curve-fitted second path. The path optimization device provided in this embodiment can execute the method provided in the above-described method embodiment, and its implementation principle and technical effect are similar, so it will not be described in detail here.
[0203] Figure 4 A schematic diagram of the structure of the electronic device provided in this application. Figure 4 As shown, the electronic device 40 provided in this embodiment includes at least one processor 401 and a memory 402. Optionally, the device 40 further includes a communication component 403. The processor 401, memory 402, and communication component 403 are connected via a bus 404.
[0204] In a specific implementation, at least one processor 401 executes computer execution instructions stored in memory 402, causing at least one processor 401 to perform the above-described method.
[0205] The specific implementation process of processor 401 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0206] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0207] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0208] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0209] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0210] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0211] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0212] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0213] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0214] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0215] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0216] If a function is implemented as 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 technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0217] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0218] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A path optimization method, characterized in that, include: Obtain the first path of the target device, which includes the location information of multiple path nodes; The first path is iteratively optimized based on the path energy model and the constraint of reducing path energy to determine the second path; The path energy model is a mathematical function used to quantify the distribution characteristics of path nodes. The path energy model includes a path energy term that characterizes the distribution characteristics of the path nodes. The path energy term includes a curvature energy term that characterizes the curvature of the path, an obstacle potential energy term that characterizes the distance relationship between the path and obstacles, and a path length energy term that characterizes the overall length of the path.
2. The method according to claim 1, characterized in that, The larger the calculated value of the curvature energy term, the greater the curvature of each path node in the path. The larger the calculated value of the obstacle potential energy term, the closer the distance between each path node and the obstacle in the path; The larger the calculated value of the path length energy term, the longer the path length.
3. The method according to claim 1, characterized in that, The curvature energy term is calculated as a statistical value of the curvature of each path node in the path. The obstacle potential energy term is calculated as the sum of the reciprocals of the distances between each path node and the obstacle in the path. The path length energy term is calculated as the sum of the distances between each adjacent path node in the path.
4. The method according to claim 1, characterized in that, The path energy model is used to calculate the path energy of a path, which is a weighted statistical value of the calculated values of the curvature energy term, the obstacle potential energy term, and the path length energy term.
5. The method according to claim 1, characterized in that, The iterative optimization of the first path based on the path energy model and constraints to reduce path energy includes: During the Nth iteration of optimization, the gradient vector and the path energy of the first path are determined based on the path energy model and the position information of each path node in the first path. Using the gradient descent method, based on the gradient vector and the path energy corresponding to the first path, the order of at least one target node in the first path is adjusted to generate an adjusted first path. The target node is the path node in the first path other than the start node and the end node. If the path energy corresponding to the adjusted first path is less than a preset energy threshold, then the adjusted first path is determined to be the second path; If the path energy corresponding to the adjusted first path is greater than or equal to the preset energy threshold, then the adjusted first path is optimized in the (N+1)th iteration based on the path energy model.
6. The method according to claim 5, characterized in that, The method further includes: Based on the position information of the path nodes in the adjusted first path, determine the curvature corresponding to the target node in the adjusted first path; For each target node, if the curvature of the target node is greater than a preset curvature threshold, the position information corresponding to the target node is iteratively corrected based on the position information corresponding to the two path nodes adjacent to the target node before and after it, until the curvature of each target node is less than or equal to the preset curvature threshold.
7. The method according to claim 5, characterized in that, The method further includes: Based on the position information of the path nodes in the adjusted first path and the position information of at least one target obstacle, the distance between the target node and the target obstacle in the adjusted first path is determined. For each target node, if the distance between the target node and the target obstacle is less than a preset safe distance, the position information of the target node is moved and updated in the target direction, where the target direction is the direction from the target obstacle to the target node.
8. The method according to claim 1, characterized in that, The method further includes: Obtain the position information of the predecessor and successor nodes corresponding to each target node in the second path; For each target node, it is determined whether the target node is a redundant node based on the location information of the target node, the location information of the predecessor node, and the location information of the successor node. The redundant node is a path node that causes a dense distribution of path nodes in the second path but does not affect path turning. If the target node is a redundant node, then the target node is deleted from the second path.
9. The method according to claim 8, characterized in that, The step of determining whether the target node is a redundant node based on the location information of the target node, the location information of the predecessor node, and the location information of the successor node includes: A first vector is determined based on the position information of the target node and the position information of the predecessor node, and a second vector is determined based on the position information of the target node and the position information of the successor node. If the length of the first vector and / or the second vector is less than or equal to a preset distance threshold, detect whether the angle between the first vector and the second vector is less than the angle threshold. If the angle between the first vector and the second vector is less than the angle threshold, the target node is determined to be the redundant node.
10. The method according to claim 9, characterized in that, The method further includes: If the length of the first vector is greater than the preset distance threshold, then a new path node is inserted between the target node and the predecessor node according to the location information of the target node and the location information of the predecessor node. If the length of the second vector is greater than the preset distance threshold, then a new path node is inserted between the target node and the successor node according to the location information of the target node and the location information of the successor node.
11. The method according to claim 1, characterized in that, The method further includes: The path nodes in the second path are fitted with a preset spline curve to generate the second path after curve fitting.
12. A path optimization device, characterized in that, include: The acquisition module is used to acquire the first path of the target device, wherein the first path includes the location information of multiple path nodes; An optimization module is used to iteratively optimize the first path based on the path energy model and constraints on reducing path energy, and determine the second path; The path energy model is a mathematical function used to quantify the distribution characteristics of path nodes. The path energy model includes a path energy term that characterizes the distribution characteristics of the path nodes. The path energy term includes a curvature energy term that characterizes the curvature of the path, an obstacle potential energy term that characterizes the distance relationship between the path and obstacles, and a path length energy term that characterizes the overall length of the path.
13. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-11.
15. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-11.