A robot path planning method based on improved RRT algorithm
Through the improved RRT algorithm, using probability bias, dynamic step size and cubic B-spline smoothing treatment, the problem of high cost and instability in robotic arm path planning is solved, and smoother and more efficient paths are generated, reducing the mechanical Wear of the arm.
Patent Information
- Application Number
- CN202210671495.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-18
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-08-18
AI Technical Summary
The existing RRT algorithm has problems such as high path cost, unstable and numerous turning points in robotic arm path planning, which leads to intensified wear of robotic arm and fails to effectively balance the path cost and planning time.
Using the improved RRT algorithm, a new node is generated by generating random points, dynamic step size and combined vectors through probability bias, combined with triangular pruning and cubic B-spline smoothing, the path is optimized to reduce turning points and path costs.
The path planning efficiency is improved, the generated path is smoother, reducing the jitter and wear of the robotic arm, and achieving a good balance between path cost and planning time.
Smart Images

Figure CN115056222B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of path planning, and in particular to a robot arm path planning method based on an improved RRT algorithm. Background Art
[0002] Path planning technology was proposed in the 1970s and is still one of the important research directions in the field of robotics. After more than 50 years of rapid development, many theoretical algorithms have been proposed to solve path planning problems.
[0003] The obstacle avoidance planning goal of the robot arm is to plan an optimal path that meets various indicators. For this problem, the path planning algorithms can be roughly summarized as follows: graph-based path planning algorithm, artificial potential field method, biologically inspired path planning algorithm, and discrete sampling path planning algorithm. Among them, the complexity of the graph-based path planning algorithm depends on the grid resolution. When it is applied to three-dimensional space, the computational complexity is high and time-consuming, which is not suitable for the working environment of the robot arm. The artificial potential field method often falls into the local minimum when looking for a path, so it cannot guarantee that a solution will be found. The biologically inspired path planning algorithm requires a lot of training to obtain the algorithm parameters, which is computationally intensive, time-consuming, and requires a large amount of memory space. Based on the discrete sampling algorithm, there are few parameters, a simple structure, the complexity of the algorithm does not depend on the complexity of the map, and it has probabilistic completeness. Therefore, the discrete sampling algorithm is more suitable for path planning in high-dimensional environments.
[0004] As a discrete sampling algorithm, the RRT path planning algorithm not only has strong search capabilities, but also does not require environment modeling. It can be easily combined with other algorithms to solve path planning in high-dimensional spaces and complex constraint environments. However, its shortcomings are that the utilization rate of nodes in the later stage of the algorithm is low, the amount of calculation is large, and the generated path is unstable.
[0005] The optimized RRT algorithm in the prior art, such as patent CN 114115239 A, speeds up the algorithm's search speed, but the generated path has many turning points and does not meet the robot's kinematic laws; patent CN 110497403 A adopts a two-way RRT strategy and does not consider the path smoothing problem. Looking at the optimized RRT algorithm in the prior art, it only improves a certain performance, such as reducing the planning time and shortening the path cost, without considering the balance between the path cost and the planning time; secondly, the planned path is often accompanied by many turning points, without considering that the path points at the turning points will cause physical impact on the robot arm, and the emergence of this situation will aggravate the wear of the robot arm. Summary of the invention
[0006] In view of this, an object of an embodiment of the present invention is to provide a manipulator path planning method based on an improved RRT algorithm, so as to improve the manipulator path planning efficiency while ensuring a small path cost, and the generated path is smooth and satisfies the kinematic law of the manipulator.
[0007] The first aspect of the present invention provides a manipulator path planning method based on an improved RRT algorithm, and the method includes:
[0008] S1, initialize the tree T, and given the starting point x init , the target point x goa l , the expansion step size eps, the maximum number of iterations max, the spatial obstacle information obs, and the target point threshold m;
[0009] S2, generate a random point x ran d using probability biasing; when rand < bias, sample the point x ran d towards the target point x goal for sampling; otherwise, sample the point x rand randomly;
[0010] S3, find the nearest neighbor point x near to the random point in the tree T, and judge whether x near enters the target point threshold range. If it enters, directly shorten the step size to eps1, where eps1 < m, otherwise use the original step size; along and the direction of the combined vector to generate a new node x new :
[0011] S4, when a new node x new is generated, judge whether the x new node enters the target point neighborhood. If it enters the target point neighborhood, directly connect x new and x goal to generate an initial path, exit the loop, and perform step S5; otherwise, with this point x new as the center and R as the radius, calculate the distances from all nodes within the circle to the x new node, and select the node closest to the x new node as the parent node of the newly generated node, and add the x new node to the tree T, and then return to step S2 again until an initial path is found or the maximum number of iterations is reached and the loop is exited;
[0012] S5, use the triangular pruning strategy for the initial path points, and process the initial path using triangular pruning. Denote the output initial path points as [T 1, T 2, T3,..., T N], start from the target point and trace back to the nodes one by one. If the distance between two nodes is [T i ,T m ] satisfies the collision detection, then all other nodes between the two points are removed; if a collision occurs, the nodes T that do not meet the collision detection are used i As the starting point, trace back upwards in sequence and repeat the above operations until the path sequence is traversed;
[0013] S6, smoothing the pruned path based on a cubic B-spline smoothing path to obtain a final path.
[0014] Further, after step S3 and before step S4, the following steps are also included:
[0015] S31, judgment vector With vector Is the angle θ between If the condition is within the range, proceed to step S32; if not, return to step S2;
[0016] S32, Connection Determine whether the connection line collides with the spatial obstacle; if a collision occurs, shorten the step length eps and return to step S2. When entering step S3 again, if the original step length is used, change it to the shortened step length; if no collision occurs, proceed to step S4.
[0017] Further, step S3 further includes:
[0018] Set vector P1 to Its control parameter is the dynamic step size λ, and the vector P2 is The weight coefficient is τ; under the joint action of vectors P1 and P2, a new node x is generated along the direction of the combined vector P3 of P1 and P2 new ;
[0019]
[0020] Among them, when the generated new node collides with the obstacle, the step length is shortened; when no collision occurs, the original step length is restored.
[0021] Further, S6, the pruned path is smoothed based on a cubic B-spline smoothing path to obtain a final path, including:
[0022] Set the control points of the B-spline to be represented by M j , j = 0, 1, 2, 3..., the basis function of B-spline is expressed as N j,k(u) , then the mathematical description function of B-spline is recorded as:
[0023]
[0024] Where N j,0(u) The value of satisfies the following relationship:
[0025]
[0026] The cubic B-spline basis function is:
[0027]
[0028] Substitute the mathematical description function of B-spline:
[0029] M 0,3 (u) = M0 × N 0,3 (u)+M1×N 1,3 (u)+M2×N 2,3 (u)+M3×N 3,3 (u)u∈[0,1]
[0030] Given a control point M j , use the above formula to find the curve point that meets the requirements; the starting point of the B-spline is one-third of the line segment M1M1”, and the end point is one-third of the line segment M2M2”;
[0031] Among them, the tangent line at the starting point is parallel to M1”M2, and the tangent line at the end point is parallel to M2”M3; M1M1” and M2M2” are the medians of triangles M0M1M2 and M1M2M3 respectively;
[0032] The segmented curves are combined to form a complete and smooth B-spline curve as the final path.
[0033] In addition, the second aspect of the present invention provides an electronic device, which includes: one or more processors, and a memory, wherein the memory is used to store one or more computer programs; characterized in that the computer program is configured to be executed by the one or more processors, and the program includes steps for executing the robot arm path planning method based on the improved RRT algorithm as described above.
[0034] In addition, a third aspect of the present invention provides a storage medium storing a computer program; the program is loaded by a processor and executes the steps of a robot arm path planning method based on an improved RRT algorithm.
[0035] In the scheme of the present invention, by first generating nodes in the form of resultant vectors, it is helpful to find the path quickly; secondly, the use of dynamic step size allows the algorithm to avoid the problem of difficulty in finding the path in a complex obstacle environment to a certain extent, and the anti-random tree reverse growth avoids a large amount of calculation caused by too many nodes in the later stage. The anti-oscillation of the target point area effectively solves the problem of being unable to find the path due to the step size after reaching the target point range; finally, the process of reselecting the parent node reduces the path cost to a certain extent. Further, the initial path is optimized twice; first, the triangular pruning strategy effectively reduces the path cost based on the initial path, and secondly, the pruned path is smoothed using a cubic B-spline curve, which reduces the jitter of the robot arm and reduces the wear and tear caused by the movement of the robot arm. By improving the RRT algorithm, the path distance is reduced and the path quality is optimized, which avoids blind sampling and improves the planning efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0037] Figure 1 A schematic diagram of a process flow of a robot arm path planning method based on an improved RRT algorithm disclosed in an embodiment of the present invention;
[0038] Figure 2 is a schematic diagram of an improved node expansion disclosed in an embodiment of the present invention;
[0039] Figure 3 It is a vector diagram of preventing reverse growth of random trees disclosed in an embodiment of the present invention;
[0040] Figure 4 It is a schematic diagram of the original step-size expansion scheme disclosed in the embodiment of the present invention and the step-size expansion scheme of the improved RRT algorithm of this embodiment;
[0041] Figure 5 is a schematic diagram of triangle pruning path processing disclosed in an embodiment of the present invention;
[0042] Figure 6 is a schematic diagram of a cubic B-spline curve disclosed in an embodiment of the present invention;
[0043] Figure 7 It is a simulation result diagram of the improved RRT algorithm disclosed in the embodiment of the present invention and several other RRT algorithms in the prior art executed based on environment 1;
[0044] Figure 8It is a simulation result diagram of the improved RRT algorithm disclosed in the embodiment of the present invention and several other RRT algorithms in the prior art executed based on environment 2. DETAILED DESCRIPTION
[0045] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0046] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0047] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0048] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0049] It should be noted that the “plurality” mentioned in this embodiment refers to two or more than two.
[0050] In this embodiment, path planning: in an environment with obstacles, given the starting point and target point of the robot, the robot can plan a path from the starting point to the target point without colliding with spatial obstacles.
[0051] RRT algorithm: RRT algorithm is a path planning algorithm, and its full name is fast random tree algorithm. This algorithm randomly scatters points in space and then connects feasible points to obtain a feasible path for the robot.
[0052] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0053] See also Figure 1 , Figure 1 is a schematic flowchart of a robotic arm path planning method based on an improved RRT algorithm disclosed in an embodiment of the present invention. As Figure 1 shown, a robotic arm path planning method based on an improved RRT algorithm in an embodiment of the present invention includes:
[0054] S1. Initialize the tree T, and given the starting point x init , the target point x goa l , the expansion step size eps, the maximum number of iterations max, the spatial obstacle information obs, and the target point threshold m;
[0055] Specifically, in this embodiment, the variables are initialized, including the starting point x init , the target point x goa l , the expansion step size eps, the maximum number of iterations max, the spatial obstacle information obs, and the target point threshold m.
[0056] S2. Generate a random point x rand using probability bias; when rand < bias, sample the point x rand towards the target point x goa l ; otherwise, sample the point x rand randomly;
[0057] Specifically, in this embodiment, a sampling point is generated in the workspace. Given the bias variable bias (0 < bias < 1), the variable value is generated using a random function and denoted as rand (0 ≤ rand ≤ 1). When rand < bias, the sampling point x rand is sampled towards the target point x goa l ; in other cases, the sampling point x rand is randomly sampled.
[0058] S3. Find the nearest neighbor point x near to the random point in the tree T, and determine whether x near enters the target point threshold range. If it enters, directly shorten the step size to eps1, where eps1 < m; otherwise, use the original step size; along the and resultant vector direction, generate a new node x new with the current step size;
[0059] It should be noted that, as Figure 2 shown, this is the schematic diagram of the improved node expansion in this embodiment. The generation of the new node x new, the fixed step size of the original RRT algorithm is changed to an extended method of dynamic step size, and the parameters of the dynamic step size are introduced into the expression of the resultant vector, as shown in formula (1):
[0060]
[0061] Set vector P1 to Its control parameter is the dynamic step size λ, and the vector P2 is The weight coefficient is τ. Under the joint action of vectors P1 and P2, a new node x is generated along the direction of the resultant vector P3. new Among them, when the generated new node collides with the obstacle, the step length is shortened; when there is no collision, the original step length is restored.
[0062] Further, after step S3 and before step S4, the following steps are also included:
[0063] S31, judgment vector With vector Is the angle θ between If the condition is within the range, proceed to step S32; if not, return to step S2;
[0064] S32, Connection Determine whether the connection line collides with the spatial obstacle; if a collision occurs, shorten the step length eps and return to step S2. When entering step S3 again, if the original step length is used, change it to the shortened step length; if no collision occurs, proceed to step S4.
[0065] Specifically, in this embodiment, in order to avoid sampling domain deviation during the sampling process, the following strategy is adopted to avoid the reverse growth of the random tree. Figure 3 Shown is a vector schematic diagram of preventing the reverse growth of a random tree in this embodiment.
[0066] vector With vector The angle between them is denoted as θ:
[0067]
[0068] When the angle θ is In the range, the generated x new Nodes are added to the tree, such as Figure 3 In In other cases, it is considered that the sampling domain deviates during the sampling process, and the random tree grows in reverse. In this case, the generated nodes are considered invalid nodes, such as Figure 3 In node.
[0069] Furthermore, the target point area anti-oscillation is performed, and the neighboring point x of the original RRT algorithmnear Enter the target point x goa l When within the neighborhood of , the original step size is used to expand x new , this expansion may result in node x new Oscillates around the target point. Figure 4 FIG. 1 is a schematic diagram of an original step-size expansion scheme and a step-size expansion scheme of the improved RRT algorithm in this embodiment.
[0070] The radius of a given neighborhood is denoted by r. If x near If x is within the neighborhood, the step length is shortened to λ1 (λ1<r); near Outside the neighborhood, the original step size λ is used to generate node x new When a new node x is generated new Then, with this point as the center and R as the radius, calculate the distance from all nodes in the circle to x. new The distance of the node, and select the distance x new The node closest to the node is used as the parent node of the newly generated node.
[0071] S4, when a new node x is generated new After that, judge x new Whether the node enters the neighborhood of the target point. If so, connect directly to x. new With x goa l , generate the initial path, exit the loop, and proceed to step S5; otherwise, take the point x new is the center of the circle, R is the radius, and the distance from all nodes in the circle to x is calculated. new The distance of the node, and select the distance x new The node closest to the node is used as the parent node of the newly generated node, and x new The node is added to the tree T, and the process returns to step S2 again until the initial path is found or the maximum number of iterations is reached to exit the loop.
[0072] S5, use the triangle pruning strategy for the initial path point, use triangle pruning to process the initial path, and record the output initial path point as [T 1, T 2, T3,...,T N ], start from the target point and trace back to the nodes one by one. If the distance between two nodes is [T i ,T m ] satisfies the collision detection, then all other nodes between the two points are removed; if a collision occurs, the nodes T that do not meet the collision detection are used i As the starting point, trace back upwards in sequence and repeat the above operations until the path sequence is traversed;
[0073] Specifically, in this embodiment, after the above improvements, the initial path planned by the RRT algorithm still has some redundant nodes and turning points. In order to obtain a smooth path, triangle pruning is used to process the initial path, such as Figure 5 The figure shows the schematic diagram of the triangle pruning path processing in this embodiment. The initial path point output is [T 1, T 2, T3,...,T N ], start from the target point and trace back to the nodes one by one. If the distance between two nodes is [T i ,T m ] satisfies the collision detection, then all other nodes between the two points are removed; if a collision occurs, the nodes T that do not meet the collision detection are used i As the starting point, we trace back upwards and repeat the above operations until the path sequence is traversed. After the initial optimization, the path has fewer turning points and the path cost is reduced.
[0074] S6, smoothing the pruned path based on a cubic B-spline smoothing path to obtain a final path.
[0075] Furthermore, this embodiment uses cubic B-spline smooth path optimization. Since the path after triangular pruning has a large turn at the connection of the node, it does not meet the robot kinematics law. In order to obtain a smooth trajectory, this embodiment uses a cubic B-spline curve to smooth the pruned path. The curvature of the cubic B-spline curve has a certain continuity, and when the local line segment of the curve is modified, it has no effect on the rest of the curve, so the smoothness of the curve can be well controlled.
[0076] Specifically, S6, smoothing the pruned path based on a cubic B-spline smoothing path to obtain a final path, including:
[0077] Set the control points of the B-spline to be represented by M j , j = 0, 1, 2, 3..., the basis function of B-spline is expressed as N j,k(u) , then the mathematical description function of B-spline is recorded as:
[0078]
[0079] Where N j,0(u) The value of satisfies the following relationship:
[0080]
[0081]
[0082] The cubic B-spline basis function is:
[0083]
[0084] Substitute the mathematical description function of B-spline:
[0085] M 0,3 (u) = M0 × N 0,3 (u)+M1×N 1,3 (u)+M2×N 2,3 (u)+M3×N 3,3 (u) u∈[0,1] (7)
[0086] Given a control point M j , the above formula can be used to find the curve points that meet the requirements. Figure 6 The diagram shows a cubic B-spline curve of this embodiment. The starting point of the B-spline is one-third of the line segment M1M1”, and the end point is one-third of the line segment M2M2”; the tangent at the starting point is parallel to M1”M2, and the tangent at the end point is parallel to M2”M3; M1M1” and M2M2” are the midlines of triangles M0M1M2 and M1M2M3, respectively. Finally, the segmented curves are combined to form a complete and smooth B-spline curve as the final path.
[0087] Furthermore, this embodiment selects two obstacle environments of different complexity, environment 1 is composed of different spheres, and environment 2 is composed of different cuboids. Simulation environment: Lenovo Xiaoxin pro14, Matlab2018a. Parameter settings: maximum number of iterations Max=2000, initial expansion step eps=3, probability bias parameter bias during sampling bias=0.3, weight coefficient τ=0.1, target point threshold is 30, and circular search radius is 20. The starting point position in environment 1 is (0, 0, 0), and the target point position is (100, 100, 100). The starting point position in environment 2 is (0, 100, 0), and the target point position is (100, 0, 20).
[0088] like Figure 7 Shown is a simulation result diagram of the improved RRT algorithm of this embodiment and several other RRT algorithms in the prior art based on environment 1. The original RRT algorithm and the target biased RRT algorithm only find the path, and do not consider the path cost and path quality. Therefore, the path cost planned by the two algorithms is relatively high, and there are many redundant path points in the path, resulting in a relatively tortuous path. The RRT* algorithm continuously reselects parent nodes and rewires when searching for the path, so that the length and quality of the generated path are improved, but it consumes a lot of time. The improved RRT algorithm of the present invention not only optimizes the path but also reduces the time, so that a good balance is achieved between the path and time. In order to avoid the contingency of a single experiment, the average values of 60 experiments of the four algorithms were statistically calculated, and the specific data are shown in Table 1 above.
[0089] Table 1 Simulation experiment data of environment 1
[0090]
[0091] like Figure 8 The figure shows the simulation results of the improved RRT algorithm of this embodiment and several other RRT algorithms in the prior art based on environment 2. Figure 8 As shown, the complexity of three-dimensional space is much higher than that of two-dimensional space, so the complexity of spatial calculation also increases. The RRT* algorithm adds the process of reselecting parent nodes and rewiring. These two processes rely on a lot of calculations between nodes, which causes the RRT* algorithm to take the longest time. The original RRT algorithm lacks goal orientation and randomly scatters points in space during sampling, so it takes a long time to plan a path. The target biased RRT algorithm and the improved RRT algorithm of this embodiment both approach the target point during sampling, and the improved algorithm of this embodiment will also be attracted by the target point when generating new nodes, avoiding blindness during sampling, greatly reducing the time spent on finding the path, and the path generated by the improved RRT algorithm is smoother than the paths generated by the other three algorithms. Table 2 is the average results of 60 simulation experiments of the four algorithms in Environment 2.
[0092] Table 2 Simulation experiment data of environment 2
[0093]
[0094] In addition, the second aspect of this embodiment provides an electronic device, which includes: one or more processors, and a memory, wherein the memory is used to store one or more computer programs; characterized in that the computer program is configured to be executed by the one or more processors, and the program includes steps for executing the robot arm path planning method based on the improved RRT algorithm as described above.
[0095] In addition, a third aspect of this embodiment provides a storage medium storing a computer program; the program is loaded by a processor and executes the steps of a robot arm path planning method based on an improved RRT algorithm.
[0096] This embodiment proposes a robot path planning method based on an improved RRT algorithm. The first part is to generate an initial path. First, nodes are generated in the form of resultant vectors, which is conducive to finding the path quickly; secondly, the use of dynamic step size allows the algorithm to avoid the problem of difficulty in finding the path in a complex obstacle environment to a certain extent, and the anti-random tree reverse growth avoids a large amount of calculation caused by too many nodes in the later stage. The anti-oscillation of the target point area effectively solves the problem of not being able to find the path due to step size after reaching the target point range; finally, the process of reselecting the parent node reduces the path cost to a certain extent. The second part is the secondary optimization of the initial path. First, the triangular pruning strategy effectively reduces the path cost based on the initial path. Secondly, the cubic B-spline curve is used to smooth the pruned path, which reduces the jitter of the robot arm and reduces the wear and tear caused by the movement of the robot arm.
[0097] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this embodiment can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0098] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.
[0099] The units described as separate components may or may not be physically separated. As a unit, it can be appreciated by those skilled in the art that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this embodiment can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0100] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0101] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a grid device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0102] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A robot arm path planning method based on an improved RRT algorithm, characterized in that: The method comprises: S1, initialize the tree T, given the starting point x init 、Target point x goal , expansion step eps, maximum number of iterations max, spatial obstacle information obs, target point threshold m; S2, using probability bias to generate random points x rand ; When rand<bias, the sampling point x rand Towards the target point x goal Sampling; otherwise, sampling point x rand Random sampling, where rand is a random function that generates variable values, and bias is a bias variable; S3. Find the nearest neighbor point x of the random point in tree T near , and judge x near whether it enters the target point threshold range. If it enters, directly shorten the step size to eps1, where eps1 < m. Otherwise, use the original step size; along and the direction of the combined vector to generate a new node x with the current step size new ; Step S3 further includes: Set vector P1 to Its control parameter is the dynamic step size λ, and the vector P2 is The weight coefficient is τ; under the joint action of vectors P1 and P2, a new node x is generated along the direction of the combined vector P3 of P1 and P2 new ; Among them, when the generated new node collides with the obstacle, the step length is shortened; when there is no collision, the original step length is restored; After step S3 and before step S4, the following steps are also included: S31, judgment vector With vector Is the angle θ between If the condition is within the range, proceed to step S32; if not, return to step S2; S32, Connection Determine whether the connection line collides with the spatial obstacle; if a collision occurs, shorten the step length eps and return to step S2. When entering step S3 again, if the original step length is used, change it to the shortened step length; if no collision occurs, proceed to step S4; S4, when a new node x is generated new After that, judge x new Whether the node enters the neighborhood of the target point. If so, connect directly to x. new With x goal , generate the initial path, exit the loop, and proceed to step S5; otherwise, take the point x new is the center of the circle, R is the radius, and the distance from all nodes in the circle to x is calculated. new The distance of the node, and select the distance x new The node closest to the node is used as the parent node of the newly generated node, and x new The node is added to the tree T, and the process returns to step S2 again until the initial path is found or the maximum number of iterations is reached and the loop is exited; S5, use the triangle pruning strategy for the initial path point, use triangle pruning to process the initial path, and record the output initial path point as [T 1, T2,T3,...,T N ], start from the target point and trace back to the nodes one by one. If the distance between two nodes is [T i ,T m ] satisfies the collision detection, then all other nodes between the two points are removed; if a collision occurs, the nodes T that do not meet the collision detection are used i As the starting point, trace back upwards in sequence and repeat the above operations until the path sequence is traversed; S6, smoothing the pruned path based on a cubic B-spline smoothing path to obtain a final path.
2. The robot arm path planning method based on the improved RRT algorithm according to claim 1, characterized in that: S6, smoothing the pruned path based on a cubic B-spline smoothing path to obtain a final path, including: Set the control points of the B-spline to be represented by M j , j = 0, 1, 2, 3..., the basis function of B-spline is expressed as N j,k(u) , then the mathematical description function of B-spline is recorded as: Where N j,0(u) The value of satisfies the following relationship: The cubic B-spline basis function is: Substitute the mathematical description function of B-spline: M 0,3 (u)=M0×N 0,3 (u)+M1×N 1,3 (u)+M2×N 2,3 (u)+M3×N 3,3 (u)u∈[0,1] Given a control point M j , use the above formula to find the curve point that meets the requirements; the starting point of the B-spline The point is one-third of the line segment M1M1”, and the end point is one-third of the line segment M2M2”; Among them, the tangent line at the starting point is parallel to M1”M2, and the tangent line at the end point is parallel to M2”M3; M1M1” and M2M2” are the medians of triangles M0M1M2 and M1M2M3 respectively; The segmented curves are combined to form a complete and smooth B-spline curve as the final path.
3. An electronic device, comprising: One or more processors, a memory, wherein the memory is used to store one or more computer programs; characterized in that the computer program is configured to be executed by the one or more processors, and the program includes steps for executing the robot arm path planning method based on the improved RRT algorithm as described in any one of claims 1-2.
4. A storage medium storing a computer program; the program is loaded and executed by a processor to implement the steps of the robot arm path planning method based on the improved RRT algorithm as described in any one of claims 1-2.
Citation Information
Patent Citations
Improved RRT algorithm and industrial robot path obstacle avoidance planning method
CN112677153A
Mechanical arm motion planning method based on improved RRT algorithm
CN112809665A
Cited By
RRT mechanical arm trajectory planning method based on non-obstacle space probability potential field sampling
CN116117822A
A Trajectory Planning Method for RRT Robotic Arms Based on Non-obstacle Spatial Probabilistic Potential Field Sampling
CN116117822B