Mechanical arm obstacle avoidance path planning method and system
By connecting the starting tree and the end tree in two directions and adjusting the sampling strategy dynamically, the problem of inefficient path planning of robotic arms in complex environments is solved, and more efficient and energy-efficient path planning is achieved, reducing energy consumption.
Patent Information
- Application Number
- CN202411623943.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-01-07
AI Technical Summary
Traditional robotic arm path planning methods are inefficient in complex environments and cannot effectively avoid obstacles, resulting in path planning failure and high energy consumption.
The strategy of connecting the starting point tree and the end point tree in two directions is adopted, and the sampling strategy is dynamically adjusted according to the number of collision detection failures. By switching between constrained sampling and random sampling, nodes closer to the obstacle are generated and the tree structure is optimized to find a shorter path.
It significantly improves the path planning efficiency and success rate of robotic arms in complex environments, reduces path length and energy consumption, and improves work efficiency and energy utilization.
Smart Images

Figure CN119260733A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automatic control technology, and in particular to a method and system for planning a robot arm obstacle avoidance path. Background Art
[0002] In recent years, robotic arm technology has shown broad application prospects in manufacturing, medical care, services and other fields. As a key link in the work of robotic arms, path planning technology has the core task of generating a collision-free feasible path from the starting point to the end point in a given environment based on multiple performance indicators such as path length and planning time.
[0003] However, in a complex operating environment, how to ensure that the robot arm can efficiently and safely avoid obstacles and find an optimal path from the starting point to the target point is the core problem of robot arm path planning technology. Traditional path planning methods often rely on static environmental models and fixed sampling strategies, which may lead to inefficient planning in dynamic or complex environments, or even fail to find a feasible path.
[0004] In particular, in scenarios with a large number of obstacles or narrow spaces, the path planning of the robot arm requires frequent collision detection to ensure that the generated path does not collide with any obstacles. However, traditional sampling strategies often lack adaptability and cannot dynamically adjust the sampling strategy based on the results of collision detection, which may lead to low sampling efficiency and low path planning success rate in complex environments.
[0005] In addition, traditional path planning methods usually only use a one-way search strategy, that is, a one-way expansion of the tree structure from the starting point to the target point. This strategy may lead to an overly large search space in complex environments, consume a lot of computing resources, and have low planning efficiency. At the same time, traditional path planning methods often lack optimization strategies for tree structures, and the generated path may not be optimal, that is, the path length may be long, which increases the movement time and energy consumption of the robot arm. Summary of the invention
[0006] The purpose of the present invention is to provide a robot arm obstacle avoidance path planning method and system in view of the problems existing in the prior art; significantly improve the path planning efficiency and success rate of the robot arm in complex environments, and reduce the path length and energy consumption.
[0007] To achieve the above object, the technical solution adopted by the present invention is:
[0008] A robot arm obstacle avoidance path planning method comprises the following steps:
[0009] S1. Set the starting point x of the robot path start 、Target point x goal, respectively added to the starting point tree node set V1 and the end point tree node set V2, and initialized the number of collision detection failures E f is 0;
[0010] S2. According to E f The sampling strategy is dynamically adjusted by the value of , switching between constrained sampling and random sampling to generate sampling points x rand ;
[0011] S3, search for x in the starting tree rand The nearest node x nearest , along x rand Extend the direction by a predetermined distance to generate a new node x new , and perform collision detection; if x new With x nearest If there is no obstacle between new Added to v1 and reset E f is 0; if there is an obstacle, E f The value of is increased by 1, and the process returns to step S2 for resampling;
[0012] S4. Search for x in the end point tree new The nearest node x′ nearest , along x new Extend the predetermined distance in the direction to generate a new node x′ new , and perform collision detection; if x′ new and x′ nearest If there is no obstacle between new Add to V2 and reset the number of collision detection failures; if there is an obstacle, increase the number of collision detection failures and return to step S2 for resampling;
[0013] S5. Bidirectionally connect the starting tree and the end tree. If they are connected, a feasible path is found and the planning ends. If they are not connected, compare the number of nodes in the two trees, and select the tree with fewer nodes for the next expansion based on the comparison result, and return to step S2 until a connected path is found.
[0014] In step S2, dynamically adjusting the sampling strategy according to the number of collision detection failures includes:
[0015] S2.1, according to E f The value of the adaptive mixed sampling threshold p th , p th The calculation formula is,
[0016]
[0017] S2.2. Generate a random number p between [0,1] rand , if p rand Greater than or equal to the threshold pth , then constrained sampling is used, otherwise, random sampling is used.
[0018] In step S2, the constrained sampling includes:
[0019] set up and are the most recently added sampling points of V1 and V2 respectively, then the new constraint sampling points arrive and The distance must be less than arrive The mathematical expression of the distance is:
[0020]
[0021] ; Among them, .x and .y represent nodes respectively The x and y coordinate values of the
[0022] Step S3 also includes:
[0023] S3.1, if x new With x nearest There are no obstacles between them. A node x that is closer to the obstacle is generated through binary search and obstacle information. create , and add it to V1;
[0024] S3.2, adding a new node x create Then, x create As x new The parent node of
[0025] S3.3, traverse x new All neighboring nodes of x and calculate create The path lengths to these neighboring nodes are create As a parent node, it can shorten the path length of any adjacent node, and after collision detection, x create If there is no obstacle between the neighboring node and the parent node, change its parent node to x. create .
[0026] Step S4 also includes:
[0027] S4.1. If x′ new and x′ nearest There is no obstacle between them. A node x′ that is closer to the obstacle is generated through binary search and obstacle information. create , and add it to V2;
[0028] S4.2. Adding a new node x′ create Then, x′ create As x′ newThe parent node of
[0029] S4.3. Traversing x′ new All neighboring nodes of x′ create The path length to these neighboring nodes, if through x′ create As a parent node, the path length of any adjacent node can be shortened, and after collision detection, x′ create If there is no obstacle between the adjacent node and the parent node of the adjacent node, the parent node of the adjacent node is changed to x′ create .
[0030] In step S5, the bidirectional connection between the starting point tree and the end point tree is performed. If the connection is established, a feasible path is found and the planning is completed, including:
[0031] S5.1. x′ new Along x new Extend the preset distance in the direction to get the new node x″ new ;
[0032] S5.2, after collision detection, if x′ new and x″ new If there is no obstacle between new Add to V2 and add the new node x″ new Renamed to x′ new ;
[0033] S5.3, if the renamed x′ new With x new If the positions are the same, it indicates that the starting point tree and the end point tree are connected, a feasible path is found, and the path planning is completed. Otherwise, return to step S4.
[0034] In step S5, if the two trees are not connected, the number of nodes in the two trees is compared, and the tree with fewer nodes is selected for the next expansion according to the comparison result, including:
[0035] S5.4, if x′ new and x″ new If there is an obstacle between them, the number of nodes in V2 and V1 is compared;
[0036] S5.5. If the number of nodes in V2 is less than the number of nodes in V1, the identifiers of V1 and V2 are exchanged. If the number of nodes in V2 is greater than or equal to the number of nodes in V1, the identifiers of V1 and V2 are not exchanged.
[0037] S5.6. Select the tree with fewer nodes as the next tree to be expanded, return to step S2, and continue to try to expand and connect the two trees until a connecting path is found.
[0038] A robot arm obstacle avoidance path planning system, comprising:
[0039] The initialization module is used to set the starting point and target point of the robot path, add the starting point to the starting point tree node set, add the target point to the end point tree node set, and initialize the number of collision detection failures to 0;
[0040] The dynamic sampling module dynamically adjusts the sampling strategy according to the value of the number of collision detection failures, switching between constrained sampling and random sampling to generate sampling points;
[0041] Starting point tree extension module, including:
[0042] A search unit, used to search the node closest to the sampling point in the starting point tree;
[0043] A new node generation unit, used to generate a new node by extending a predetermined distance from the searched nearest node to the sampling point;
[0044] A collision detection unit, used to perform collision detection on new nodes;
[0045] Update unit, if there is no obstacle between the new node and the nearest node, add the new node to the starting tree node set and reset the number of collision detection failures to 0; if there is an obstacle, add 1 to the number of collision detection failures and trigger resampling;
[0046] Destination tree extension module, including:
[0047] A search unit, used to search in the destination tree for a node closest to the newly added node in the start tree;
[0048] A new node generation unit, used to generate a new node by extending a predetermined distance from the searched nearest node to the sampling point;
[0049] A collision detection unit, used to perform collision detection on new nodes;
[0050] Update unit, if there is no obstacle between the new node and the nearest node, add the new node to the end tree node set and reset the number of collision detection failures; if there is an obstacle, increase the number of collision detection failures and trigger resampling;
[0051] The path connectivity judgment module is used to bidirectionally connect the starting tree and the end tree to determine whether they are connected. If they are connected, a feasible path is found and the planning ends; if they are not connected, the number of nodes in the two trees is compared, and the tree with fewer nodes is selected for the next expansion based on the comparison result.
[0052] A computer-readable storage medium stores a computer program, wherein the computer program implements the above method steps when executed by a processor.
[0053] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the above method steps are implemented when the processor executes the computer program.
[0054] Compared with the prior art, the present invention has the following beneficial effects:
[0055] 1. By introducing a strategy of bidirectionally connecting the starting point tree and the end point tree, the initial feasible path from the starting point to the end point can be found more quickly in a complex environment, which significantly reduces the time required for robot path planning, improves the work efficiency of the robot, and reduces the consumption of computing resources;
[0056] 2. Dynamically adjust the sampling strategy according to the number of collision detection failures, flexibly switch between constrained sampling and random sampling, and the adaptive sampling strategy enables the robot arm to automatically adjust the sampling method according to the complexity of different environments, thereby improving the success rate and efficiency of path planning;
[0057] 3. An improved constrained sampling strategy is adopted to increase the probability of sampling in key areas, thereby improving the effective sampling rate in the random tree expansion process, allowing the robot to find feasible path areas more quickly in complex environments and reducing the number of unnecessary collision detections;
[0058] 4. The improved RRT algorithm is used to find a shorter path by generating nodes closer to obstacles and optimizing the tree structure. This can further reduce the length of the generated path while maintaining the efficiency of path planning. As a result, the robot arm requires less time and energy during movement, improving overall work efficiency and energy utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0060] Figure 1 Schematic diagram of comparison between random sampling (a) and constrained sampling (b) in the embodiments of the present application;
[0061] Figure 2 Schematic diagram comparing node expansion failure (a) and node expansion success (b) in an embodiment of the present application. DETAILED DESCRIPTION
[0062] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] In the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish descriptions and cannot be understood as indicating or suggesting relative importance. It should also be understood that although the terms "first", "second", etc. are used to describe various elements in some embodiments of the present application in the text, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, the first table can be named as the second table, and similarly, the second table can be named as the first table without departing from the scope of the various described embodiments. The first table and the second table are both tables, but they are not the same table.
[0064] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0065] Path planning technology is a key link in the work of the robotic arm. Its core task is to generate a collision-free feasible path from the starting point to the end point in a given environment based on multiple performance indicators such as path length and planning time.
[0066] Traditional path planning methods have the problems of low planning efficiency, low planning success rate, high computing resource consumption, and the generated path may not be optimal in dynamic or complex and changing environments.
[0067] In view of the above technical problems, a first aspect of an embodiment of the present application provides a robot arm obstacle avoidance path planning method, comprising:
[0068] Step S1, set the starting point x of the robot path start 、Target point x goal , respectively added to the starting point tree node set V1 and the end point tree node set V2, and initialized the number of collision detection failures Ef is 0.
[0069] Step S2: According to E f The sampling strategy is dynamically adjusted by the value of , switching between constrained sampling and random sampling to generate sampling points x rand .
[0070] Specifically, in step S2, dynamically adjusting the sampling strategy according to the number of collision detection failures includes the following steps:
[0071] Step S2.1: According to E f The value of the adaptive mixed sampling threshold p th , p th The calculation formula is,
[0072]
[0073] According to the formula, as the number of collision detection failures E f The increase in p th The value will gradually decrease.
[0074] Step S2.2: Generate a random number p between [0,1] rand , if p rand Greater than or equal to the threshold p th , then constrained sampling is used, otherwise, random sampling is used.
[0075] When the number of collision detection failures E f When p is small, th The value of is large, the environment may be relatively open, and it is more inclined to use constrained sampling to quickly find a feasible path area. f The increase in p th The value of gradually decreases, that is, when the robot frequently encounters obstacles during path planning, the environment may become complex. Random sampling can increase the diversity of sampling, which is conducive to finding a feasible path in a complex environment.
[0076] Through the above steps, the algorithm can detect the number of collision failures E f The sampling strategy is dynamically adjusted according to the value of , and flexibly switches between constrained sampling and random sampling; the adaptive sampling strategy helps to improve the efficiency and success rate of path planning, enabling the robot arm to quickly find a feasible path without collision in a complex environment.
[0077] Specifically, in step S2, the constrained sampling includes the following steps:
[0078] set up and are the most recently added sampling points of V1 and V2 respectively, then the new constraint sampling points arrive and The distance must be less than arrive The mathematical expression of the distance is:
[0079]
[0080] ; Among them, .x and .y represent nodes respectively The x and y coordinate values of the
[0081] like Figure 1 As shown, the dotted line range indicates and The distance of the new constraint sampling point Should be within the dotted line.
[0082] By setting the above constrained sampling, it is ensured that the new node is spatially relative to the most recently added node. and It is "indented" to increase the probability of sampling in key areas, improve the efficiency of path planning, and reduce unnecessary collision detection.
[0083] Step S3: Search the starting point tree for the rand The nearest node x nearest , along x rand Extend the direction by a predetermined distance to generate a new node x new , and perform collision detection; if x new With x nearest If there is no obstacle between new Added to V1 and reset E f is 0; if there is an obstacle, E f The value of is increased by 1, and returns to step S2 for resampling.
[0084] Through the above steps, the node closest to the sampling point can be searched in the starting tree, and a new node can be generated by extending in that direction. Through collision detection, it can be determined whether the new node collides with an obstacle, and the starting tree and the number of collision detection failures are updated accordingly. If the collision detection fails, the algorithm will return to step S2 to resample in order to try to find a collision-free path.
[0085] like Figure 2 As shown, Figure 2 The red line of a indicates that the node expansion encounters an obstacle. Figure 2 The green line of b indicates that the node is expanded successfully.
[0086] In addition, in order to optimize the tree structure to find a shorter path, step S3 can be further optimized, specifically including:
[0087] Step S3.1: If x new With x nearest There are no obstacles between them. A node x that is closer to the obstacle is generated through binary search and obstacle information. create and add it to V1.
[0088] Step S3.2: Add a new node x create Then, x create As x new 's parent node, thus forming a coherent path.
[0089] Step S3.3, traverse x new All neighboring nodes of x and calculate create The path lengths to these neighboring nodes are create As a parent node, it can shorten the path length of any adjacent node, and after collision detection, x create If there is no obstacle between the neighboring node and the parent node, change its parent node to x. create , to reflect the shorter path.
[0090] Through the above optimization steps, a shorter path can be found by generating nodes closer to obstacles and optimizing the tree structure. While maintaining the efficiency of path planning, the length of the generated path can be further reduced, thereby improving the efficiency and quality of the robot path planning.
[0091] Step S4: Search the destination tree for the new The nearest node x′ nearest ; Then, along x new Extend the predetermined distance in the direction to generate a new node x′ new , and perform collision detection to explore whether there is a path from x′ nearest to x new The obstacle-free path; if x′ new and x′ nearest There are no obstacles between them, indicating that this path is feasible, then x′ new Add it to V2 and reset the number of collision detection failures; if there is an obstacle, it means that this path is not feasible, then increase the number of collision detection failures and return to step S2 for resampling.
[0092] Through the above steps, from the end tree V2 to x new The direction is expanded and the connection path is explored, trying to connect the starting point tree V1, which provides a high-efficiency path.
[0093] In addition, in order to optimize the tree structure to find a shorter path, step S4 can be further optimized, specifically including:
[0094] Step S4.1: If there is no obstacle, generate a node x′ that is closer to the obstacle through binary search and obstacle information. create and added it to V2.
[0095] Step S4.2: Add a new node x′ create Then, x′ create As x′ new The parent node of .
[0096] Step S4.3: traverse x′ new All neighboring nodes of x′ create The path length to these neighboring nodes, if through x′ create As a parent node, the path length of any adjacent node can be shortened, and after collision detection, x′ create If there is no obstacle between the adjacent node and the parent node of the adjacent node, the parent node of the adjacent node is changed to x′ create .
[0097] Through the above optimization steps, a shorter path can be found by generating nodes closer to obstacles and optimizing the tree structure. While maintaining the efficiency of path planning, the length of the generated path can be further reduced, thereby improving the efficiency and quality of the robot path planning.
[0098] Step S5, bidirectionally connect the starting tree and the end tree. If they are connected, a feasible path is found and the planning ends; if they are not connected, compare the number of nodes in the two trees and select the tree with fewer nodes for the next expansion based on the comparison result.
[0099] By bidirectionally connecting the start tree and the end tree, a feasible path from the start point to the end point can be found more quickly, especially in complex environments, which significantly improves the efficiency of robot path planning.
[0100] Compared with one-way search, the two-way connection strategy can find the connection path faster, thus reducing the consumption of computing resources.
[0101] Specifically, in step S5, the bidirectional connection between the starting point tree and the end point tree is connected. If the connection is established, a feasible path is found and the planning is completed, including:
[0102] Step S5.1: x′ new Along x new Extend the preset distance in the direction to get the new node x″ new .
[0103] Step S5.2: After collision detection, if x′ new and x″ new There are no obstacles between them, indicating that this path is feasible, then x″ new Add to V2 and add the new node x″new Renamed to x′ new .
[0104] Step S5.3: If the renamed x′ new With x new If the positions are the same, it indicates that the starting tree and the end tree are connected, a feasible path is found, and the path planning is completed. Otherwise, return to step S4 and continue to try to expand and connect the two trees.
[0105] Specifically, in step S5, if the two trees are not connected, the number of nodes in the two trees is compared, and the tree with fewer nodes is selected for the next expansion according to the comparison result, including:
[0106] S5.4, if x′ new and x″ new If there is an obstacle between them, it means that the current path is not feasible, then compare the number of nodes in V2 and V1;
[0107] S5.5. If the number of nodes in V2 is less than the number of nodes in V1, the identifiers of V1 and V2 are exchanged. If the number of nodes in V2 is greater than or equal to the number of nodes in V1, the identifiers of V1 and V2 are not exchanged. Expand from the tree with fewer nodes in the hope of finding a connected path faster.
[0108] S5.6. Select the tree with fewer nodes as the next tree to be expanded, return to step S2, and continue to try to expand and connect the two trees until a connecting path is found or the preset number of iterations / time limit is reached.
[0109] According to a second aspect of an embodiment of the present application, a robot arm obstacle avoidance path planning system is provided, comprising:
[0110] The initialization module is used to set the starting point and target point of the robot path, add the starting point to the starting point tree node set, add the target point to the end point tree node set, and initialize the number of collision detection failures to 0;
[0111] The dynamic sampling module dynamically adjusts the sampling strategy according to the value of the number of collision detection failures, switching between constrained sampling and random sampling to generate sampling points;
[0112] Starting point tree extension module, including:
[0113] A search unit, used to search the node closest to the sampling point in the starting point tree;
[0114] A new node generation unit, used to generate a new node by extending a predetermined distance from the searched nearest node to the sampling point;
[0115] A collision detection unit, used to perform collision detection on new nodes;
[0116] Update unit, if there is no obstacle between the new node and the nearest node, add the new node to the starting tree node set and reset the number of collision detection failures to 0; if there is an obstacle, add 1 to the number of collision detection failures and trigger resampling;
[0117] Destination tree extension module, including:
[0118] A search unit, used to search in the destination tree for a node closest to the newly added node in the start tree;
[0119] A new node generation unit, used to generate a new node by extending a predetermined distance from the searched nearest node to the sampling point;
[0120] A collision detection unit, used to perform collision detection on new nodes;
[0121] Update unit, if there is no obstacle between the new node and the nearest node, add the new node to the end tree node set and reset the number of collision detection failures; if there is an obstacle, increase the number of collision detection failures and trigger resampling;
[0122] The path connectivity judgment module is used to bidirectionally connect the starting tree and the end tree to determine whether they are connected. If they are connected, a feasible path is found and the planning ends; if they are not connected, the number of nodes in the two trees is compared, and the tree with fewer nodes is selected for the next expansion based on the comparison result.
[0123] According to a third aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the above-mentioned method steps are implemented.
[0124] According to a fourth aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method steps when executing the computer program.
[0125] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A robot arm obstacle avoidance path planning method, characterized in that: The following steps are involved: S1. Set the starting point x of the robot path start 、Target point x goal , respectively added to the starting point tree node set V1 and the end point tree node set V2, and initialized the number of collision detection failures E f is 0; S2. According to E f The sampling strategy is dynamically adjusted by the value of , switching between constrained sampling and random sampling to generate sampling points x rand ; S3, search for x in the starting tree rand The nearest node x nearest , x nearest Along x rand Extend the direction by a predetermined distance to generate a new node x new , and perform collision detection; if x new With x nearest If there is no obstacle between new Added to V1 and reset E f is 0; if there is an obstacle, E f The value of is increased by 1, and the sample is returned to step S2 for resampling; S4. Search for x in the end point tree new The nearest node x′ nearest , x′ nearest Along x new Extend the predetermined distance in the direction to generate a new node x′ new , and perform collision detection; if x′ new and x′ nearest If there is no obstacle between new Add to V2 and reset the number of collision detection failures; if there is an obstacle, increase the number of collision detection failures and return to step S2 for resampling; S5. Bidirectionally connect the starting tree and the end tree. If they are connected, a feasible path is found and the planning ends. If they are not connected, compare the number of nodes in the two trees, and select the tree with fewer nodes for the next expansion based on the comparison result, and return to step S2 until a connected path is found.
2. A robot arm obstacle avoidance path planning method according to claim 1, characterized in that: In step S2, dynamically adjusting the sampling strategy according to the number of collision detection failures includes: S2.1, according to E f The value of the adaptive mixed sampling threshold p th , p th The calculation formula is, S2.
2. Generate a random number p between [0, 1] rand , if p rand Greater than or equal to the threshold p th , then constrained sampling is used, otherwise, random sampling is used.
3. A robot arm obstacle avoidance path planning method according to claim 1, characterized in that: In step S2, the constrained sampling includes: set up and are the most recently added sampling points of V1 and V2 respectively, then the new constraint sampling point v to and The distance must be less than arrive The mathematical expression of the distance is: ; Among them, .x and .y represent the x and y coordinate values of node v respectively.
4. A robot arm obstacle avoidance path planning method according to claim 1, characterized in that: Step S3 also includes: S3.1, if x new and xnearest There are no obstacles between them. A node x that is closer to the obstacle is generated through binary search and obstacle information. create , and add it to V1; S3.2, adding a new node x create Then, x create As x new The parent node of S3.3, traverse x new All neighboring nodes of x and calculate create The path lengths to these neighboring nodes are create As a parent node, it can shorten the path length of any adjacent node, and after collision detection, x create If there is no obstacle between the neighboring node and the parent node, change its parent node to x. create .
5. The method for obstacle avoidance path planning of a robot arm according to claim 1, characterized in that: Step S4 also includes: S4.
1. If x′ new and x′ nearest There is no obstacle between them. A node x′ that is closer to the obstacle is generated through binary search and obstacle information. create , and add it to V2; S4.
2. Adding a new node x′ create Then, x′ create As x′ new The parent node of S4.
3. Traversing x′ new All neighboring nodes of x′ create The path length to these neighboring nodes, if through x′ create As a parent node, the path length of any adjacent node can be shortened, and after collision detection, x′ create If there is no obstacle between the adjacent node and the parent node of the adjacent node, the parent node of the adjacent node is changed to x′ create .
6. A robot arm obstacle avoidance path planning method according to claim 1, characterized in that: In step S5, the bidirectional connection between the starting point tree and the end point tree is performed. If the connection is established, a feasible path is found and the planning is completed, including: S5.
1. Change x′ new Along x new Extend the preset distance in the direction to get the new node x″ new ; S5.2, after collision detection, if x′ new and x″ new If there is no obstacle between new Add to V2 and add the new node x″ new Renamed to x′ new ; S5.3, if the renamed x′ new With x new If the positions are the same, it indicates that the starting point tree and the end point tree are connected, a feasible path is found, and the path planning is completed. Otherwise, return to step S4.
7. A robot arm obstacle avoidance path planning method according to claim 6, characterized in that: In step S5, if the two trees are not connected, the number of nodes in the two trees is compared, and the tree with fewer nodes is selected for the next expansion according to the comparison result, including: S5.4, if x′ new and x″ new If there is an obstacle between them, the number of nodes in V2 and V1 is compared; S5.
5. If the number of nodes in V2 is less than the number of nodes in V1, the identifiers of V1 and V2 are exchanged. If the number of nodes in V2 is greater than or equal to the number of nodes in V1, the identifiers of V1 and V2 are not exchanged. S5.
6. Select the tree with fewer nodes as the next tree to be expanded, return to step S2, and continue to try to expand and connect the two trees until a connecting path is found.
8. A robot arm obstacle avoidance path planning system, characterized in that: include: The initialization module is used to set the starting point and target point of the robot path, add the starting point to the starting point tree node set, add the target point to the end point tree node set, and initialize the number of collision detection failures to 0; The dynamic sampling module dynamically adjusts the sampling strategy according to the value of the number of collision detection failures, switching between constrained sampling and random sampling to generate sampling points; Starting point tree extension module, including: A search unit, used to search the node closest to the sampling point in the starting point tree; A new node generation unit, used to generate a new node by extending a predetermined distance from the searched nearest node to the sampling point; A collision detection unit, used to perform collision detection on new nodes; Update unit, if there is no obstacle between the new node and the nearest node, add the new node to the starting tree node set and reset the number of collision detection failures to 0; if there is an obstacle, add 1 to the number of collision detection failures and trigger resampling; Destination tree extension module, including: A search unit, used to search in the destination tree for a node closest to the newly added node in the start tree; A new node generation unit, used to generate a new node by extending a predetermined distance from the searched nearest node to the sampling point; A collision detection unit, used to perform collision detection on new nodes; Update unit, if there is no obstacle between the new node and the nearest node, add the new node to the end tree node set and reset the number of collision detection failures; if there is an obstacle, increase the number of collision detection failures and trigger resampling; The path connectivity judgment module is used to bidirectionally connect the starting tree and the end tree to determine whether they are connected. If they are connected, a feasible path is found and the planning ends; if they are not connected, the number of nodes in the two trees is compared, and the tree with fewer nodes is selected for the next expansion based on the comparison result.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the method steps of any one of claims 1 to 7 when executed by a processor.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method steps of any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Mechanical arm obstacle avoidance path planning method based on double-balance rapid exploration random rattan
CN120395883A
Automatic vending machine control method, device, automatic vending machine and storage medium
CN122794874A