A robot path optimization method and system based on obstacle avoidance planning
Through the path compression algorithm based on obstacle avoidance planning, combined with the evaluation function and dual pointer traversal, the problem of robot motion impact caused by the increase of trajectory points in the existing technology is solved, and the global optimal path can be found in any dimensional space and the trajectory length can be shortened. And improve the smoothness of movement.
Patent Information
- Application Number
- CN202210139748.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-15
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-02-15
AI Technical Summary
When the detection space range of the existing sampling-based robot path planning algorithm increases, the number of trajectory points increases, resulting in a zigzag path, which causes impact on the robot motion and sudden changes in the speed of the drive motor, and makes it difficult to find the global optimal path.
A path compression algorithm based on obstacle avoidance planning is proposed. It calculates the cost between trajectory points by constructing an evaluation function, eliminates redundant points, shortens the trajectory length, and combines double-pointer traversal and bidirectional traversal to ensure that the original curve characteristics are retained. Find the global optimal solution under the premise of ensuring the ability and obstacle avoidance ability.
On the basis of maintaining curve characteristics and obstacle avoidance capabilities, it effectively eliminates redundant trajectory points, shortens the trajectory length, improves the smoothness of robot motion, and can be applied in any dimensional space with linear time complexity.
Smart Images

Figure CN114545936B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robots, and in particular to a robot path optimization method and system based on obstacle avoidance planning. Background Art
[0002] like Figure 1 The flowchart of the robot algorithm is shown below. Figure 1 It can be seen that the algorithm of the robotic arm can be divided into five parts from the top to the bottom, namely path planning, path optimization, trajectory planning, trajectory tracking and motor control.
[0003] In the process of path planning, the number of nodes of the sampling-based planning algorithm increases as the detection space increases, and the number of trajectory points also increases accordingly. This phenomenon is particularly obvious when the sampling space is the joint space. At the same time, due to the blindness and randomness of the sampling-based planning algorithm, the planned path points usually appear jagged. In this case, the movement of the robot will have a certain impact, causing the drive motor to be damaged by a large sudden change in speed. Summary of the invention
[0004] In view of the technical problems existing in the prior art, the present invention provides a robot path optimization method and system based on obstacle avoidance planning, and proposes a path compression algorithm to optimize the result of path planning. On the premise of retaining the original curve characteristics and obstacle avoidance capability, redundant trajectory points are eliminated and the trajectory length is shortened.
[0005] According to a first aspect of the present invention, a robot path optimization method based on obstacle avoidance planning is provided, comprising: step 1, obtaining original trajectory sequence points, and adding the first and last trajectory sequence points in the original trajectory sequence points to the optimized path; i and P j They represent the i-th and j-th trajectory sequence points respectively, and the initial values of i and j are 1 and 2 respectively;
[0006] Step 2: Determine whether the robot arm executes P i and P j Is the cost of the trajectory of the connection less than the cost of executing the corresponding original trajectory? If yes, execute step 3; otherwise, execute step 4;
[0007] Step 3: Detect P i With P j Is there a collision between the trajectories of the connection lines? If yes, execute step 4; otherwise, add 1 to j and execute step 2 again;
[0008] Step 4: j-1 Add to the optimization path, determine P j Is it the last point in the original trajectory sequence point? If yes, then end the path optimization process to obtain each trajectory sequence point in the optimized path. Otherwise, set i=j-1 and re-execute step 2.
[0009] Based on the above technical solution, the present invention can also make the following improvements.
[0010] Optionally, in step 2, the cost of the robot arm executing any trajectory is calculated by using the evaluation function V, including:
[0011] Calculate the cost V of the robot arm executing the trajectory connecting the i-th and j-th, i-th and j-1-th, and j-1-th and j-th trajectory sequence points respectively. i,j 、V i,j-1 and V j-1,j ;
[0012] V i,j ≤V i,j-1 +V j-1,j When , it is determined that the cost of executing the trajectory connecting the i-th and j-th trajectory sequence points is less than the cost of executing the corresponding original trajectory.
[0013] Optionally, in joint space planning, the evaluation function V is the Euclidean distance of the joint vectors.
[0014] Optionally, when planning in Cartesian space, the evaluation function V is the Euclidean distance of vectors in Cartesian space.
[0015] Optionally, in step 3, P is detected i With P j The process of determining whether the trajectory of the connection line has a collision includes:
[0016] In P i With P j Linear interpolation is performed on the line connecting the points to obtain a more detailed interpolation point sequence, and collision detection is performed on each interpolation point in the point sequence. If all interpolation points do not collide with obstacles, it means that P i With P j There is no collision in the trajectory of the connection.
[0017] Optionally, after step 4, the following steps may be further performed:
[0018] Step 5: flip the trajectory sequence points in the optimized path, and re-execute steps 1-4 using the flipped trajectory sequence points as the original trajectory sequence points.
[0019] Optionally, step 5 includes:
[0020] Step 501, set a flip flag, the initial value of which is 0;
[0021] Step 502, determining whether the flip flag is 1, if yes, flipping the trajectory sequence points in the optimization path and ending, otherwise executing step 503;
[0022] Step 503 , flipping the trajectory sequence points in the optimized path, setting the flip flag value to 1, and re-executing steps 1 to 4 using the flipped trajectory sequence points as the original trajectory sequence points.
[0023] According to a second aspect of the present invention, there is provided a robot path optimization system based on obstacle avoidance planning, comprising: an original trajectory sequence point acquisition module, a path comparison module, a collision detection module and an optimized path acquisition module;
[0024] The original trajectory sequence point acquisition module is used to acquire the original trajectory sequence points, P i and P j They represent the i-th and j-th trajectory sequence points respectively, and the initial values of i and j are 1 and 2 respectively;
[0025] The path comparison module is used to determine whether the robot arm executes P i and P j Whether the cost of the trajectory of the connection line is less than the cost of executing the corresponding original trajectory, if yes, enter the collision detection module, otherwise enter the optimization path acquisition module;
[0026] The collision detection module is used to detect P i With P j Whether there is a collision between the trajectories of the connecting lines, if yes, then enter the optimized path acquisition module, otherwise, add 1 to j and then re-enter the path comparison module;
[0027] The optimized path acquisition module is used to j-1 Add to the optimization path, determine P j Is it the last point in the original trajectory sequence points? If yes, add the first and last trajectory sequence points in the original trajectory sequence points to the optimized path to obtain each trajectory sequence point in the optimized path; otherwise, set i=j-1 and re-enter the path comparison module.
[0028] According to a third aspect of the present invention, there is provided an electronic device comprising a memory and a processor, wherein the processor is used to implement the steps of a robot path optimization method based on obstacle avoidance planning when executing a computer management program stored in the memory.
[0029] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer management program stored thereon, which, when executed by a processor, implements the steps of a robot path optimization method based on obstacle avoidance planning.
[0030] The present invention provides a robot path optimization method, system, electronic device and storage medium based on obstacle avoidance planning. The method constructs an evaluation function to calculate the cost between each trajectory point to compare and determine which path has the least cost, and determines different evaluation functions for different space planning. By introducing the evaluation function, the algorithm can be applied to any dimensional space. A more detailed interpolation point sequence is obtained by linear interpolation of the line between two points, and then collision detection is performed on each interpolation point to determine whether the path formed by the two points collides. Considering that the traversal algorithm based on double pointers can only detect the area between the two pointers, but has no foresight for the area outside the two pointers, it is impossible to find the global optimal path. Therefore, after obtaining the optimized path, the optimized point sequence is flipped, and the algorithm is run again to compress the path to obtain the global optimal solution. Combining double pointer traversal with bidirectional traversal ensures that the global optimal solution is found, and has only linear time complexity. On the premise of retaining the original curve characteristics and obstacle avoidance ability, redundant trajectory points are eliminated and the trajectory length is shortened. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 This is the flowchart of the robot algorithm;
[0032] Figure 2 Trajectory diagram before and after path compression optimization provided by the embodiment of the present invention
[0033] Figure 3 A flowchart of an embodiment of a robot path optimization method based on obstacle avoidance planning provided by the present invention;
[0034] Figure 4 A schematic diagram of a trajectory where the one-way one-way path compression provided by an embodiment of the present invention cannot find an optimal solution;
[0035] Figure 5 A schematic diagram of a trajectory after bidirectional path compression provided by an embodiment of the present invention;
[0036] Figure 6 A schematic diagram of the visualization of the bi-RRT algorithm results in a test embodiment provided by the present invention;
[0037] Figure 7 A visual schematic diagram of a path compression result in a test embodiment provided by the present invention;
[0038] Figure 8A structural block diagram of a robot path optimization system based on obstacle avoidance planning provided by the present invention;
[0039] Fig. 9 A schematic diagram of the hardware structure of a possible electronic device provided by the present invention;
[0040] Fig.10 A schematic diagram of the hardware structure of a possible computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0041] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0042] The present invention provides a robot path optimization method based on obstacle avoidance planning, and proposes a path compression algorithm to optimize the path planning result. Figure 2 FIG. 1 shows a trajectory diagram before and after the path compression optimization provided by an embodiment of the present invention. Figure 2 In the embodiment given in , assuming that there are two obstacles in the current environment, the robot needs to plan a collision-free path between position 1 and position 8. The path planned by the bi-RRT algorithm is shown as the black dotted line in the figure; in fact, for the purpose of avoiding obstacles, the robot does not need to strictly follow the point sequence of 1-2-3-4-5-6-7-8; for example, the robot can move directly from point 1 to point 4, and then from point 4 to point 8. This not only eliminates redundant points, but also makes the robot's movement smoother.
[0043] like Figure 3 A flowchart of an embodiment of a robot path optimization method based on obstacle avoidance planning provided by the present invention is shown in FIG. Figure 3 As shown, the path optimization method includes:
[0044] Step 1: Get the original trajectory sequence points, and add the first and last trajectory sequence points in the original trajectory sequence points to the optimized path; i and P j They represent the i-th and j-th trajectory sequence points respectively, and the initial values of i and j are 1 and 2 respectively.
[0045] In a specific implementation, it can be realized by setting pointers, where the head pointer is set to i and the tail pointer is set to j.
[0046] Step 2: Determine whether the robot arm executes P i and P j Is the cost of the trajectory of the connection less than the cost of executing the corresponding original trajectory? If so, execute step 3; otherwise, execute step 4.
[0047] Step 3: Detect Pi With P j Check whether there is a collision between the trajectories of the connecting lines. If so, execute step 4; otherwise, add 1 to j and execute step 2 again.
[0048] Step 4: j-1 Add to the optimization path and determine P j Is it the last point in the original trajectory sequence point? If yes, then end the path optimization process to obtain each trajectory sequence point in the optimized path. Otherwise, set i=j-1 and re-execute step 2.
[0049] The present invention provides a robot path optimization method based on obstacle avoidance planning, and proposes a path compression algorithm to optimize the result of path planning. On the premise of retaining the original curve characteristics and obstacle avoidance ability, redundant trajectory points are eliminated and the trajectory length is shortened.
[0050] Example 1
[0051] Embodiment 1 provided by the present invention is an embodiment of a robot path optimization method based on obstacle avoidance planning provided by the present invention, combined with Figure 3 It can be seen that the embodiment of the path optimization method includes:
[0052] Step 1: Get the original trajectory sequence points, and add the first and last trajectory sequence points in the original trajectory sequence points to the optimized path; i and P j They represent the i-th and j-th trajectory sequence points respectively, and the initial values of i and j are 1 and 2 respectively.
[0053] Step 2: Determine whether the robot arm executes P i and P j Is the cost of the trajectory of the connection less than the cost of executing the corresponding original trajectory? If so, execute step 3; otherwise, execute step 4.
[0054] In a possible embodiment, in each cycle of step 2, the algorithm performs a i , P j-1 and P j The cost of executing any trajectory of the robot arm is calculated by the evaluation function V, including:
[0055] Calculate the cost V of the robot arm executing the trajectory connecting the i-th and j-th, i-th and j-1-th, and j-1-th and j-th trajectory sequence points respectively. i,j 、V i,j-1 and V j-1,j .
[0056] V i,j ≤V i,j-1 +V j-1,jWhen , it is determined that the cost of executing the trajectory connecting the i-th and j-th trajectory sequence points is less than the cost of executing the corresponding original trajectory.
[0057] It is understandable that in the specific implementation, the program compares V i,j With V i,j-1 +V j-1,j The relationship between the two is that if V i,j ≤V i,j-1 +V j-1,j , then it means that P j-1 is a potential redundant point that can be removed, otherwise P j-1 It cannot be eliminated and needs to be added to the optimization path.
[0058] In a possible implementation manner, during joint space planning, the evaluation function V may be the Euclidean distance of the joint vectors.
[0059] In a possible implementation manner, when planning in Cartesian space, the evaluation function V may be the Euclidean distance of vectors in Cartesian space.
[0060] Step 3: Detect P i With P j Check whether there is a collision between the trajectories of the connection lines. If so, execute step 4; otherwise, add 1 to j and execute step 2 again.
[0061] In a possible embodiment, in step 3, P is detected i With P j The process of determining whether the trajectory of the connection line has a collision includes:
[0062] In P i With P j Linear interpolation is performed on the line connecting the points to obtain a more detailed interpolation point sequence. Collision detection is performed on each interpolation point in the point sequence. If all interpolation points do not collide with obstacles, it means that P i With P j There is no collision in the trajectory of the connection.
[0063] If P j-1 As a potential redundant point that can be removed, the algorithm will i With P j A line is directly connected between them, and linear interpolation is performed to obtain a more detailed point sequence, and then collision detection is performed on each point. If all points do not collide with obstacles, it means that P i To P j There is no collision in the local path of P j-1 is a point that can be removed, otherwise add P j-1 to the processed trajectory.
[0064] Step 4: j-1 Add to the optimization path and determine P j Is it the last point in the original trajectory sequence point? If yes, then end the path optimization process to obtain each trajectory sequence point in the optimized path. Otherwise, set i=j-1 and re-execute step 2.
[0065] In a possible embodiment, step 4 further includes:
[0066] Step 5, flip the trajectory sequence points in the optimized path, and re-execute steps 1-4 using the flipped trajectory sequence points as the original trajectory sequence points.
[0067] In a possible implementation manner, step 5 includes:
[0068] Step 501, set the flip flag, the initial value of the flip flag is 0.
[0069] Step 502 , determining whether the flip flag is 1, if so, flipping the trajectory sequence points in the optimization path and ending, otherwise executing step 503 .
[0070] Step 503, flip the trajectory sequence points in the optimized path, set the flip flag value to 1, and then re-execute steps 1-4 using the flipped trajectory sequence points as the original trajectory sequence points.
[0071] like Figure 4 The figure shows a trajectory diagram of a one-way one-way path compression that cannot find an optimal solution provided by an embodiment of the present invention. Figure 4 In the current environment, there are three obstacles, and the result of path planning is a point sequence of 1-2-3-4-5-6-7-8-9. The result of running the above-mentioned unidirectional path compression algorithm is 1-4-9. Although a large number of redundant points are successfully eliminated, 1-4-7-9 is not the optimal path. The optimal path is 1-4-9. The reason for this phenomenon is that the traversal algorithm based on double pointers can only detect the area between the two pointers, but has no foresight for the area outside the two pointers, so the global optimal path cannot be found. The solution of the present invention to this problem is to flip the optimized point sequence on the basis of the above steps, and run the algorithm again for path compression to obtain the global optimal solution, such as Figure 5 FIG. 4 is a schematic diagram of a trajectory after bidirectional path compression provided by an embodiment of the present invention.
[0072] Traditional path optimization methods only consider traversal in one direction and cannot find the global optimal solution; or they use distance calculations that are only applicable to Cartesian space and cannot be extended to higher-dimensional spaces. The algorithm proposed in this paper combines double-pointer traversal with bidirectional traversal to ensure that the global optimal solution is found, and has only linear time complexity. In addition, by introducing an evaluation function, the algorithm can be applied to any dimensional space.
[0073] Example 2
[0074] Embodiment 2 provided by the present invention is a test embodiment of a specific application of a robot path optimization method based on obstacle avoidance planning provided by the present invention. The experiment is conducted in a three-dimensional space, and the Euclidean distance of the Cartesian space vector is used as the evaluation function in the path compression:
[0075] V(P 1 ,P 2 )=‖P 1 -P 2 ‖
[0076] The sampling space is:
[0077]
[0078] There are 27 obstacles in the environment, including 8 cube obstacles and 19 spherical obstacles. The starting coordinates are [10,10,10] and the end coordinates are [490,490,490]. The planning results of RRT are as follows: Figure 6 shown.
[0079] The path compression algorithm proposed in this paper is used on the above trajectory sequence, such as Figure 7 As shown in Figure 1, the path compression rate α is used to evaluate the effect of the algorithm in removing redundant points.
[0080]
[0081] After 1000 experiments, the average compression rate is 12.82%.
[0082] Example 3
[0083] Embodiment 3 provided by the present invention is an embodiment of a robot path optimization system based on obstacle avoidance planning provided by the present invention. Figure 8 A robot path optimization system structure diagram based on obstacle avoidance planning provided by an embodiment of the present invention, combined with Figure 8 It can be seen that this embodiment includes: an original trajectory sequence point acquisition module, a path comparison module, a collision detection module and an optimized path acquisition module.
[0084] The original trajectory sequence point acquisition module is used to obtain the original trajectory sequence points, P i and Pj They represent the i-th and j-th trajectory sequence points respectively, and the initial values of i and j are 1 and 2 respectively.
[0085] Path comparison module, used to determine the robot arm to perform P i and P j Whether the cost of the trajectory of the connection is less than the cost of executing the corresponding original trajectory, if so, enter the collision detection module, otherwise enter the optimized path acquisition module.
[0086] Collision detection module, used to detect P i With P j Is there a collision between the trajectories of the connections? If so, enter the optimized path acquisition module; otherwise, add 1 to j and re-enter the path comparison module.
[0087] Optimize the path acquisition module to convert P j-1 Add to the optimization path and determine P j Is it the last point in the original trajectory sequence point? If so, add the first and last trajectory sequence points in the original trajectory sequence point to the optimized path to obtain each trajectory sequence point in the optimized path; otherwise, set i=j-1 and re-enter the path comparison module.
[0088] It can be understood that the robot path optimization system based on obstacle avoidance planning provided by the present invention corresponds to the robot path optimization method based on obstacle avoidance planning provided by the aforementioned embodiments. The relevant technical features of the robot path optimization system based on obstacle avoidance planning can refer to the relevant technical features of the robot path optimization method based on obstacle avoidance planning, which will not be repeated here.
[0089] See also Fig. 9 , Fig. 9 Schematic diagram of an electronic device provided by an embodiment of the present invention. Fig. 9 As shown, an embodiment of the present invention provides an electronic device, including a memory 1310, a processor 1320, and a computer program 1311 stored in the memory 1310 and executable on the processor 1320. When the processor 1320 executes the computer program 1311, the following steps are implemented: Step 1, obtaining original trajectory sequence points, and adding the first and last trajectory sequence points in the original trajectory sequence points to the optimized path; i and P j They represent the i-th and j-th trajectory sequence points respectively, and the initial values of i and j are 1 and 2 respectively; Step 2, determine whether the robot arm executes P i and P j Is the cost of the trajectory of the connection line less than the cost of executing the corresponding original trajectory? If yes, execute step 3, otherwise execute step 4; Step 3, detect P i With P jIs there a collision between the trajectories of the connecting lines? If yes, execute step 4. Otherwise, add 1 to j and execute step 2 again. Step 4: j-1 Add to the optimization path and determine P j Is it the last point in the original trajectory sequence point? If yes, then end the path optimization process to obtain each trajectory sequence point in the optimized path. Otherwise, set i=j-1 and re-execute step 2.
[0090] See also Fig.10 , Fig.10 Schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention. Fig.10 As shown, this embodiment provides a computer-readable storage medium 1400, on which a computer program 1411 is stored. When the computer program 1411 is executed by a processor, the following steps are implemented: Step 1, obtaining original trajectory sequence points, and adding the first and last trajectory sequence points in the original trajectory sequence points to the optimized path; i and P j They represent the i-th and j-th trajectory sequence points respectively, and the initial values of i and j are 1 and 2 respectively; Step 2, determine whether the robot arm executes P i and P j Is the cost of the trajectory of the connection line less than the cost of executing the corresponding original trajectory? If yes, execute step 3, otherwise execute step 4; Step 3, detect P i With P j Is there a collision between the trajectories of the connecting lines? If yes, execute step 4. Otherwise, add 1 to j and execute step 2 again. Step 4: j-1 Add to the optimization path and determine P j Is it the last point in the original trajectory sequence point? If yes, then end the path optimization process to obtain each trajectory sequence point in the optimized path. Otherwise, set i=j+1 and re-execute step 2.
[0091] The embodiments of the present invention provide a robot path optimization method, system, electronic device and storage medium based on obstacle avoidance planning. The method constructs an evaluation function to calculate the cost between each trajectory point to compare and determine which path has the least cost, and determines different evaluation functions for different space planning. By introducing the evaluation function, the algorithm can be applied to any dimensional space. A more detailed interpolation point sequence is obtained by linear interpolation of the line between two points, and then collision detection is performed on each interpolation point to determine whether the path formed by the two points collides. Considering that the traversal algorithm based on double pointers can only detect the area between the two pointers, but has no foresight for the area outside the two pointers, it is impossible to find the global optimal path. Therefore, after obtaining the optimized path, the optimized point sequence is flipped, and the algorithm is run again to compress the path to obtain the global optimal solution. Combining double pointer traversal with bidirectional traversal ensures that the global optimal solution is found, and has only linear time complexity. On the premise of retaining the original curve characteristics and obstacle avoidance capabilities, redundant trajectory points are eliminated and the trajectory length is shortened.
[0092] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0093] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0094] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0095] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0096] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0097] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0098] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A robot path optimization method based on obstacle avoidance planning, characterized in that: The path optimization method comprises: Step 1, obtain the original trajectory sequence points, and add the first and last trajectory sequence points in the original trajectory sequence points to the optimized path; i and P j They represent the i-th and j-th trajectory sequence points respectively, and the initial values of i and j are 1 and 2 respectively; Step 2: Determine whether the robot arm executes P i and P j Is the cost of the trajectory of the connection less than the cost of executing the corresponding original trajectory? If yes, execute step 3; otherwise, execute step 4; Step 3: Detect P i With P j Is there a collision between the trajectories of the connection lines? If yes, execute step 4; otherwise, add 1 to j and execute step 2 again; Step 4: j-1 Add to the optimization path, determine P j Is it the last point in the original trajectory sequence point? If yes, then end the path optimization process to obtain each trajectory sequence point in the optimized path. Otherwise, set i=j-1 and re-execute step 2.
2. The path optimization method according to claim 1, characterized in that: In step 2, the cost of executing any trajectory of the robot arm is calculated by using the evaluation function V, including: Calculate the cost V of the robot arm executing the trajectory connecting the i-th and j-th, i-th and j-1-th and j-1-th trajectory sequence points respectively i,j 、V i,j-1 and V j-1,j ; V i,j ≤V i,j-1 +V j-1,j When , it is determined that the cost of executing the trajectory connecting the i-th and j-th trajectory sequence points is less than the cost of executing the corresponding original trajectory.
3. The path optimization method according to claim 2, characterized in that: In joint space planning, the evaluation function V is the Euclidean distance of the joint vectors.
4. The path optimization method according to claim 2, characterized in that: When planning in Cartesian space, the evaluation function V is the Euclidean distance of vectors in Cartesian space.
5. The path optimization method according to claim 1, characterized in that: In step 3, P is detected i With P j The process of determining whether the trajectory of the connection line has a collision includes: In P i With P j Linear interpolation is performed on the line connecting the points to obtain a more detailed interpolation point sequence, and collision detection is performed on each interpolation point in the point sequence. If all interpolation points do not collide with obstacles, it means that P i With P j There is no collision in the trajectory of the connection.
6. The path optimization method according to claim 1, characterized in that: After step 4, the following steps are also included: Step 5: flip the trajectory sequence points in the optimized path, and re-execute steps 1-4 using the flipped trajectory sequence points as the original trajectory sequence points.
7. The path optimization method according to claim 6, characterized in that: The step 5 comprises: Step 501, set a flip flag, the initial value of which is 0; Step 502, determining whether the flip flag is 1, if yes, flipping the trajectory sequence points in the optimization path and ending, otherwise executing step 503; Step 503, flip the trajectory sequence points in the optimized path, set the flip flag value to 1, and then re-execute steps 1-4 using the flipped trajectory sequence points as the original trajectory sequence points.
8. A robot path optimization system based on obstacle avoidance planning, characterized in that: include: Original trajectory sequence point acquisition module, path comparison module, collision detection module and optimized path acquisition module; The original trajectory sequence point acquisition module is used to acquire the original trajectory sequence points, P i and P j They represent the i-th and j-th trajectory sequence points respectively, and the initial values of i and j are 1 and 2 respectively; The path comparison module is used to determine whether the robot arm executes P i and P j Whether the cost of the trajectory of the connection line is less than the cost of executing the corresponding original trajectory, if yes, enter the collision detection module, otherwise enter the optimization path acquisition module; The collision detection module is used to detect P i With P j Whether there is a collision between the trajectories of the connecting lines, if yes, then enter the optimized path acquisition module, otherwise, add 1 to j and then re-enter the path comparison module; The optimized path acquisition module is used to j-1 Add to the optimization path, determine P j Whether it is the last point in the original trajectory sequence points, if yes, then adding the first and last trajectory sequence points in the original trajectory sequence points to the optimized path to obtain each trajectory sequence point in the optimized path; Otherwise, set i=j-1 and re-enter the path comparison module.
9. An electronic device, characterized in that: It includes a memory and a processor, and the processor is used to implement the steps of the robot path optimization method based on obstacle avoidance planning as described in any one of claims 1 to 7 when executing the computer management program stored in the memory.
10. A computer-readable storage medium, characterized in that: A computer management program is stored thereon, and when the computer management program is executed by the processor, the steps of the robot path optimization method based on obstacle avoidance planning as described in any one of claims 1 to 7 are implemented.
