Adaptive bidirectional RRT robot arm path planning method and device

By using an adaptive bidirectional RRT robotic arm path planning method, historical collision information is used to optimize the sampling area. Combined with adaptive and forced exploration modes, the planning efficiency and quality issues of RRT-like algorithms in complex environments are solved, achieving higher success rate and real-time performance.

CN123129145APending Publication Date: 2026-11-20CHENZHI AUTOMOBILE TECHNOLOGY GROUP CO LTD CHONGQING INNOVATION RESEARCH BRANCH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611304605.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-26
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing RRT-type robotic arm path planning algorithms have low success rates and poor path quality in complex obstacle environments, and they do not effectively utilize historical collision information, making it difficult to meet real-time and path optimization requirements.

Method used

By adjusting the distance threshold based on the number of consecutive collisions and the activation function, and combining the lateral bias direction derived from historical collision points to guide sampling, an adaptive and forced exploration mode is adopted to optimize the tree growth direction and reduce the generation of invalid nodes and path redundancy.

Benefits of technology

It improves the success rate and efficiency of robotic arm path planning, reduces planning time, ensures path quality and real-time performance, and avoids the problems of blind exploration and computational complexity in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123129145A_ABST
    Figure CN123129145A_ABST
Patent Text Reader

Abstract

The application relates to a self-adaptive bidirectional RRT mechanical arm path planning method and device. A mechanical arm and an obstacle model are constructed, a start point and an end point joint configuration are set, a double tree is initialized and parameters are configured; if the start point or the end point collides, the method returns failure; if the two do not collide, the distance is less than the maximum connection distance and direct connection has no collision, the method directly returns a path; otherwise, a current tree is determined through iteration, an obstacle coefficient is calculated based on a continuous collision frequency, adaptive sampling and forced exploration are switched; when forced exploration, a new node is expanded through random sampling; when adaptive sampling, a lateral bias direction and strength are calculated based on a historical collision point, a sampling point is generated in a hypersphere or a hemispherical shell space to expand a new node and perform collision detection, parameters are updated according to the result, and double tree connection is tried; after successful connection, a complete path is generated through backtracking and splicing, and if the iteration upper limit is reached, the method returns failure. The distance threshold is modeled in the form of an activation function, the lateral bias direction removes a connection direction projection, and the obstacle coefficient is activated later than the distance threshold.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of robotic arm control technology, specifically to an adaptive bidirectional RRT robotic arm path planning method and apparatus. Background Technology

[0002] With the development of intelligent manufacturing, robotic arms have been widely used in assembly, welding, handling, automatic charging, and human-robot collaboration. Path planning, as the core technology for autonomous robotic arm movement, directly affects the system's real-time performance, safety, and operational efficiency. Currently, common robotic arm path planning algorithms mainly include graph search-based methods (such as Dijkstra's algorithm, etc.). Methods include artificial potential field methods, optimization-based methods (such as CHOMP, STOMP, and TrajOpt), and sampling-based methods (such as PRM and RRT series). Among these, the first three types of methods face bottlenecks such as dimensionality explosion caused by configuration space discretization, easy getting trapped in local minima, and strong dependence on the initial trajectory. In contrast, sampling-based methods do not require explicit decomposition of the configuration space and are more suitable for high-dimensional path planning problems.

[0003] The Rapidly-exploring Random Tree (RRT) series of algorithms has become an important direction in robotic arm path planning research due to its advantages such as probabilistic completeness, applicability to high-dimensional configuration spaces, and ease of implementation. However, existing variants still have the following shortcomings: Standard RRT and bidirectional RRT construct exploration trees through uniform random sampling, resulting in a lack of directional guidance, long planning time, low success rate in complex obstacle environments, and quality issues such as redundant nodes and long paths; RRT improves path quality through parent node reselection and rewiring mechanisms, but requires continuous optimization of the tree structure, and the computational complexity increases significantly with the number of nodes, making it difficult to meet real-time planning requirements; Informed-RRT introduces dynamic elliptical constraint domains to optimize sampling efficiency, but does not utilize historical collision information generated during collision detection, and lacks suppression and avoidance mechanisms for regions verified as having high collision probability; RRT combined with artificial potential fields enhances sampling guidance capabilities through potential field information, but does not solve the problem of the exploration tree jumping out when it gets stuck in local obstacles, and the overall planning efficiency needs to be improved.

[0004] In summary, the main shortcomings of existing RRT-like methods are: blind exploration without clear directional guidance, long planning time, low planning success rate in complex obstacle environments, poor path quality, lack of utilization of historical collision detection information, and lack of effective escape mechanisms when stuck in local obstacles. Therefore, how to utilize historical collision information to form directional and adaptively adjustable sampling guidance, how to adaptively adjust the exploration strategy based on the degree of obstruction when the exploration tree gets stuck in local obstacles and effectively escape, and how to ensure path quality while controlling computational overhead are urgent technical problems to be solved in this field. Summary of the Invention

[0005] The purpose of this invention is to provide an adaptive bidirectional RRT robotic arm path planning method and device. It achieves asymptotic bounded adjustment of the sampling area by using a distance threshold modeled in the form of an activation function based on the number of consecutive collisions. It guides the sampling to bypass obstacles laterally by using a lateral offset direction derived from historical collision points and removing the projection components of the connection direction. It also progressively triggers forced exploration when the starting point lags behind the distance threshold by increasing the obstacle coefficient, thereby improving the success rate, efficiency and path quality of robotic arm path planning in obstacle environments.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0007] In a first aspect, the present invention discloses an adaptive bidirectional RRT robotic arm path planning method, comprising:

[0008] S1: Construct the motion model of the robotic arm and the geometric model of the obstacles, set the joint configuration of the start and end points, initialize the start tree and the target tree respectively, and configure the path planning parameters and adaptive sampling parameters;

[0009] S2: Perform collision detection on the start point and the end point respectively; if there is a collision between the start point and the end point, return planning failure; if there is no collision between the start point and the end point and the Euclidean distance between them is less than the preset maximum connection distance, then perform collision detection on the straight path from the start point to the end point. If there is no collision, return the straight path directly as the planning result; otherwise, proceed to step S3.

[0010] S3: Determine whether the current iteration count has reached the preset maximum iteration count. If it has, return that the planning failed; otherwise, proceed to step S4.

[0011] S4: Determine the current tree and another tree responsible for expansion in the current iteration;

[0012] S5: Calculate the obstacle coefficient based on the number of consecutive collisions of the current tree, and determine whether to enter the adaptive sampling mode or the forced exploration mode based on the obstacle coefficient;

[0013] S6: If forced exploration mode is entered, random sampling is performed in the joint space, and the node closest to the sampling point is selected on the current tree for expansion. When the expansion is successful, the relevant parameters are updated, and then the process returns to step S3.

[0014] S7: If the adaptive sampling mode is entered, the lateral offset direction and lateral offset intensity are calculated based on the historical collision points, and adaptive sampling points are generated in the hypersphere space or hemispherical shell space in combination with the distance threshold.

[0015] The system attempts to expand a new node using the adaptive sampling points and performs collision detection. If a collision occurs, the system updates the number of consecutive collisions, the distance threshold, and the obstacle coefficient, and then returns to step S3. If no collision occurs, the new node is added to the current tree, the system updates the number of consecutive collisions, the distance threshold, and the obstacle coefficient, and then attempts to expand another tree. The system then determines whether the distance between the end nodes of the two trees is less than the preset maximum connection distance. If so, the system attempts to connect the two trees. If the connection is successful, the system executes step S8; otherwise, the system returns to step S3.

[0016] S8: Backtrack from the end nodes of the two trees to their respective root nodes, concatenate them to generate a complete path, and return.

[0017] In one embodiment, the rules for calculating the distance threshold and updating the number of consecutive collisions are as follows:

[0018] The number of collisions between the terminal nodes of the starting tree and the target tree during continuous expansion is recorded, along with the Euclidean distance between the terminal nodes of the two trees. Based on the Euclidean distance, the number of consecutive collisions, and the expansion step size, the distance thresholds for the two trees are calculated. The distance thresholds are calculated using an activation function, such that the distance threshold increases slowly when the number of consecutive collisions is small, increases rapidly when the number of consecutive collisions is large, and approaches its upper limit when the number of consecutive collisions continues to increase. When no collision occurs during the expansion of the terminal node, the number of consecutive collisions is set to zero, and the initial value of the distance threshold between the two trees is set to the Euclidean distance between the terminal nodes of the two trees.

[0019] In adaptive sampling mode, each time a collision occurs while expanding a new node, the consecutive collision count is incremented and the distance threshold is updated according to the activation function; after successfully expanding a new node, the consecutive collision count decays in the following segmented manner:

[0020] Number of consecutive collisions before expansion At that time, the updated number of consecutive collisions ;

[0021] Number of consecutive collisions before expansion At that time, the updated number of consecutive collisions

[0022] ;

[0023] in, This represents the number of consecutive collisions updated after the current tree node is expanded. The number of consecutive collisions before the new node is expanded. To preset the attenuation ratio, Indicates rounding down;

[0024] In forced exploration mode, after successfully expanding a new node, the number of consecutive collisions is immediately reset to zero, and the distance threshold is reset to the current Euclidean distance between the end nodes of the two trees.

[0025] In one embodiment, the method for calculating the lateral offset direction and lateral offset intensity based on historical collision points in step S7 is as follows:

[0026] Maintain a collision point storage list. In adaptive sampling mode, each time a new node is expanded and a collision occurs, add the collision point coordinates to the collision point storage list.

[0027] During each adaptive sampling, the following calculations are performed:

[0028] Calculate the main reference direction, which is the unit vector from the current tree end node to the end node of another tree;

[0029] Traverse the list of collision points and calculate the position offset vector and distance of each historical collision point relative to the end node of another tree.

[0030] Based on the position offset vector and distance, calculate the repulsive force direction and weight corresponding to each collision point, where the closer the distance, the greater the weight;

[0031] The total repulsive force vector is obtained by summing the weighted repulsive forces at all collision points, and then normalized to obtain the direction of the total repulsive force.

[0032] Remove the projection component of the total repulsive force direction in the main reference direction to obtain the lateral component, and normalize the lateral component to obtain the lateral offset direction.

[0033] The lateral bias strength is determined based on the magnitude of the lateral component.

[0034] In one embodiment, step S7 involves generating adaptive sampling points within the hyperspherical space or hemispherical shell space by incorporating a distance threshold:

[0035] Generate a first random number and a second random number, both of which are random numbers within the interval [0,1]. The generation method for sampling points is determined according to the following three mutually exclusive conditions:

[0036] If the first random number is less than the preset target bias probability, then the end node of the other tree is directly used as the sampling point;

[0037] If the first random number is not less than the target bias probability and the second random number is less than the hypersphere sampling probability, then adaptive sampling is performed in a hypersphere with the end node of another tree as the center and the distance between the end nodes of the two trees as the radius to obtain sampling points.

[0038] If the first random number is not less than the target bias probability and the second random number is not less than the hypersphere sampling probability, then adaptive sampling is performed in a hemispherical shell region with the end node of another tree as the center, the radius of which is between the distance between the end nodes of the two trees and the current tree distance threshold, and biased towards the end node of the current tree, to obtain sampling points.

[0039] The formula for calculating the sampling probability of the hypersphere is:

[0040] ;

[0041] Where P is the hypersphere sampling probability, and N is the number of consecutive collisions in the current tree. As a preset first constant, As a preset second constant, The sigmoid function; denominator The normalization term is such that P=1 when N=0; as N increases, P decreases monotonically, and the probability of the hemispherical shell region being selected increases accordingly; when N=0, the distance threshold is equal to the distance between the end nodes of the two trees, the hemispherical shell region degenerates, and P=1 ensures that sampling only occurs within the hypersphere.

[0042] In one embodiment, the specific steps for adaptive sampling within the hypersphere include:

[0043] Generate a random unit vector as the initial sampling direction;

[0044] The corrected sampling direction is obtained by superimposing the lateral offset direction and the lateral offset intensity on the initial sampling direction;

[0045] Generate random radii within the range of zero to the hypersphere radius;

[0046] Using the joint configuration of the end node of another tree as the center of the sphere, the random radius is offset along the corrected sampling direction to obtain the hypersphere sampling point.

[0047] In one embodiment, the specific steps for adaptive sampling within the hemispherical shell region include:

[0048] Generate a random unit vector as the initial sampling direction;

[0049] Determine whether the initial sampling direction is towards the half-shell space on one side of the current tree end node. If so, retain it; otherwise, regenerate a random unit vector until the condition is met.

[0050] The corrected sampling direction is obtained by superimposing the lateral offset direction and lateral offset intensity on the retained direction;

[0051] Generate a random radius within the range of the distance between the end nodes of the two trees and the current tree distance threshold;

[0052] Using the joint configuration of the end node of another tree as the center of the sphere, the random radius is offset along the corrected sampling direction to obtain the hemispherical shell sampling point.

[0053] In one embodiment, the method for calculating the hindering coefficient and determining the mode in step S5 is as follows:

[0054] The obstacle coefficient of the current tree is calculated based on the number of consecutive collisions. The calculation formula is as follows: ;

[0055] Where H is the obstacle coefficient of the current tree, and N is the number of consecutive collisions in the current tree. As a preset first constant, As a preset second constant, It is the sigmoid function;

[0056] The generation pattern determines the random number r. If r < H, then enter the forced exploration mode; otherwise, enter the adaptive sampling mode.

[0057] In one embodiment, the forced exploration mode in step S6 is specifically implemented as follows:

[0058] a) Randomly sample a set of joint configurations within each dimension of the joint space;

[0059] b) Find the tree node in the current tree that has the closest Euclidean distance to the joint configuration, and designate it as the nearest tree node;

[0060] c) Move a preset step size from the nearest tree node along the direction toward the joint configuration to obtain a candidate joint configuration;

[0061] d) Calculate the Euclidean distance from the candidate joint configuration to the end node of another tree. If the Euclidean distance is less than the distance threshold of the current tree, return to step a) to resample. If the Euclidean distance is not less than the distance threshold of the current tree, perform collision detection on the straight path between the nearest tree node and the candidate joint configuration with a preset step size. If a collision is detected, the forced exploration fails and return to step S3.

[0062] e) If no collision is detected, create a new node with the candidate joint configuration and add it to the current tree, clear the number of consecutive collisions to zero, reset the distance threshold to the current Euclidean distance between the end nodes of the two trees, recalculate the obstacle coefficient based on the cleared number of consecutive collisions, and then return to step S3.

[0063] In one embodiment, after successfully expanding a new node in step S7 and before attempting to expand another tree, a rewiring optimization step is also included; the path cost mentioned here is the cumulative path cost from the current root node to the corresponding node:

[0064] Centered on the newly expanded node, search for existing nodes in the current tree within the joint space of the preset rewire radius;

[0065] For the new node itself, traverse all nodes in the neighborhood, calculate the path cost of the new node when each node is the parent node of the new node, select the node that minimizes the path cost as the optimal parent node, update the parent node of the new node to the optimal parent node and update the path cost of the new node.

[0066] For each other node in the neighborhood, determine whether the sum of the path cost of the new node and the path cost from the new node to the current node is less than the current path cost of the current node; if so, update the parent node of the current node to the new node, and update the path cost of the current node and the cumulative path cost of all successor nodes in the subtree rooted at the current node.

[0067] Secondly, the present invention discloses an adaptive bidirectional RRT robotic arm path planning device, comprising:

[0068] The model building and initialization module is used to build the robotic arm motion model and obstacle geometry model, set the start and end joint configurations, initialize the start tree and target tree respectively, and configure path planning parameters and adaptive sampling parameters.

[0069] The collision detection and direct connection judgment module is used to perform collision detection on the starting point and the ending point respectively. If there is a collision at the starting point or the ending point, the planning failure is returned. If there is no collision between the starting point and the ending point and the Euclidean distance between them is less than the preset maximum connection distance, then the collision detection is performed on the straight path from the starting point to the ending point. If there is no collision, the straight path is directly returned as the planning result.

[0070] The iteration and tree selection control module is used to determine whether the current iteration count has reached the preset maximum iteration count. If it has, the planning failure is returned. If it has not, the current tree and another tree responsible for expansion in the current iteration are determined.

[0071] The mode determination and sampling module is used to calculate the obstacle coefficient based on the number of consecutive collisions of the current tree to determine whether to enter the adaptive sampling mode or the forced exploration mode. In the adaptive sampling mode, the lateral offset direction and lateral offset intensity are calculated based on the historical collision points, and adaptive sampling points are generated in the hypersphere space or hemispherical shell space in combination with the distance threshold. In the forced exploration mode, random sampling is performed in the joint space.

[0072] The tree expansion and parameter update module is used to expand new nodes with sampling points and perform collision detection, and update the number of consecutive collisions, distance threshold and obstacle coefficient according to the detection results.

[0073] The path connection and generation module is used to determine whether the distance between the end nodes of two trees is less than the preset maximum connection distance. If so, it attempts to connect the two trees. After the connection is successful, it backtracks from the end nodes of the two trees to their respective root nodes and splices them together to generate a complete path.

[0074] Compared with the prior art, the present invention has the following beneficial effects:

[0075] 1. This invention combines historical collision information with distance threshold guidance for adaptive sampling, providing clear directional guidance for tree growth: when there are no obstacles, sampling is concentrated within the hypersphere facing the target direction; when there are obstacles, it guides the tree to bypass the obstacles through progressive expansion based on distance thresholds and lateral offset. Compared to the uniform random growth of traditional RRT-like methods, this significantly reduces the generation of invalid nodes, decreases the number of collision detections, saves planning time, and better meets the real-time requirements of robotic arm path planning.

[0076] 2. The distance threshold of this invention is calculated using an activation function. When the number of consecutive collisions is small, the increase is slow; when the number of collisions is large, the increase is faster; and when the number of collisions continues to increase, the threshold tends to be reached. This achieves a gradual transition of the sampling area from conservative to expansion, avoiding premature interference with the normal expansion directionality and also avoiding sampling divergence caused by unbounded expansion of the area. When there is no collision during expansion, the number of consecutive collisions is set to zero, and the distance threshold is restored to the distance between the ends of the two trees, so that the sampling area can expand and shrink, with strong adaptability.

[0077] 3. This invention accumulates weighted repulsive forces based on historical collision points and removes the projection component of the total repulsive force direction on the main reference direction to obtain the lateral offset direction. This ensures that the sampling offset only acts on the lateral direction to bypass obstacles and does not generate a backward component that deviates from another tree. It effectively bypasses obstacles while maintaining the bidirectional tree connection trend. It does not require explicit modeling of spatial obstacles before planning, and the calculation is simple, which is superior to the potential field superposition method of APF-RRT.

[0078] 4. The tree nodes generated by this invention are sparser than those of RRT-Star. The neighborhood search range for parent node reselection and rewiring operations is smaller and takes less time, while maintaining the same local path optimization effect. This saves planning time and ensures better path quality. The planned initial path has fewer twists and turns and less node redundancy compared to traditional RRT.

[0079] 5. The impedance coefficient of this invention is calculated using the sigmoid function, and the offset term is... Its growth start point lags behind the growth start point of the distance threshold, forming a two-level escape mechanism: first, threshold retreat guides adaptive obstacle avoidance, and then, when severely trapped, it gradually triggers forced exploration. The forced exploration mode eliminates candidate configurations that fall within the distance threshold, so that the exploration samples fall outside the adaptive sampling area, truly playing the role of jumping out of local obstacles and solving the local minimum problem of APF-RRT.

[0080] 6. After successful expansion, the number of consecutive collisions in this invention decays in segments rather than being directly reset to zero. This applies when the collision history is deep. Retain some collision memory to avoid misjudging the blockage as cleared based on a single successful collision; when the collision history is relatively short... It can be directly reset to zero, quickly restoring normal expansion efficiency while balancing responsiveness and exploration continuity. Attached Figure Description

[0081] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0082] Figure 1 A flowchart illustrating the adaptive bidirectional RRT robotic arm path planning method provided in an embodiment of the present invention;

[0083] Figure 2 This is a schematic diagram of a planning scenario that requires bypassing obstacles in an embodiment of the present invention, wherein the left figure is a view of the planning starting point position and the right figure is a view of the planning ending point position;

[0084] Figure 3 This is a schematic diagram of a complex planning scenario that requires bypassing obstacles in an embodiment of the present invention, wherein the left figure is a view of the planning starting point and the right figure is a view of the planning ending point;

[0085] Figure 4 for Figure 2 A schematic diagram of the path planned using the standard RRT algorithm in the planning scenario shown.

[0086] Figure 5 for Figure 2 A schematic diagram of the path planned based on the RRT-STAR algorithm in the planning scenario shown.

[0087] Figure 6 for Figure 2 A schematic diagram of the path planned using the bidirectional RRT algorithm in the planning scenario shown.

[0088] Figure 7 for Figure 2The diagram shows the path planned by the adaptive bidirectional RRT robotic arm path planning method of this invention in the planning scenario shown. Detailed Implementation

[0089] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.

[0090] With the development of intelligent manufacturing, robotic arms have been widely used in assembly, welding, handling, automatic charging, and human-robot collaboration. Path planning, as the core technology for autonomous robotic arm movement, directly affects the system's real-time performance, safety, and operational efficiency. Currently, common robotic arm path planning algorithms mainly include graph search-based methods (such as Dijkstra's algorithm, etc.). Methods include artificial potential field methods, optimization-based methods (such as CHOMP, STOMP, and TrajOpt), and sampling-based methods (such as PRM and RRT series). Among these, the first three types of methods face bottlenecks such as dimensionality explosion caused by configuration space discretization, easy getting trapped in local minima, and strong dependence on the initial trajectory. In contrast, sampling-based methods do not require explicit decomposition of the configuration space and are more suitable for high-dimensional path planning problems.

[0091] Among sampling-based methods, the RRT series of algorithms has become an important direction in robotic arm path planning research due to its advantages such as probabilistic completeness, applicability to high-dimensional configuration spaces, and ease of implementation. However, existing variants still have the following shortcomings: Standard RRT and bidirectional RRT construct exploration trees through uniform random sampling, resulting in a lack of directional guidance, long planning time, low planning success rate in complex obstacle environments, and quality issues such as redundant nodes and long paths; RRT improves path quality through parent node reselection and rewiring mechanisms, but requires continuous optimization of the tree structure, and the computational complexity increases significantly with the number of nodes, making it difficult to meet real-time planning requirements; Informed-RRT introduces dynamic elliptical constraint domains to optimize sampling efficiency, but does not utilize historical collision information generated during collision detection, and lacks suppression and avoidance mechanisms for regions verified as having high collision probability; RRT combined with artificial potential fields enhances sampling guidance capabilities through potential field information, but does not solve the problem of jumping out when the exploration tree gets stuck in local obstacles, and the overall planning efficiency needs to be improved.

[0092] To address the aforementioned issues, this invention provides an adaptive bidirectional RRT robotic arm path planning method and apparatus. It achieves asymptotic bounded adjustment of the sampling area by using a distance threshold modeled in the form of an activation function based on the number of consecutive collisions. It guides the sampling lateral obstacle avoidance by using a lateral offset direction derived from historical collision points and after removing the projection components of the connection direction. Furthermore, it progressively triggers forced exploration when severely trapped by increasing the obstacle coefficient, which lags behind the distance threshold at the starting point. This improves the success rate, efficiency, and path quality of robotic arm path planning in obstacle environments.

[0093] Reference Figure 1 This embodiment provides an adaptive bidirectional RRT robotic arm path planning method, including the following steps:

[0094] Step S1: Construct the motion model of the robotic arm and the geometric model of the obstacles, and initialize the planning environment.

[0095] Specifically, based on the actual structural parameters of the robotic arm (such as link length, joint type, and number), a forward kinematics model of the robotic arm is established using the Denavit-Hartenberg (DH) parameter method or product model data, mapping the joint space configuration to pose in Cartesian space. Simultaneously, obstacles in the workspace are geometrically modeled, using bounding boxes (AABB / OBB), spheres, cylinders, or meshes to approximate their shapes for subsequent collision detection. The joint configuration q_start for the planning start point and q_goal for the planning end point are set, and the start tree start_tree and the goal tree goal_tree are initialized with q_start and q_goal as root nodes, respectively. Path planning parameters are configured, including the maximum number of iterations N_max, the expansion step size max_step_size, and the preset maximum connection distance. Preset target bias probability P_goal, rewire radius r_rewire, etc.; configure adaptive sampling parameters, including a preset first constant. Preset second constant Preset attenuation ratio , lateral offset strength coefficient, etc.

[0096] For example, the joint configuration of the starting point is q_start=[1.1,-0.99,1.39,1.45,1.2,-1.85].

[0097] The endpoint joint configuration q_goal=[-0.72,1.2,0.73,3.14,1.86,0.8].

[0098] Step S2: Start-end collision detection and direct connection judgment.

[0099] Collision detection is performed on the starting point q_start and the ending point q_goal to determine whether the robotic arm collides with an obstacle or itself under this joint configuration. If a collision occurs at the starting point or the ending point, the planning task is deemed infeasible and a planning failure is returned. If there is no collision between the starting point and the ending point, the Euclidean distance d(q_start, q_goal) between them in the joint space is calculated; if this distance is less than the preset maximum connection distance... If the straight path between the starting point and the ending point (i.e., the line segments in the joint space are discretized and sampled at a preset resolution) is collision detected, if there is no collision on the straight path, the straight path is returned directly as the planning result without entering iterative planning; otherwise, step S3 is executed.

[0100] Step S3: Iteration termination judgment.

[0101] Determine if the current iteration count `iter` has reached the preset maximum iteration count `N_max`. If `iter` ≥ `N_max`, return "planning failed"; otherwise, proceed to step S4.

[0102] Step S4: Determine the current tree and the other tree responsible for expansion in the current iteration.

[0103] The current tree (current_tree) and the other tree (other_tree) responsible for expansion in this iteration are determined by employing either an alternating expansion strategy or a heuristic selection strategy based on tree size. For example, the starting tree and the target tree can be alternately selected as the current tree, or the tree with fewer nodes can be selected as the current tree to maintain a balance in the size of the two trees.

[0104] Step S5: Mode determination.

[0105] Based on the number of consecutive collisions N in the current tree (current_tree), calculate the obstacle coefficient H, and determine whether to enter the adaptive sampling mode or the forced exploration mode based on the obstacle coefficient.

[0106] Step S6: Forced exploration mode.

[0107] If step S5 determines that the forced exploration mode has been entered, random sampling is performed in the joint space, and the node closest to the sampling point is selected on the current tree for expansion. When the expansion is successful, the relevant parameters are updated, and then the process returns to step S3.

[0108] Step S7: Adaptive sampling mode.

[0109] If step S5 determines that the adaptive sampling mode has been entered, the lateral offset direction and lateral offset intensity are calculated based on historical collision points, and adaptive sampling points are generated in the hypersphere space or hemispherical shell space in combination with the distance threshold. New nodes are then attempted to be expanded using these adaptive sampling points, and collision detection is performed. If a collision occurs, the number of consecutive collisions, the distance threshold, and the obstruction coefficient are updated, and the process returns to step S3. If no collision occurs, the new node is added to the current tree, the number of consecutive collisions, the distance threshold, and the obstruction coefficient are updated, and another tree is attempted to be expanded. Then, it is determined whether the distance between the end nodes of the two trees is less than the preset maximum connection distance. If so, an attempt is made to connect the two trees; if the connection is successful, step S8 is executed; otherwise, the process returns to step S3.

[0110] Step S8: Path splicing and output.

[0111] Starting from the end nodes of the two trees, backtrack along the parent node pointers to their respective root nodes to obtain two sub-paths; concatenate the sub-path of the starting tree and the sub-path of the target tree at the connection point to generate a complete path from q_start to q_goal and return it.

[0112] The overall method framework provided in this embodiment organically combines adaptive sampling mode and forced exploration mode to form a three-level progressive strategy: normal guidance, adaptive obstacle avoidance, and forced exit. When there are no obstacles, sampling is concentrated in the hypersphere facing the target direction. When there are obstacles, the system guides the robot to avoid obstacles by progressively expanding the distance threshold and using lateral offset. When the robot is severely trapped, it uses forced exploration to exit the local area. Compared with the uniform random growth of traditional RRT-like methods, this significantly reduces the generation of invalid nodes, reduces the number of collision detections, saves planning time, and better meets the real-time requirements of robotic arm path planning.

[0113] As an optional implementation of this application, the calculation method of the distance threshold and the update rules for the number of consecutive collisions are described in detail.

[0114] Initialization and calculation of the distance threshold: Record the number of collisions N_start and N_goal between the terminal nodes of the starting tree and the target tree during continuous expansion, respectively, and record the optimal Euclidean distance best_distance between the terminal nodes of the two trees. Based on the optimal Euclidean distance, the number of consecutive collisions, and the preset maximum connection distance... Calculate the distance threshold between the two trees respectively.

[0115] First, calculate the distance threshold coefficient β1 of the starting tree based on the number of consecutive collisions of the starting tree:

[0116] .

[0117] Then calculate the distance threshold of the starting tree: ;

[0118] Similarly, the distance threshold coefficient of the target tree is calculated based on the number of consecutive collisions with the target tree. :

[0119] .

[0120] Then, the distance threshold of the target tree is calculated: ;

[0121] in, As a preset first constant, As a preset second constant, For the sigmoid function, specifically, the expression for the sigmoid function is: .

[0122] The distance threshold coefficient is calculated using an activation function: when the number of collisions N_start and N_goal are small, the distance thresholds start_tree_distance_threshold and goal_tree_distance_threshold increase very slowly, encouraging continued exploration when encountering an obstacle for the first time; when the number of collisions is large, the distance threshold increases faster, encouraging exploration to the side to bypass obstacles when encountering moderate obstacles; as the distance threshold continues to increase, it changes slowly again after approaching its upper limit, meaning that when severely trapped in an obstacle and unable to get out, it no longer encourages retreating through further thresholds, and instead forces an exploration mode to escape the current local area.

[0123] Since the sigmoid function takes values ​​in the range (0,1), the distance threshold coefficient... The value range of is (0, 5), therefore the upper limit of the distance threshold is . This enables the bounded expansion of the sampling area.

[0124] When no collision has occurred during the exploration of the end node, N_start=0, N_goal=0, and the initial distance threshold between the two trees is assigned to the best Euclidean distance, best_distance.

[0125] Collision Update in Adaptive Sampling Mode: In adaptive sampling mode, each time a collision occurs while expanding a new node, the consecutive collision count is incremented by one, and the distance threshold is recalculated based on the activation function described above. The distance threshold increases with the number of collisions, causing the sampling area to gradually expand away from the connecting axis, guiding the exploration tree to bypass obstacles.

[0126] Attenuation after successful expansion in adaptive sampling mode: After successfully expanding to a new node, the number of consecutive collisions decreases in the following segmented manner:

[0127] Number of consecutive collisions before expansion At that time, the updated number of consecutive collisions ;

[0128] Number of consecutive collisions before expansion At that time, the updated number of consecutive collisions

[0129] ;

[0130] in, This represents the number of consecutive collisions updated after the current tree node is expanded. The number of consecutive collisions before the new node is expanded. This is a preset attenuation ratio, for example, a preset attenuation ratio of 0.5. Indicates rounding down;

[0131] The meaning of this segmented attenuation strategy is: For collisions with a shallow history... At this time, a successful expansion is considered to have removed the obstacle, and the consecutive collision count is immediately reset to zero to quickly restore normal expansion efficiency; a deeper collision history At the same time, some collision memory is retained and attenuated proportionally instead of being completely cleared, to avoid misjudging that the obstacle has been removed due to a single accidental success, and to maintain caution in exploration.

[0132] In forced exploration mode, after successfully expanding a new node, the number of consecutive collisions is immediately reset to zero, and the distance threshold is reset to the current Euclidean distance between the end nodes of the two trees, so that the system is completely restored to the initial guidance state.

[0133] In this implementation, the distance threshold is modeled using an activation function to achieve a gradual transition of the sampling region from conservative to expansionary. Specifically, when the number of consecutive collisions is small, the increase is slow to avoid prematurely interfering with the directionality of normal expansion; when the number is large, the increase accelerates, rapidly expanding the search range to find obstacle avoidance paths; and as it continues to increase, it tends towards its upper limit to prevent unbounded expansion of the region from causing sampling divergence. When expanding to a collision-free state, the number of consecutive collisions is reset to zero, and the distance threshold is restored to the distance between the ends of the two trees, allowing the sampling region to expand and shrink with strong adaptability. The segmented decay mechanism balances response sensitivity and exploration continuity: shallow collision history is quickly cleared to restore efficiency, while deep collision history retains memory to avoid misjudgment, ensuring that the system is neither too conservative nor too aggressive during obstacle avoidance.

[0134] As an optional implementation of this application, the method for calculating the lateral offset direction and lateral offset intensity based on historical collision points in step S7 is described in detail.

[0135] During each adaptive sampling, the lateral offset direction and intensity are calculated based on the historical collision points stored in the collision_points list. The specific method is as follows:

[0136] 1) Maintenance of the collision point storage list.

[0137] Read the historical collision points stored in `collision_points`. In adaptive sampling mode, the coordinates of the collision point are added to the `collision_points` list each time a new node is expanded and a collision occurs.

[0138] 2) Calculation of the main reference direction.

[0139] Calculate the vector pointing from the current tree's end node `current_tree_latest_node` to the end node of another tree `other_tree_latest_node`, defining it as the "forward" direction. Subsequent calculations will only retain the lateral repulsive force perpendicular to this direction. The formula for calculating the main reference direction vector is as follows:

[0140] main_dir=other_tree_latest_node.q-current_tree_latest_node.q;

[0141] ;

[0142] Wherein, main_dir is the main reference direction vector, other_tree_latest_node.q is the joint configuration vector stored in the most recently successfully added end node of another tree, current_tree_latest_node.q is the joint configuration vector stored in the most recently successfully added end node of the current extended tree, and main_dir is the unit main reference direction vector. The Euclidean norm (modulus) of main_dir is numerically equal to the distance between the end nodes of the two trees in the configuration space.

[0143] 3) Calculation of repulsive force at each collision point.

[0144] Calculate each historical collision point sequentially. The offset vector diff and distance dist relative to the end node of the other tree, other_tree_latest_node:

[0145] ;

[0146] .

[0147] in, Let diff be the Euclidean norm (modulus).

[0148] 4) Calculate the repulsive force direction (force_dir) and repulsive force magnitude weight for each historical collision point based on the position offset vector and distance, using the following formula:

[0149] ;

[0150] .

[0151] The repulsive force points outward from the point of collision, that is, away from the point of collision, while the diff points outward from the goal. Therefore, the direction of the repulsive force must be reversed, and the closer the point of collision, the greater the weight of the repulsive force.

[0152] 5) Sum the weighted repulsive forces of all historical collision points to obtain the total repulsive force. The direction of the total repulsive force is obtained by normalization. The calculation formula is as follows:

[0153] ;

[0154] .

[0155] like If the value is 0, then set bias_dir=0 and bias_strength=0, and process the sample as a normal random sample.

[0156] 6) Subtracting its projected component along the main reference direction (unit vector main_dir) yields the lateral component. Normalization yields the lateral offset direction bias_dir, calculated using the following formula:

[0157] ;

[0158] .

[0159] like =0, and is processed as a normal random sampling.

[0160] 7) Calculate the lateral offset strength based on the magnitude of the lateral force: .

[0161] This implementation obtains the lateral offset direction by removing the projected component of the total repulsive force direction onto the main reference direction. This ensures that the sampling offset only acts in the lateral direction around obstacles, without generating a backward component that deviates from another tree, effectively bypassing obstacles while maintaining the bidirectional tree connection trend. Compared to APF-RRT's method of directly superimposing potential forces in the sampling direction, this method is more computationally simpler and avoids the oscillation problem common in potential field methods. Furthermore, it eliminates the need for explicit modeling of spatial obstacles before planning; guidance can be achieved solely using collision point information naturally generated during collision detection, resulting in zero additional cost for information acquisition.

[0162] As an optional implementation of this application, a detailed description is provided of the method for generating adaptive sampling points in the hypersphere space or hemispherical shell space by combining a distance threshold in step S7.

[0163] 1) Sampling area selection.

[0164] Generate a first random number r1 and a second random number r2, both of which are random numbers within the interval [0,1]. The generation method of the sampling points is determined according to the following three mutually exclusive conditions:

[0165] like (Preset target bias probability), then directly use the end node q_other of the other tree as the sampling point, so that the current tree grows directly in the target direction;

[0166] like and (Hypersphere sampling probability) means that adaptive sampling is performed within a hypersphere with the end node of the other tree as the center and the distance d_end between the end nodes of the two trees as the radius;

[0167] like and Then, with the end node of another tree as the center of the sphere and a radius of... Adaptive sampling is performed within the hemispherical shell region between and biased towards the current tree's end node.

[0168] The formula for calculating the sampling probability P of the hypersphere is: ;

[0169] Where P is the hypersphere sampling probability, and N is the number of consecutive collisions in the current tree. As a preset first constant, As a preset second constant, The sigmoid function; denominator The normalization term is such that P=1 when N=0; as N increases, P decreases monotonically, and the probability of the hemispherical shell region being selected increases accordingly; when N=0, the distance threshold is equal to the distance between the end nodes of the two trees, the hemispherical shell region degenerates, and P=1 ensures that sampling only occurs within the hypersphere.

[0170] As an optional implementation of this application, the robotic arm is a six-degree-of-freedom robotic arm, and its joint configuration space is a six-dimensional space. In each iteration, when it is determined that a new node needs to be generated using an adaptive sampling strategy in the hypersphere space, the following steps are performed to generate a sampling point q_sample with a lateral offset of the historical collision point in a six-dimensional hypersphere centered on the end node of another tree.

[0171] Step 1: Generate random directions.

[0172] The random direction dir is obtained by generating a random six-dimensional unit vector. Specifically, a six-dimensional vector is first sampled from a six-dimensional standard normal distribution, and then normalized to its L2 norm. The calculation formula is as follows:

[0173] ,in, ;

[0174] In the formula, This represents a vector with zero mean and a covariance matrix that is a sixth-order identity matrix. The six-dimensional standard normal distribution of dir means that each component of dir independently follows a standard normal distribution N(0,1); This represents the L2 norm (Euclidean norm) of the vector. This normalization operation ensures that the resulting dir is a unit direction vector uniformly distributed on a six-dimensional unit hypersphere, thus guaranteeing the isotropic basis of subsequent sampling.

[0175] Step 2: Overlay the lateral offset of historical collision points to obtain the final sampling direction.

[0176] The initial random direction `dir` obtained in step 1 is weighted and fused with the previously calculated lateral offset direction `bias_dir` to obtain the final sampling direction `final_dir`. First, the fusion coefficient α is calculated based on the lateral bias strength `bias_strength` and the repulsion strength `repulsion_strength`:

[0177] α=min(0.85,bias_strength·repulsion_strength);

[0178] Then calculate the final sampling direction: .

[0179] In the formula, bias_strength is the calculated lateral bias strength, with a value range of [0,1]; repulsion_strength is the repulsion strength coefficient, which is used to adjust the influence of the repulsion at the historical collision point on the sampling direction. It can be set according to the actual working conditions, for example, 1.0. The smaller of the two values ​​is taken. The fusion coefficient α is truncated to an upper limit of 0.85 to ensure that at least 15% of the random direction component is always retained in the final sampling direction, avoiding the loss of random exploration due to the sampling direction being completely dominated by bias, and preventing the algorithm from getting stuck in local regions. When bias_strength=0, that is, there is no effective lateral bias information, α=0, and final_dir degenerates into a purely random direction dir.

[0180] Step 3: Calculate the random radius.

[0181] The radius (radius) is sampled uniformly within a six-dimensional hypersphere, and the calculation formula is as follows:

[0182] , among which U~U(0,1).

[0183] In the formula, best_distance is the optimal distance between the end nodes of the two trees, i.e., the distance between the two end nodes in the joint configuration space, which is used as the scale reference of the hypersphere; U is a random variable that follows a uniform distribution on the interval (0,1); the exponent 1 / 6 is the radius transformation exponent necessary to ensure the uniform distribution of sampling points within the hypersphere volume in six-dimensional space. When sampling uniformly in the d-dimensional hypersphere volume, the exponent is 1 / d, where d=6. This radius generation method ensures that the sampling points cover both the region near the center of the sphere and the region near the surface of the sphere, and the probability on each radial shell is proportional to its volume.

[0184] Step 4: Generate the final sampling point. Use the joint configuration `other_tree_latest_node.q` of the most recently added end node of the other tree as the center of the sphere. Offset the radius radius along the final sampling direction final_dir to generate the final six-dimensional hypersphere sampling point q_sample with the lateral offset of historical collision points. The calculation formula is as follows:

[0185] ;

[0186] .

[0187] In the formula, q_sample represents the coordinates of the hypersphere's center, i.e., the coordinates of the end node of another tree in the joint configuration space; q_sample represents the candidate sampled joint configuration generated this time, which will be used for subsequent collision detection and node expansion.

[0188] Sampling within the hypersphere as specified above ensures that newly generated nodes are closer to the end of another tree than the end of the current tree, thus promoting the two search trees to approach each other and attempt to connect, accelerating path connectivity. At the same time, since the final sampling direction final_dir incorporates the lateral bias direction bias_dir calculated from historical collision points, the sampling points carry a lateral repulsive force component that bypasses known obstacle areas, which can guide the search tree to better bypass obstacles, improving the success rate and efficiency of planning in narrow passages and high obstacle density environments.

[0189] If the generated q_sample exceeds the joint limit range, its joint components are truncated to the corresponding joint limit interval; if the q_sample is determined to be in a collision state by collision detection, the sampling point is discarded and regenerated according to the above steps until a valid sampling point in free space is obtained or the preset maximum number of resampling times is reached.

[0190] The specific steps of adaptive sampling within the hemispherical shell region include:

[0191] Step 1: Generate random direction. The random direction dir is obtained by generating a random six-dimensional unit vector:

[0192] ,in, ,

[0193] Step 2: Determine which half of the spherical shell the direction vector points to. Calculate the axial vector v from the center of the sphere to the current end node of the tree:

[0194] .

[0195] like If the direction vector dir is directed towards the half-space closer to the current_tree_latest_node, proceed to step 3; otherwise, discard the current dir and return to step 1 to regenerate a random direction.

[0196] Step 3: Add the lateral offset of the historical collision points to the initial direction vector.

[0197] ;

[0198] .

[0199] In the formula, bias_strength is the lateral bias strength calculated above, repulsion_strength is the repulsion strength coefficient; the fusion coefficient α is capped at 0.85 to ensure that no less than 15% of the random exploration component is retained in the final direction.

[0200] Since bias_dir is perpendicular to the main reference direction main_dir, and main_dir is opposite to the v direction, bias_dir·v=0, and therefore final_dir·v=(1-α)(dir·v)>0. That is, the fused direction still points to the preserved half space, which mathematically guarantees that the sampling point falls into the hemispherical shell region near the current tree end node.

[0201] Preferably, to avoid the actual sampling radius shrinking due to the magnitude being less than 1 after the weighted fusion of the two unit vectors, potentially falling below the inner diameter of the spherical shell, final_dir is further normalized: .

[0202] Step 4: Calculate the random radius.

[0203] ,U~U(0,1)

[0204] In the formula, The current_tree_distance_threshold, which is the preset distance threshold of the current tree, is used as the outer diameter of the spherical shell. Let `best_distance` be the optimal distance between the end nodes of the two trees, and use it as the inner diameter of the sphere; in this embodiment, `current_tree_distance_threshold` > `best_distance`. Since the volume of a six-dimensional sphere is proportional to the sixth power of its radius, the above formula makes... exist and The sampling points are evenly distributed within the six-dimensional spherical shell, thus ensuring that the sampling points are evenly distributed by volume.

[0205] Step 5: Generate the final sampling point. Use other_tree_latest_node.q as the center of the sphere. Generate the final six-dimensional hemispherical shell sampling points with lateral offsets from historical collision points:

[0206] ;

[0207] .

[0208] When entering the hyperspherical shell for sampling, the number of consecutive collisions is already relatively large, indicating that the obstacles in the front local area are relatively complex. If sampling is still performed directly in the area between the ends of the two trees, the same obstacle will likely be encountered repeatedly. Restricting the sampling area to a semi-spherical shell closer to the current_tree_latest_node with a radius not less than best_distance allows new nodes to grow laterally relative to the current end and bypass obstacles from the side, thus better bypassing obstacles and improving the ability to escape local obstacle dead zones. At the same time, the sampling direction is superimposed with the lateral repulsive force bias calculated from historical collision points, further strengthening the tendency of sampling points to avoid known obstacles and improving the success rate and efficiency of planning in complex obstacle environments.

[0209] like If the joint exceeds its limit range, then each joint component is cut off within the limit range; if If a collision is detected and the sample is in a collision state, it is discarded and regenerated according to the above steps until a valid sampling point in free space is obtained or the preset maximum number of resampling times is reached. If this is exceeded, it degenerates into ordinary uniform random sampling.

[0210] As an optional implementation of this application, the method for calculating the obstruction coefficient and determining the mode in step S5 is described in detail.

[0211] The obstacle coefficient H of the current tree is calculated based on the number of consecutive collisions N. The calculation formula is as follows:

[0212] Where H is the obstacle coefficient of the current tree, with a value ranging from (0,1); N is the number of consecutive collisions in the current tree; The first constant is preset; This is a pre-defined second constant; This is the sigmoid function.

[0213] The generation pattern determines the random number r. If r < H, then enter forced exploration mode; otherwise, enter adaptive sampling mode.

[0214] The offset term in the sigmoid function of the hindering coefficient H is The offset term in the distance threshold formula is .because The starting point of the increase in the obstacle coefficient H lags significantly behind the starting point of the increase in the distance threshold, forming a two-stage escape mechanism: "first, threshold regression guides adaptive obstacle avoidance; only in severe situations is forced exploration gradually triggered." Specifically: during minor collisions (when N is small), the distance threshold begins to increase to guide the sampling area outward, but the obstacle coefficient remains close to zero, and the system continues to operate in adaptive sampling mode; only when the number of consecutive collisions continues to increase and adaptive sampling can no longer effectively avoid obstacles does the obstacle coefficient increase significantly, and the probability of the forced exploration mode being triggered increases significantly. This lag design avoids premature triggering of forced exploration, which would interrupt normal guidance, and also avoids premature triggering, which would cause the system to be trapped in a local area for a long time.

[0215] As an optional implementation of this application, the specific implementation of the forced exploration mode in step S6 is described in detail.

[0216] a) Random sampling: Randomly sample a set of joint configurations within each dimension of the joint space (i.e., within the range of motion limits of each joint). .

[0217] b) Find the nearest tree node: Search for the node in the current tree (current_tree) that matches the joint configuration. The nearest tree node in the Euclidean algorithm is selected as the nearest tree node. .

[0218] c) Step-size expansion: From the nearest tree node Along the direction of the joint Preset step size for directional movement The candidate joint configurations are obtained: .

[0219] d) Distance threshold filtering and collision detection: Calculate the candidate joint configuration To the end node of another tree Euclidean distance .like ,in, If the distance threshold is set to the current tree, then the candidate point is still within the adaptive sampling region, failing to meet the goal of forced exploration to "escape the local area," and returns to step a) for resampling; if Then, the nearest tree node is processed with a preset step size. To the candidate joint configuration Collision detection is performed on the straight path between them. If a collision is detected, the forced exploration fails and the process returns to step S3.

[0220] e) Successful expansion and parameter reset: If no collision is detected, a new node is created with the candidate joint configuration and added to the current tree. The number of consecutive collisions is cleared to zero. The distance threshold is reset to the current Euclidean distance between the end nodes of the two trees. The obstacle coefficient is recalculated based on the number of consecutive collisions after clearing. At this time, H is close to zero. Then, return to step S3.

[0221] The forced exploration mode uses distance threshold filtering to ensure that exploration samples fall outside the adaptive sampling region, truly escaping local obstacles rather than repeatedly trying within areas with a proven high collision probability. Upon successful expansion, the consecutive collision count is immediately reset to zero, and the distance threshold is reset, allowing the system to fully recover to its initial guidance state and avoiding interference from historical collision memories on subsequent normal planning. This mechanism effectively solves the problem in APF-RRT-like methods where the exploration tree remains trapped near obstacles for extended periods due to local minima in the potential field.

[0222] As an optional implementation of this application, after successfully expanding a new node in step S7 and before attempting to expand another tree, a rewire optimization step is also included to locally optimize the parent-child connection relationship between the new node and its neighboring nodes. For ease of description, the path cost described in this implementation is the cumulative path cost from the current tree root node to the corresponding node, that is, the sum of the Euclidean distances between adjacent node joint configurations along the path from the root node to that node in the current tree. The rewire optimization step specifically includes the following sub-steps:

[0223] Step 1: Centered on the newly extended node `new_node`, search for existing nodes in the current tree `current_tree` within the joint space of a preset rewire radius (preferably the aforementioned `max_rewire_dist`) to form a neighborhood node set. Preferably, the neighborhood node set includes the original extended parent node of the new node to ensure that the result of the rewire is not inferior to the original extended connection.

[0224] Step 2: For the new node itself, traverse all nodes in its neighborhood and calculate the path cost of the new node when each node is its parent node. This path cost is the sum of the node's own path cost and the Euclidean distance between the node and the joint configuration of the new node. Preferably, before calculation, collision detection is performed on the straight-line connection path between the node and the new node at a preset step size, and only nodes with no collisions in the connection path are selected for optimization. The node that minimizes the path cost of the new node is selected as the optimal parent node, the parent node of the new node is updated to the optimal parent node, and the path cost of the new node is updated to the corresponding minimum path cost.

[0225] Step 3: For each node in the neighborhood other than the new node itself, determine whether the sum of the path cost of the new node and the path cost from the new node to the current node (i.e., the Euclidean distance between the joint configurations of the two nodes) is less than the current path cost of the current node; if so, update the parent node of the current node to the new node, update the path cost of the current node to the sum, and recursively update the cumulative path cost of all successor nodes in the subtree rooted at the current node along the parent-child relationship; preferably, before updating the parent node of the current node, collision detection is also performed on the straight-line connection path from the new node to the current node, and the above update is performed only when no collision is detected.

[0226] Specifically, the recursive update involves updating the path cost of each successor node in the subtree to the sum of the path cost of its parent node and the Euclidean distance between the parent and child node joint configurations, in order to ensure the consistency of the path cost of each node in the tree after rewire.

[0227] Step 4: After the rewiring optimization is complete, update the following parameters: best_distance is updated to the Euclidean distance between new_node.q and other_tree_latest_node.q; current_tree_latest_node = new_node; and the number of consecutive collisions in the current tree is updated.

[0228] If the new node expansion is obtained in the forced exploration mode, since the tree has entered a new exploration direction and does not inherit the continuous collision situation of the old direction, the continuous collision count of the current tree will be directly updated to 0.

[0229] If the new node expansion was obtained in adaptive sampling mode, since the new node is still in the same local region, the number of consecutive collisions in the current tree cannot be simply reset to zero. Instead, it should partially inherit the obstacle collision situation of the parent node's region and be updated according to the following formula:

[0230] Number of consecutive collisions before expansion At that time, the updated number of consecutive collisions ;

[0231] Number of consecutive collisions before expansion At that time, the updated number of consecutive collisions

[0232] ;

[0233] in, This represents the number of consecutive collisions updated after the current tree node is expanded. The number of consecutive collisions before the new node is expanded. This is a preset attenuation ratio, for example, a preset attenuation ratio of 0.5. Indicates rounding down;

[0234] Then, based on the number of consecutive collisions of the updated current tree, the distance threshold is updated, and the next step is to attempt to expand another tree.

[0235] In one embodiment, the present invention provides an adaptive bidirectional RRT robotic arm path planning device, comprising:

[0236] The model building and initialization module is used to build the robotic arm motion model and obstacle geometry model, set the start and end joint configurations, initialize the start tree and target tree respectively, and configure path planning parameters and adaptive sampling parameters.

[0237] The collision detection and direct connection judgment module is used to perform collision detection on the starting point and the ending point respectively. If there is a collision at the starting point or the ending point, the planning failure is returned. If there is no collision between the starting point and the ending point and the Euclidean distance between them is less than the preset maximum connection distance, then the collision detection is performed on the straight path from the starting point to the ending point. If there is no collision, the straight path is directly returned as the planning result.

[0238] The iteration and tree selection control module is used to determine whether the current iteration count has reached the preset maximum iteration count. If it has, the planning failure is returned. If it has not, the current tree and another tree responsible for expansion in the current iteration are determined.

[0239] The mode determination and sampling module is used to calculate the obstacle coefficient based on the number of consecutive collisions of the current tree to determine whether to enter the adaptive sampling mode or the forced exploration mode. In the adaptive sampling mode, the lateral offset direction and lateral offset intensity are calculated based on the historical collision points, and adaptive sampling points are generated in the hypersphere space or hemispherical shell space in combination with the distance threshold. In the forced exploration mode, random sampling is performed in the joint space.

[0240] The tree expansion and parameter update module is used to expand new nodes with sampling points and perform collision detection, and update the number of consecutive collisions, distance threshold and obstacle coefficient according to the detection results.

[0241] The path connection and generation module is used to determine whether the distance between the end nodes of two trees is less than the preset maximum connection distance. If so, it attempts to connect the two trees. After the connection is successful, it backtracks from the end nodes of the two trees to their respective root nodes and splices them together to generate a complete path.

[0242] The specific implementation methods of each module of the above-mentioned device correspond one-to-one with the corresponding steps in the aforementioned method embodiments, and will not be repeated here.

[0243] To verify the effectiveness of the method of the present invention, this embodiment conducts comparative experiments under two typical planning scenarios.

[0244] To verify the technical effect of the method described in the embodiments of this application, the following planning verification scenario is set up in this embodiment and compared with existing planning methods.

[0245] Scenario 1: Set up a planning scenario that requires bypassing obstacles: the starting joint is configured as (1.1,−0.7,0,0,0,0), and the ending joint is configured as (−0.7,1.1,0,0,0,0). Each component corresponds to the joint angle (unit: rad) of the six joints of the robotic arm. The specific robotic arm position and obstacle arrangement are as follows: Figure 2 As shown in the diagram, in this scenario, the direct path between the starting and ending points is blocked by obstacles. The robotic arm needs to navigate around the obstacles to complete the transition from the starting joint configuration to the ending joint configuration. This is used to examine the obstacle avoidance capability, path quality, and planning efficiency of each method in a locally complex obstacle environment.

[0246] The comparison methods include: the basic RRT method (RRT-base), the bidirectional RRT method (bidirectional RRT), the RRT-star method (RRT-star), and the method of this application. To ensure fairness in the comparison, all methods are uniformly configured as follows: target bias is 0.1, meaning that the target joint configuration is directly used as the sampling point with a probability of 0.1 in each sampling; maximum step size is 0.1; collision detection step size is 0.01, meaning that discretized collision detection is performed along the extension path with a step size of 0.01. The parent node reselection and rewiring range for both RRT-star and the method of this application are set to 1, i.e., max_rewire_dist=1. All methods run on the same hardware and software platform.

[0247] Evaluation metrics include: planning time (s); path length, which is the cumulative sum of Euclidean distances between adjacent node joint configurations on the final path; number of path nodes, which is the number of nodes contained in the final path; total number of samples, which is the total number of sample points generated during the planning process; and total number of nodes, which is the total number of search tree nodes generated during the planning process.

[0248] The planning results for Scenario 1 are shown in Table 1:

[0249] Table 1. Comparison of planning results of different methods in scenario 1

[0250]

[0251] Compared with RRT-base: the planning time of the method in this application (0.1345s) is on the same order of magnitude as that of RRT-base (0.1261s), which is basically equivalent. However, the path length is reduced from 4.1452 to 2.9947, which is shortened by about 27.8%. The number of path nodes is reduced from 54 to 10. The total number of samples and the total number of nodes are only about 16.7% and about 17.0% of that of RRT-base, respectively. This shows that the method in this application significantly improves the path quality and reduces invalid searches while maintaining high planning speed.

[0252] Compared with bidirectional RRT, the planning time of the method in this application is reduced by about 37.9% (0.2166s→0.1345s), the path length is reduced by about 19.3% (3.7102→2.9947), and the total number of samples and total number of nodes are only about 31.6% and about 34.6% of that of bidirectional RRT, respectively. This indicates that the adaptive sampling strategy of the method in this application is more directional than the expansion mechanism of bidirectional RRT, and can converge to a high-quality path faster with fewer samples.

[0253] Compared with RRT-star: The path length of the method in this application (2.9947) is basically the same as that of RRT-star (2.9740), with a difference of only about 0.7%, and the number of path nodes of both is 10, indicating that they have comparable near-optimal path quality; while the planning time of the method in this application is only about 19.5% of that of RRT-star (0.1345s vs. 0.6912s), which is shortened by about 80.5%, and the total number of samples and total number of nodes are only about 24.7% and about 23.6% of those of RRT-star, respectively. This shows that the method in this application achieves comparable path quality to RRT-star with significantly lower computational cost, balancing path quality and planning efficiency.

[0254] The above results show that in scenario 1 where obstacles need to be bypassed, the method of this application can quickly obtain a near-optimal path with fewer samples and nodes: its planning time is basically equivalent to the fastest RRT-base, its path quality is basically equivalent to the best RRT-star, and its overall performance is better than all the comparison methods. This verifies the effectiveness of the hypersphere / hypersphere shell adaptive sampling, forced exploration mode switching mechanism, bidirectional tree collaboration and rewiring optimization techniques in the embodiments of this application.

[0255] Scenario 2: To further verify the performance of the method described in this application embodiment in a complex environment, a more complex planning scenario requiring obstacle avoidance is set up than Scenario 1: the starting joint is configured as (1.1, −0.99, 1.39, 1.45, 1.2, −1.85), and the ending joint is configured as (−0.72, 1.2, 0.73, 3.14, 1.86, 0.8). Each component corresponds to the joint angle (unit: rad) of the six joints of the robotic arm. The specific robotic arm position and obstacle arrangement are as follows... Figure 3 As shown. Compared with Scenario 1, the starting point and ending point configurations in this scenario differ significantly across all six joint dimensions, resulting in a larger joint space span. Furthermore, the direct connection path between the two is blocked by obstacles, requiring the robotic arm to complete more complex detours within a higher-dimensional configuration space. This scenario serves to examine the obstacle avoidance capabilities, path quality, and planning efficiency of various methods in complex obstacle environments.

[0256] The comparison methods include: the basic RRT method (RRT-base), the bidirectional RRT method (bidirectional RRT), the RRT-star method (RRT-star), and the method of this application. To ensure fairness in the comparison, all methods are uniformly configured as follows: target bias is 0.1, meaning that the target joint configuration is directly used as the sampling point with a probability of 0.1 in each sampling; maximum step size is 0.1; collision detection step size is 0.01, meaning that discretized collision detection is performed along the extension path with a step size of 0.01. The parent node reselection and rewiring range for both RRT-star and the method of this application are set to 1, i.e., max_rewire_dist=1. All methods run on the same hardware and software platform.

[0257] The evaluation metrics are the same as in Scenario 1, including: planning time (s); path length, which is the cumulative sum of Euclidean distances between adjacent node joint configurations on the final path; number of path nodes, which is the number of nodes contained in the final path; total number of samples, which is the total number of sample points generated during the planning process; and total number of nodes, which is the total number of search tree nodes generated during the planning process.

[0258] The planning results for Scenario 2 are shown in Table 2:

[0259] Table 2 Comparison of planning results of different methods in Scenario 2

[0260]

[0261] Compared with RRT-base: the planning time of the method in this application (0.6181s) is on the same order of magnitude as RRT-base (0.5764s), differing by only about 7.2%, while the path length is reduced from 8.9608 to 4.5997, a reduction of about 48.7%, and the number of path nodes is reduced from 91 to 12, a reduction of about 86.8%. The total number of samples and the total number of nodes are only about 22.7% and about 17.3% of RRT-base, respectively. This shows that the method in this application significantly overcomes the shortcomings of RRT-base, such as long paths and many detours, while maintaining a high planning speed.

[0262] Compared with bidirectional RRT: Bidirectional RRT has the shortest planning time in this scenario (0.2415s), but its path length is 7.8886, which is about 1.7 times that of the method in this application, and the number of path nodes is 80, which is about 6.7 times that of the method in this application. Under the same premise of maintaining a planning speed of less than a second (0.6181s), the method in this application shortens the path length by about 41.7%, reduces the number of path nodes by about 85.0%, and reduces the total number of samples and the total number of nodes by about 27.9% and about 45.3%, respectively. This shows that although bidirectional RRT converges faster in complex scenarios, it has poor path quality and many redundant nodes, while the method in this application can obtain a significantly better and simpler path with a comparable planning speed.

[0263] Compared to RRT-star: RRT-star's planning time in this scenario is as high as 2.9109s, approximately 4.7 times that of the method in this application. The total number of samples and total number of nodes are 517 and 406 respectively, approximately 5.1 times and 6.3 times that of the method in this application, while its path length is still 7.1077. The method in this application not only shortens the planning time by approximately 78.8%, but also further shortens the path length by approximately 35.3% (4.5997 vs. 7.1077). The number of path nodes is reduced from 28 to 12. The total number of samples and total number of nodes are only approximately 19.5% and 15.8% of that of RRT-star, respectively. This indicates that in complex scenarios, the asymptotic optimality of RRT-star is difficult to achieve with limited sampling, requiring a huge computational cost. In contrast, the method in this application obtains a better path with less computation through adaptive sampling, forced exploration mode switching, and bidirectional tree collaboration and rewiring optimization.

[0264] The above results show that in the more complex obstacle bypass scenario 2, the method of this application simultaneously achieves the shortest path length (4.5997), the fewest path nodes (12), the fewest total samples (101), and the fewest total nodes (64) among the four methods, while controlling the planning time to below the second level (0.6181s). Combined with the results of scenario 1, it can be seen that as the scenario complexity increases, the advantages of the method of this application in terms of path quality and search efficiency further expand: in scenario 1, the method of this application achieves path quality comparable to RRT-star in a time comparable to RRT-base, while in scenario 2, the path quality of the method of this application is comprehensively superior to all comparative methods, including RRT-star, verifying that the method described in the embodiments of this application has good planning performance and robustness in complex obstacle environments.

[0265] To verify the effectiveness of the adaptive bidirectional RRT robotic arm path planning method proposed in this invention, the standard RRT algorithm was used respectively ( Figure 4 RRT-star algorithm ( Figure 5 ), bidirectional RRT algorithm ( Figure 6 ) and the method of the present invention ( Figure 7 A path planning experiment was conducted. By comparing the curves of the six joint angles of the robotic arm generated by each method with the path node index, the quality of the planned path was comprehensively evaluated.

[0266] First, refer to Figure 4 While the standard RRT algorithm can successfully plan a feasible path from the starting point to the ending point, the generated path contains up to 62 nodes, and the joint angle curves generally exhibit significant high-frequency sawtooth jitter and non-monotonic fluctuations. Particularly at joints 3, 4, and 5, the curves show dense reciprocating oscillations, indicating a large number of redundant turns and unnecessary fine-tuning movements in the path. This coarse path structure directly reflects the inherent defects of the standard RRT algorithm—purely random sampling and a lack of optimization mechanisms. The generated path has poor smoothness and usually requires additional smoothing processing to meet the needs of actual motion control.

[0267] Secondly, refer to Figure 5 The RRT-star algorithm effectively optimizes the path structure by introducing reconnection and rewire mechanisms, significantly reducing the number of path nodes to 14. Its joint angle curves are generally smooth and have coherent transitions, with only one reasonable non-monotonic fluctuation at joints 3 and 4 to complete the necessary obstacle avoidance maneuvers, and no high-frequency jitter. This indicates that the RRT-star algorithm can generate high-quality paths close to the optimal solution, but at the cost of high computational overhead.

[0268] Again, refer to Figure 6While the bidirectional RRT algorithm improves the probability of finding feasible solutions by simultaneously expanding the search tree from both the start and end points, the path it generates exhibits the worst smoothness. This path contains approximately 50 nodes, with significant high-frequency micro-jagged edges superimposed on the joint curves, and severe and disordered large oscillations occurring at joints 3, 4, and 5. For example, joint 3 has a sharp valley reaching -0.25 rad in the middle of the path, while joints 4 and 5 experience multiple peak-valley alternations. This coarse path morphology stems from the lack of effective geometric continuity optimization during bidirectional search tree docking, resulting in extremely discontinuous generated trajectories. Direct application of this algorithm may cause robotic arm motion jitter or increased energy consumption.

[0269] Finally, refer to Figure 7 The adaptive bidirectional RRT method proposed in this invention generates a path containing only 14 nodes, comparable to the RRT-star algorithm, but exhibits superior overall performance in terms of curve smoothness and action rationality. The curves of joints 1 and 2 show highly smooth monotonic transitions without any redundant fluctuations; the non-monotonic fluctuations on joints 3, 4, and 5 are few in number, moderate in amplitude, and have gentle transitions, demonstrating the algorithm's effective adaptation to the obstacle environment through adaptive sampling and forced exploration mechanisms; the curve trend of joint 6 is clear, without any sharp local turns. In summary, this invention significantly improves the smoothness of the curves at each joint angle while maintaining path conciseness. The generated path not only avoids high-frequency jitter and unnecessary large oscillations, but its obstacle-avoidance actions are also more regular and rational, fully verifying the technical advantages of this method in improving path planning success rate, efficiency, and path quality.

[0270] In summary, the adaptive bidirectional RRT robotic arm path planning method and apparatus provided by the present invention achieves efficient and high-quality robotic arm path planning in obstacle environments through the coordinated operation of the following core mechanisms:

[0271] 1) Based on the distance threshold modeled in the form of an activation function and the number of consecutive collisions, the sampling area is gradually adjusted from conservative to expanded, taking into account both directionality and obstacle avoidance ability.

[0272] 2) Based on the weighted repulsion force accumulated from historical collision points and the lateral offset direction after removing the projection component of the connection direction, the sampling is guided to avoid obstacles laterally while maintaining the bidirectional connection trend;

[0273] 3) The growth starting point lags behind the distance threshold obstacle coefficient, forming a two-level escape mechanism of "first adaptive obstacle avoidance, and then forced exploration when severely trapped", which solves the local minimum problem;

[0274] 4) Retains the rewiring mechanism of RRT-star but benefits from a sparser tree structure, reducing computational overhead while maintaining path optimization performance;

[0275] 5) A segmented decay strategy for consecutive collisions balances response sensitivity and exploration continuity, avoiding misjudgment and forgetting.

[0276] The above embodiments and the various technical features described therein can be combined with each other without conflict to form other embodiments of the present invention.

[0277] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments, and various changes can be made within the scope of knowledge possessed by those skilled in the art without departing from the spirit of the present invention. Furthermore, the embodiments of the present invention and the features thereof can be combined with each other unless otherwise specified.

Claims

1. An adaptive bidirectional RRT robotic arm path planning method, characterized in that, include: S1: Construct the motion model of the robotic arm and the geometric model of the obstacles, set the joint configuration of the start and end points, initialize the start tree and the target tree respectively, and configure the path planning parameters and adaptive sampling parameters; S2: Perform collision detection on the start and end points respectively; If there is a collision at the starting point or the ending point, the planning failure is returned; if there is no collision between the starting point and the ending point and the Euclidean distance between them is less than the preset maximum connection distance, then the straight path from the starting point to the ending point is collision detected. If there is no collision, the straight path is directly returned as the planning result. Otherwise, proceed to step S3; S3: Determine whether the current iteration count has reached the preset maximum iteration count. If it has, return that the planning failed; otherwise, proceed to step S4. S4: Determine the current tree and another tree responsible for expansion in the current iteration; S5: Calculate the obstacle coefficient based on the number of consecutive collisions of the current tree, and determine whether to enter the adaptive sampling mode or the forced exploration mode based on the obstacle coefficient; S6: If forced exploration mode is entered, random sampling is performed in the joint space, and the node closest to the sampling point is selected on the current tree for expansion. When the expansion is successful, the relevant parameters are updated, and then the process returns to step S3. S7: If the adaptive sampling mode is entered, the lateral offset direction and lateral offset intensity are calculated based on the historical collision points, and adaptive sampling points are generated in the hypersphere space or hemispherical shell space in combination with the distance threshold. Using the aforementioned adaptive sampling points, we attempt to expand to new nodes and perform collision detection; If a collision occurs, update the number of consecutive collisions, the distance threshold, and the obstacle coefficient, and return to step S3; if no collision occurs, add the new node to the current tree, update the number of consecutive collisions, the distance threshold, and the obstacle coefficient, and try to expand another tree. Then, determine whether the distance between the end nodes of the two trees is less than the preset maximum connection distance; if so, try to connect the two trees. If the connection is successful, proceed to step S8. Otherwise, return to step S3; S8: Backtrack from the end nodes of the two trees to their respective root nodes, concatenate them to generate a complete path, and return.

2. The method according to claim 1, characterized in that, The rules for calculating the distance threshold and updating the number of consecutive collisions are as follows: The number of collisions between the terminal nodes of the starting tree and the target tree during continuous expansion is recorded, along with the Euclidean distance between the terminal nodes of the two trees. Based on the Euclidean distance, the number of consecutive collisions, and the expansion step size, the distance thresholds for the two trees are calculated. The distance thresholds are calculated using an activation function, such that the distance threshold increases slowly when the number of consecutive collisions is small, increases rapidly when the number of consecutive collisions is large, and approaches its upper limit when the number of consecutive collisions continues to increase. When no collision occurs during the expansion of the terminal node, the number of consecutive collisions is set to zero, and the initial value of the distance threshold between the two trees is set to the Euclidean distance between the terminal nodes of the two trees. In adaptive sampling mode, each time a collision occurs when a new node is expanded, the number of consecutive collisions is incremented by one and the distance threshold is updated according to the activation function. After successfully expanding to a new node, the number of consecutive collisions decays in the following segmented manner: Number of consecutive collisions before expansion At that time, the updated number of consecutive collisions ; Number of consecutive collisions before expansion At that time, the updated number of consecutive collisions ; in, This represents the number of consecutive collisions updated after the current tree node is expanded. The number of consecutive collisions before the new node is expanded. To preset the attenuation ratio, Indicates rounding down; In forced exploration mode, after successfully expanding a new node, the number of consecutive collisions is immediately reset to zero, and the distance threshold is reset to the current Euclidean distance between the end nodes of the two trees.

3. The method according to claim 1, characterized in that, The method for calculating the lateral offset direction and lateral offset intensity based on historical collision points in step S7 is as follows: Maintain a collision point storage list. In adaptive sampling mode, each time a new node is expanded and a collision occurs, add the collision point coordinates to the collision point storage list. During each adaptive sampling, the following calculations are performed: Calculate the main reference direction, which is the unit vector from the current tree end node to the end node of another tree; Traverse the list of collision points and calculate the position offset vector and distance of each historical collision point relative to the end node of another tree. Based on the position offset vector and distance, calculate the repulsive force direction and weight corresponding to each collision point, where the closer the distance, the greater the weight; The total repulsive force vector is obtained by summing the weighted repulsive forces at all collision points, and then normalized to obtain the direction of the total repulsive force. Remove the projection component of the total repulsive force direction in the main reference direction to obtain the lateral component, and normalize the lateral component to obtain the lateral offset direction. The lateral bias strength is determined based on the magnitude of the lateral component.

4. The method according to claim 1, characterized in that, In step S7, adaptive sampling points are generated within the hypersphere or hemispherical shell space by incorporating a distance threshold. Generate a first random number and a second random number, both of which are random numbers within the interval [0,1]. The generation method for sampling points is determined according to the following three mutually exclusive conditions: If the first random number is less than the preset target bias probability, then the end node of the other tree is directly used as the sampling point; If the first random number is not less than the target bias probability and the second random number is less than the hypersphere sampling probability, then adaptive sampling is performed in a hypersphere with the end node of another tree as the center and the distance between the end nodes of the two trees as the radius to obtain sampling points. If the first random number is not less than the target bias probability and the second random number is not less than the hypersphere sampling probability, then adaptive sampling is performed in a hemispherical shell region with the end node of another tree as the center, the radius of which is between the distance between the end nodes of the two trees and the current tree distance threshold, and biased towards the end node of the current tree, to obtain sampling points. The formula for calculating the sampling probability of the hypersphere is: ; Where P is the hypersphere sampling probability, and N is the number of consecutive collisions in the current tree. As a preset first constant, As a preset second constant, The sigmoid function; denominator The normalization term is such that P=1 when N=0; as N increases, P decreases monotonically, and the probability of the hemispherical shell region being selected increases accordingly; when N=0, the distance threshold is equal to the distance between the end nodes of the two trees, the hemispherical shell region degenerates, and P=1 ensures that sampling only occurs within the hypersphere.

5. The method according to claim 4, characterized in that, The specific steps for adaptive sampling within the hypersphere include: Generate a random unit vector as the initial sampling direction; The corrected sampling direction is obtained by superimposing the lateral offset direction and the lateral offset intensity on the initial sampling direction; Generate random radii within the range of zero to the hypersphere radius; Using the joint configuration of the end node of another tree as the center of the sphere, the random radius is offset along the corrected sampling direction to obtain the hypersphere sampling point.

6. The method according to claim 4, characterized in that, The specific steps for adaptive sampling within the hemispherical shell region include: Generate a random unit vector as the initial sampling direction; Determine whether the initial sampling direction is towards the half-shell space on one side of the current tree end node. If so, retain it; otherwise, regenerate a random unit vector until the condition is met. The corrected sampling direction is obtained by superimposing the lateral offset direction and lateral offset intensity on the retained direction; Generate a random radius within the range of the distance between the end nodes of the two trees and the current tree distance threshold; Using the joint configuration of the end node of another tree as the center of the sphere, the random radius is offset along the corrected sampling direction to obtain the hemispherical shell sampling point.

7. The method according to claim 1, characterized in that, The method for calculating the impedance coefficient and determining the mode in step S5 is as follows: The obstacle coefficient of the current tree is calculated based on the number of consecutive collisions. The calculation formula is as follows: ; Where H is the obstacle coefficient of the current tree, and N is the number of consecutive collisions in the current tree. As a preset first constant, As a preset second constant, It is the sigmoid function; The generation pattern determines the random number r. If r < H, then enter the forced exploration mode; otherwise, enter the adaptive sampling mode.

8. The method according to claim 1, characterized in that, The specific implementation of the forced exploration mode in step S6 is as follows: a) Randomly sample a set of joint configurations within each dimension of the joint space; b) Find the tree node in the current tree that has the closest Euclidean distance to the joint configuration, and designate it as the nearest tree node; c) Move a preset step size from the nearest tree node along the direction toward the joint configuration to obtain a candidate joint configuration; d) Calculate the Euclidean distance from the candidate joint configuration to the end node of another tree. If the Euclidean distance is less than the distance threshold of the current tree, return to step a) to resample. If the Euclidean distance is not less than the distance threshold of the current tree, then a collision detection is performed on the straight path between the nearest tree node and the candidate joint configuration with a preset step size. If a collision is detected, the forced exploration fails and the process returns to step S3. e) If no collision is detected, create a new node with the candidate joint configuration and add it to the current tree, clear the number of consecutive collisions to zero, reset the distance threshold to the current Euclidean distance between the end nodes of the two trees, recalculate the obstacle coefficient based on the cleared number of consecutive collisions, and then return to step S3.

9. The method according to claim 1, characterized in that, Step S7, after successfully expanding a new node but before attempting to expand another tree, also includes a rewiring optimization step; the path cost mentioned here is the cumulative path cost from the current root node to the corresponding node: Centered on the newly expanded node, search for existing nodes in the current tree within the joint space of the preset rewire radius; For the new node itself, traverse all nodes in the neighborhood, calculate the path cost of the new node when each node is the parent node of the new node, select the node that minimizes the path cost as the optimal parent node, update the parent node of the new node to the optimal parent node and update the path cost of the new node. For each of the remaining nodes in the neighborhood, determine whether the sum of the path cost of the new node and the path cost from the new node to the current node is less than the current path cost of the current node. If so, update the parent node of the node to the new node, and update the path cost of the node and the cumulative path cost of all successor nodes in the subtree rooted at the node.

10. An adaptive bidirectional RRT robotic arm path planning device, characterized in that, include: The model building and initialization module is used to build the robotic arm motion model and obstacle geometry model, set the start and end joint configurations, initialize the start tree and target tree respectively, and configure path planning parameters and adaptive sampling parameters. The collision detection and direct connection judgment module is used to perform collision detection on the starting point and the ending point respectively. If there is a collision at the starting point or the ending point, the planning failure is returned. If there is no collision between the starting point and the ending point and the Euclidean distance between them is less than the preset maximum connection distance, then the collision detection is performed on the straight path from the starting point to the ending point. If there is no collision, the straight path is directly returned as the planning result. The iteration and tree selection control module is used to determine whether the current iteration count has reached the preset maximum iteration count. If it has, the planning failure is returned. If it has not, the current tree and another tree responsible for expansion in the current iteration are determined. The mode determination and sampling module is used to calculate the obstacle coefficient based on the number of consecutive collisions of the current tree to determine whether to enter the adaptive sampling mode or the forced exploration mode. In the adaptive sampling mode, the lateral offset direction and lateral offset intensity are calculated based on the historical collision points, and adaptive sampling points are generated in the hypersphere space or hemispherical shell space in combination with the distance threshold. In forced exploration mode, random sampling is performed within the joint space; The tree expansion and parameter update module is used to expand new nodes with sampling points and perform collision detection, and update the number of consecutive collisions, distance threshold and obstacle coefficient according to the detection results. The path connection and generation module is used to determine whether the distance between the end nodes of two trees is less than the preset maximum connection distance. If so, it attempts to connect the two trees. After the connection is successful, it backtracks from the end nodes of the two trees to their respective root nodes and splices them together to generate a complete path.