1. Introduction
Robotic arms are widely used in electrical survey engineering projects, but they still face some practical issues. In real operating environments, six-axis robotic arms often have to work under complex conditions and in highly confined spaces—such as cable trenches and cable compartments—where clearances are tight and elevations change irregularly. To make things worse, obstacles like cables and cable supports add further difficulty to path planning. The core goal here is to generate a safe, feasible motion trajectory based on the robotic arm’s starting and target poses, all within such a constrained environment. By defining a reasonable sequence of waypoints, the method ensures the arm can avoid obstacles during movement and complete tasks reliably. Over the years, researchers have looked into this problem and proposed a range of classic path planning methods.
Sang L L et al. [
1] applied Dijkstra’s algorithm as the global path planning algorithm and the Dynamic Window Algorithm (DWA) as the local path planning algorithm to an intelligent mobile robot, enabling it to successfully navigate around obstacles at the initial planning position and reach the designated location. Tang Xianxing et al. [
2] have proposed a global path planning and obstacle avoidance algorithm for a six-degree-of-freedom robotic arm based on an improved A* algorithm and the artificial potential field method. In response to the issues of low search efficiency and high computational cost associated with traditional D* path planning algorithms, Liu J et al. [
3] proposed the directed D* algorithm. This algorithm takes into account information regarding the destination and obstacles, introduces the concept of key nodes, determines feasible paths through step-by-step expansion, and incorporates a steering function to control the search range of nodes in a single search iteration, thereby improving search efficiency. Chen Lifang et al. [
4] have proposed a path planning method that integrates B-spline technology with genetic algorithms to address the problem of path planning for robots in environments with complex obstacles. You Yong et al. [
5] have proposed a path planning method based on an improved PRM algorithm. This addresses various issues encountered when using traditional probabilistic route mapping (PRM) algorithms in robots for aircraft wing box assembly. Tan Zhongwan et al. [
6] propose an improved RRT-Connect algorithm. This addresses issues with the RRT-Connect algorithm, such as low path planning efficiency, poor obstacle avoidance capabilities, and poor path quality in complex environments.
Xie Long [
7] improved the artificial potential field method and proposed a dynamic obstacle avoidance planning algorithm suitable for robotic arm systems. This algorithm builds an attractive velocity in Cartesian space to track obstacles in real time and links changes in obstacle velocity to repulsive velocity, giving the robotic arm decent dynamic obstacle avoidance ability. That said, single algorithms still have inherent drawbacks. Random sampling methods like RRT can explore space quickly, but the paths they produce are often of poor quality. The artificial potential field method, on the other hand, can generate smooth paths, but it tends to become stuck in local optima. To strike a balance between efficiency and path quality, hybrid algorithms that combine multiple strategies have gradually become a mainstream research direction. The APF algorithm transforms complex planning problems into potential energy calculations; its concept is clear and easy to understand. Paths are guided continuously by a resultant force field, resulting in naturally smooth trajectories that conform to the laws of natural motion. As it only needs to process local environmental information, the algorithm is fast and highly suitable for scenarios requiring high real-time performance. Its structure is straightforward, making it easy to implement and deploy rapidly. These technologies have a wide range of applications, including real-time obstacle avoidance in robotic arms to ensure the safety of human–robot collaboration; local obstacle avoidance in autonomous mobile robots; autonomous avoidance of dynamic or static obstacles by drones in complex environments; and local path planning in autonomous vehicles for tasks such as lane keeping and lane-changing maneuvers to avoid obstacles. Fan and Chen et al. [
8] further proposed a bidirectional artificial potential field RRT algorithm (Bi-APF-RRT), which significantly reduces the number of iterations and improves search efficiency through a bidirectional tree structure. To integrate the rapid convergence advantage of APF-RRT and the path optimization capability of Q-RRT, Chen et al. [
9] proposed a new algorithm that combines goal bias, a potential field and fast RRT (Goal-Biased Potential-Field-Q-RRT, GB-PQ-RRT). Goal bias was introduced to optimize the selection of sampling points, enabling the search tree to grow towards the goal point with a certain probability. A potential field was introduced to optimize the generation of new nodes and accelerate the algorithm’s convergence; the Q-RRT algorithm was then integrated to optimize the path. In addition, to determine the optimal trajectory for mobile robots in complex environments, Xiong et al. [
10] proposed a hybrid particle swarm optimization algorithm (IPSO-GOP). They modified the particle swarm optimization algorithm by adaptively adjusting the inertial weights at various stages of the algorithm’s execution to enhance the particles’ search capabilities.
Zong Chengxing [
11] employed the A* algorithm for collision-free planning of robotic arm operating paths and used B-spline functions for path smoothing optimization. Qi Zhigang [
12], targeting a seven-axis redundant robotic arm, optimized the A* algorithm based on arm-shape angle inverse kinematics, expanding the number of available alternative solutions and enhancing the flexibility of the path planning process, thereby improving the robotic arm’s obstacle avoidance capability and effectively achieving path smoothing. In response to the issues faced by traditional ant colony algorithms in agricultural robot path planning—such as slow convergence, low search efficiency and poor global search capabilities—Zhao et al. [
13] proposed a multi-strategy fusion-based improved ant colony algorithm. Based on a multi-level field-of-view search strategy, the study introduces a non-uniform pheromone initialization strategy incorporating an angle-based judgment mechanism. This assigns higher initial pheromone concentrations to preferred paths closer to the start-to-end line, whilst introducing reward and penalty constraints along the ants’ forward trajectory to enhance the specificity and efficiency of the search. Wang Wei et al. [
14] have proposed an arm path planning algorithm, H-RRT-C, which integrates hierarchical heuristic guidance with reinforcement learning. This method establishes a multi-strategy collaborative optimization framework: the upper layer utilizes an improved A* algorithm to generate a global, coarse-grained path skeleton, and employs an adaptive weighting mechanism to guide a bidirectional search tree to prioritize sampling of key nodes, thereby effectively reducing the randomness of exploration; simultaneously, a dual-Q-network reinforcement learning strategy is introduced, with a multi-objective reward function designed to incorporate path length, node distribution diversity and obstacle avoidance safety, to enable intelligent decision-making regarding expansion dire. Xu Wei et al. [
15] employs the Sarsa (λ) reinforcement learning method to achieve autonomous path planning and intelligent decision-making for target tracking and obstacle avoidance. This method treats each segment of the robotic arm system as a decision-making agent. By perceiving a two-dimensional state comprising the deviation from the target and the distance to obstacles, it designs a reward function that approximates human experience. Reinforcement training is then conducted for the rotational movements of each arm segment, ultimately resulting in a state-action value table for each agent, which serves as the basis for decision-making in the robotic arm’s online path planning. Yuan Meng’en et al. [
16] proposed a multi-population particle swarm algorithm and applied it to robotic arm path planning. This method first uses a vision algorithm to determine the spatial pose of the target object relative to the robotic arm and then employs the multi-population particle swarm algorithm to evolve the optimal angles for each joint of the robotic arm to reach the target position. Wang Z et al. [
17] investigated the use of reinforcement learning methods for handling robotic arm path planning problems. By fitting the Q-function with a neural network, the path planning problem is transformed into a transfer process between finite states, and the deep Q-learning method is used to successfully achieve robotic arm obstacle avoidance and grasping tasks. Yashar Mousavi et al. [
18] have proposed a Q-learning-enhanced adaptive fractional-order firefly algorithm, QRL-AFOFA, to address the challenges posed by large-scale dynamic multi-objective optimisation problems. Although fractional-order meta-heuristics provide memory-driven search dynamics and reinforcement learning (RL) offers adaptive policy control, existing hybrid methods often suffer from serious limitations such as parameter sensitivity, premature convergence and poor diversity preservation.
In the context of 3D obstacle-avoidance path planning for six-axis robotic arms in cable surveying environments, the traditional RRT algorithm suffers from a high degree of sampling blindness and limited operational efficiency, whilst the APF algorithm is prone to becoming stuck in local optima and exhibits poor potential field stability. Furthermore, a single algorithm struggles to balance planning efficiency with path quality. This paper therefore proposes a hybrid path planning algorithm that integrates and improves upon the bidirectional RRT and APF algorithms. The innovation of this algorithm lies in introducing a target-biased sampling strategy and a target-attraction extension strategy with dynamic step sizes to the bidirectional RRT algorithm, thereby enhancing the goal-oriented nature of sampling, reducing ineffective searches, and improving obstacle avoidance flexibility. Secondly, the potential field function of the APF algorithm is optimized by introducing shape and size factors to achieve precise calculation of repulsive forces; the simulated annealing algorithm is integrated to resolve the local optimum problem, and Gaussian filtering is applied to smooth the potential field, thereby enhancing motion stability. Finally, the original path is optimized using a triangular inequality pruning strategy with a target chain, and cubic B-spline curves are employed to smooth the path; simultaneously, a simplified collision detection method is designed to reduce computational complexity.
2. Traditional Algorithms
2.1. Bidirectional RRT Algorithm Principle
The Bidirectional Random Tree (Bidirectional RRT) algorithm is a well-established path planning method, particularly renowned for its efficiency in complex environments. Its core principle involves growing two independent random trees in a two- or three-dimensional environment—one rooted at the start configuration and the other at the goal configuration—and expanding them simultaneously until they intersect. This bidirectional search strategy generates a feasible path connecting the start and goal points by merging the two trees when they meet.
In the initialization phase of the algorithm, two random trees, and , are created with the start point and the end point as their respective root nodes. A random tree consists of a series of nodes and the edges connecting them, where each node represents a state of the robotic arm in the configuration space.
The iterative expansion process of the algorithm mainly includes the following key steps: random sampling, finding the nearest node, expanding the tree, and collision detection. First, a new sample point
is generated by random sampling throughout the entire configuration space. The sampling process can use a uniformly distributed random number generator to generate random points within the range of the configuration space. Then, in the
tree, the node
closest to
is found, and in the
tree, the node
closest to
is found. Finding the nearest node is usually achieved by calculating the distance between the sample point and all nodes in the tree and selecting the node with the minimum distance as the nearest node. The Euclidean distance formula can be used for distance calculation [
19]:
Next, a new node is formed by extending a certain step length from in the direction of , and it is added to the tree. Similarly, a new node is formed by extending the same step length from in the direction of , and it is added to the tree. During the expansion process, collision detection is required to ensure that the newly expanded nodes and paths do not collide with obstacles. Collision detection can be achieved by determining whether the new node or path intersects with the geometric model of the obstacle. For example, for a circular obstacle, it can be determined by calculating whether the distance from the new node to the center of the obstacle is less than the radius of the obstacle.
When the two trees meet the connection condition during the expansion process, the path generation is successful. The connection condition is usually that the distance between the nearest nodes of the two trees is less than a preset threshold , i.e., . The choice of threshold is determined based on factors such as the environment’s dimensions, node density and obstacle size. If is too small, the tree expands slowly, making it difficult to connect nodes; search efficiency is low, and a path may not be found. If is too large, the algorithm is likely to bypass obstacles, generating invalid paths, whilst also increasing the computational load of collision detection. Once the connection condition is met, the final path can be generated by backtracking along the parent node pointers from both trees. The backtracking process starts from , successively visits its parent nodes until it reaches the root node , obtaining the path from the start point to . Similarly, starting from , it backtracks to the root node , obtaining the path from to the end point. By connecting these two paths, the complete path from the start point to the end point is obtained.
To improve both the efficiency and overall performance of the Bidirectional RRT algorithm, researchers often combine several optimization strategies. One common approach is to add a heuristic target bias—basically, selecting the goal point as the random sample with a certain probability. This nudges the tree to grow more deliberately toward the target, cutting down on wasted sampling. Another technique is dynamic step size adjustment: the expansion step length changes based on local obstacle density and how close the tree is to the goal. In cluttered areas, the step size shrinks for more precise obstacle avoidance; in open spaces, it grows to speed up exploration. Beyond that, by borrowing ideas from the artificial potential field method, both attractive and repulsive forces can guide node expansion. The attractive part pulls the tree toward the target, while the repulsive part pushes it away from obstacles. Taken together, these enhancements make the search more directed and efficient, ultimately helping the algorithm find feasible paths in complex environments.
Figure 1 below shows a schematic diagram of the traditional RRT algorithm.
2.2. APF Algorithm Principle
The artificial potential field (APF) method is a classic approach to path planning, widely used in robot navigation and robotic arm motion planning. The basic idea is to treat the robotic arm’s movement through space like a particle moving under forces in a virtual field. In this field, the target acts as a source of attraction, pulling the arm toward it, while obstacles act as sources of repulsion, pushing the arm away. Under the combined effect of attractive and repulsive forces, the arm moves along the gradient direction of the potential field, which produces a path from the start point to the target.
The attractive field is a key factor in the APF algorithm that guides the robotic arm to move towards the target point. The attractive potential field function
is usually defined as a function of the distance from the current position
of the robotic arm to the target position
. A common expression is:
where
is the attractive coefficient, which determines the strength of the attractive force.
represents the Euclidean distance between the current position of the robotic arm and the target position. The attractive force
is the negative gradient of the attractive potential field function:
The attractive force always points toward the target, and its strength grows with the distance between the robotic arm and the goal. When the arm is far away, the force is stronger, so it moves faster toward the target. As the arm becomes closer, the force gradually weakens, allowing for a smoother, more controlled approach.
The repulsive field is the core of the APF algorithm for achieving obstacle avoidance. The definition of the repulsive potential field function
is related to the distance
from the current position
of the robotic arm to the obstacle and the range of action of the repulsive force
. For a single obstacle, the repulsive potential field function is usually expressed as [
20]:
The repulsive potential field of multiple obstacles is typically modeled using linear superposition:
where
is the repulsive coefficient, which determines the strength of the repulsive force. When the robotic arm is close to the obstacle, i.e.,
, the repulsive potential field takes effect, and the repulsive force
has a direction away from the obstacle and a magnitude inversely proportional to the distance from the robotic arm to the obstacle. The closer the distance, the greater the repulsive force, thus effectively preventing the robotic arm from approaching the obstacle; when the robotic arm is far from the obstacle,
, the repulsive potential field is zero, and the repulsive force has no effect.
In the actual path planning process, the resultant force
on the robotic arm is the vector sum of the attractive force
and the repulsive forces
from all obstacles:
where
is the number of obstacles. Under the action of the resultant force, the robotic arm moves in the direction of the resultant force, continuously updating its position. By iteratively calculating the resultant force and updating the position of the robotic arm, the robotic arm gradually avoids obstacles and approaches the target point until it reaches the target point, completing the path planning.
The APF method is popular because it is simple and easy to implement. It produces fairly smooth paths with low computational cost, which makes it a good fit for real-time applications. That said, it does have some drawbacks. One well-known problem is local optima: when the attractive and repulsive forces cancel each other out at some point, the robotic arm can become stuck in a local minimum and never reach the target. Another issue occurs when obstacles are too close to the goal—the repulsive force may then overpower the attractive force, keeping the arm from getting anywhere near the target. Also, in complex environments, building an effective potential field function becomes tricky, and the system can start to oscillate, which hurts overall planning performance.
2.3. Collision Detection
Whether a six-axis robotic arm can complete path planning in a 3D environment depends on the crucial step of collision detection for the robotic arm. obstacles are simplified into three-dimensional spheres, and the links of the robotic arm are simplified into cylinders. As shown in
Figure 2, Let the central axis of a certain link in the robotic arm be the line segment
P1P2, where
P1 and
P2 are the centers (3D coordinates) of the two joints of that link. Let the center of the obstacle ball be
O, with radius
R2, which has been expanded to account for the link radius
R1. Then, the formula for calculating the shortest distance d from the center
O to the line segment
P1P2 is:
Here,
= P
2 − P
1 is the direction vector of the connecting rod’s central axis, and the parameter t is determined by the projection of the center of the sphere O onto the line containing the line segment:
the radius R
1 of the cylinder simplified from the robotic arm is added to the radius R
2 of the sphere simplified from the obstacle. In this way, the collision detection between the robotic arm and the obstacle is simplified to determining the positional relationship between the central axis of the robotic arm link and the bounding sphere. Let the distance between the central axis and the bounding sphere be d, as shown in
Figure 2. The judgment formula for collision detection (10) is as follows:
To overcome the limitations of overly simplified obstacle models in conventional path planning simulations, this paper presents a realism-enhanced modeling method specifically designed for cable inspection scenarios. The proposed approach constructs a cable model that achieves a balance between physical fidelity and computational efficiency, focusing on three critical aspects: the static equilibrium configuration of the cable, its geometric discretization, and accurate collision detection.
Taking into account the natural sag of the cable when fixed at both ends and subjected to uniformly distributed gravity, the catenary equation is used to describe its centreline. Let the horizontal span of the cable be Let
be the length of the arc, with both endpoints at height
and the total arc length
. Then the central axis satisfies:
The parameter a is implicitly determined by the arc length constraint.
. When the sag-to-span ratio
, A parabolic approximation may be used:
To reduce the computational cost. This modeling approach accurately reflects the continuous bending behaviors of cables under the influence of gravity, avoiding the distortion in spatial representation associated with rigid straight-rod or simple spherical models.
To support efficient collision detection, the centreline of a continuous cable is discretised into a series of line segments of length
, and a capsule is constructed for each segment with that segment as its center and the cable radius
as its radius. The lengths of the discrete segments satisfy
, to ensure that adjacent capsules overlap. The entire cable is represented as a collection of capsules:
.
Theoretical analysis shows that when
is sufficiently small, the Hausdorff distance between the discrete model and the actual cable can be kept within a predetermined error bound, thereby achieving geometric fidelity in an engineering sense. A robotic arm linkage is simplified to a cylinder with a radius of
. Its central axis is the line segment
. The shortest distance between two expanding bodies is equal to the shortest distance between their central axes minus the sum of their radii:
In particular, denotes the Euclidean distance between two line segments. By solving a quadratic convex optimization problem and projecting onto the interval of line segment parameters An analytical expression for this distance can be obtained. The necessary and sufficient condition for a collision to occur is . This method yields an analytical closed-form solution, is computationally efficient, and ensures numerical stability as the distance function is continuously differentiable with respect to the robotic arm’s pose. Since the capsule model is entirely contained within the expanded section of the actual cable, if there is no collision between the robotic arm and the discrete capsule model, there will necessarily be no collision with the actual cable. Consequently, the collision detection method employed in this paper is conservative, providing a reliable safety margin for path planning. At the same time, by setting an upper bound on the length of the discrete segments the maximum geometric approximation error can be controlled to the order of , thereby balancing safety and computational efficiency.
3. Improved Algorithm Design
3.1. Bidirectional RRT Algorithm Improvement Strategy
Target-Biased Sampling Strategy
To address the blindness in the search process of the traditional bidirectional RRT algorithm, this study introduces a target-biased sampling strategy. The random sampling of the traditional algorithm lacks effective guidance towards the target direction, leading to low search efficiency. The core of the target-biased sampling strategy is to generate random points biased towards the target point with a certain probability. The specific implementation is that during each random sampling, a probability threshold is set. When generating a random point, the target point is selected as the random point with probability , while random sampling is performed in the entire configuration space with probability . This method allows the sample points to be more targetedly distributed near the target area, accelerating the search process.
From a mathematical perspective, assuming the random point in the configuration space is and the target point is , under the target-biased sampling strategy, the new random point can be generated as follows: when the randomly generated probability value is less than , ; when the randomly generated probability value is greater than or equal to , is generated in the configuration space according to the traditional random sampling method. This method increases the chances of sampling near the target point, making the tree’s expansion more inclined towards the target direction.
Consider a real-world case: a complex industrial workshop full of irregularly shaped obstacles. In such an environment, the traditional bidirectional RRT algorithm often wastes a lot of samples in areas far from the target, which makes the search take much longer. By using a target-biased sampling strategy, the algorithm can sample near the target with a higher probability, quickly pulling the tree to expand toward the goal and dramatically cutting down the search time. In a simulation experiment, with the probability threshold , in an environment containing 20 irregular obstacles, the traditional bidirectional RRT algorithm required an average of 5000 samples to find a path, while the improved algorithm with the target-biased sampling strategy required only an average of 2000 samples, improving the search efficiency by 60%.
The target-biased sampling strategy helps the bidirectional RRT algorithm search more effectively near the target area. It cuts down on wasted samples, boosts search efficiency, and makes it easier to find a feasible path quickly.
3.2. Target Gravitational Extension Strategy Combined with Dynamic Step Size
The traditional RRT algorithm extends a new node
from
towards
with a fixed step size. The extension formula is as follows:
In this paper, the extension method for x
new is improved by incorporating the concept of target gravity. The improved extension formula for the new node is:
In Equation (16), denotes the extension step size, is the Euclidean distance between the random sample and the nearest node , is the distance between the target node and , and represents the gravitational coefficient.
From the revised expansion formula, it is evident that the value of
has a direct impact on the growth direction of the random tree. Let
be the global initial value of the gravitational coefficient, λ
be the decay coefficient (damping coefficient), d
min be the current minimum distance between the robot arm and the obstacle and d
safe be the preset safety distance threshold.
Here,
k is the index of the expansion step. When the minimum distance between the robotic arm and an obstacle is less than or equal to the safety threshold, the attraction coefficient decays continuously according to the damping coefficient
λ, thereby reducing the guiding effect of the target attraction on the expansion direction. This causes the random tree to tend to expand toward the randomly sampled points, facilitating obstacle avoidance.
When any of the following conditions is met, the gravity coefficient is reset to the global initial value , and the expansion step size is restored to the initial step size .
If the condition dmin > dsafe holds for N consecutive iterations, and the current node has completely bypassed the obstacle area, obstacle avoidance is considered successful; if the distance between the current node and the target point is less than the preset threshold dgoal, it indicates that the specified area has been reached.
A larger amplifies the attractive influence of the target on the nearest node, steering the tree more aggressively toward the goal and thus improving search efficiency. In contrast, a smaller leads to more diffuse and widespread expansion, which facilitates obstacle avoidance by encouraging growth toward the random sample .
To balance these behaviors,
is initially set to a relatively high value. When the tree encounters an obstacle during expansion,
is progressively reduced by applying a decay factor, allowing the step size to adapt dynamically until the obstacle is cleared. Once the region is successfully navigated, both
and the step size revert to their original global values. This adaptive mechanism preserves the algorithm’s goal-directed characteristics while significantly enhancing its ability to maneuver through densely cluttered areas, thereby improving overall path planning performance [
21].
Figure 3 shows the improved new node generation diagram.
3.3. Potential Field Function Optimization
To help the conventional APF algorithm avoid obstacles better in complex environments, we refine the potential field function by taking into account obstacle-specific attributes and adding an adaptive parameter adjustment mechanism. These changes allow the repulsive force to be computed more accurately, so the robotic arm can respond more effectively to different types of obstacles.
In the traditional formulation, the repulsive force only depends on the distance between the arm and the obstacle, ignoring the obstacle’s shape and size. But in practice, obstacles with different geometries and dimensions pose different levels of threat. For example, at the same distance, a large rectangular obstacle and a small circular one clearly affect the arm’s movement differently. To capture these differences more precisely, we introduce two extra parameters: a shape factor and a size factor.
The shape factor is derived from the geometric characteristics of the obstacle. For a rectangular obstacle, it can be expressed as the ratio of length to width; For spherical obstacles, since their properties are the same in all directions, the direction of the repulsive force always lies along the shortest line connecting the center of the sphere and the robotic arm; therefore, the shape factor is defined as . Since the cylinder has a dominant axial characteristic, the repulsive force should be modulated based on the orientation of the robotic arm relative to the cylinder’s axis. Let the unit vector in the direction of the cylinder’s axis be a The base radius is rc, and the half-height is hc. Let n be the unit vector from the closest point on the cylinder’s axis to the closest point on the robotic arm, and define the shape factor as .
Where is the axial enhancement factor. This definition ensures that when the robotic arm is positioned on the side of the cylinder (n is perpendicular to a), . The repulsive force primarily manifests as radial deflection; when the robotic arm is oriented toward the end of the cylinder (n is parallel to a), . The repulsive force is increased to account for the additional resistance to motion at the interface.
The size factor is used to quantify the effect of an obstacle’s dimensions on the strength of the repulsive force; it is defined as the equivalent cross-sectional scale perpendicular to the shortest distance.
Spherical obstacle: radius R, with a size factor of
. Cylindrical obstacles: Taking into account the combined effects of the base radius and height on the obstructing effect, the size factor is defined as:
represents the height influence factor. The former applies to obstacles where height is the dominant factor, while the latter applies to general situations; the appropriate option can be selected based on the actual scenario.
η is the repulsive force gain coefficient; d is the shortest distance between the centerline of the robotic arm’s link and the obstacle; d0 is the obstacle influence distance threshold; n is the unit vector pointing from the obstacle to the nearest point on the robotic arm.
To enable the repulsive force to better adapt to different obstacles and environmental changes, this study adopts an adaptive parameter adjustment method. The repulsive coefficient
. These parameters—including the repulsive coefficient, shape factor, and size factor—are adjusted adaptively according to the relative position and distance between the robotic arm and nearby obstacles. The repulsion coefficient
is dynamically adjusted based on the shortest distance
d between the robotic arm and the obstacle; this is expressed using the following formula:
As the arm approaches an obstacle, the repulsive coefficient is increased to strengthen the repulsive effect, helping the arm avoid collision in a timely manner. Conversely, when the arm moves away, the coefficient is reduced to prevent excessive repulsion from interfering with its motion. The shape and size factors are updated in real time based on the actual geometry and dimensions of the obstacle, ensuring that the repulsive force calculation reflects the current situation more accurately. For irregularly shaped obstacles, contour information is acquired through sensors, and the corresponding shape factor is computed to further refine the repulsive force estimation. Based on sensor data, irregular obstacles are described using discrete point clouds or triangular meshes. To calculate the shape factor and size factor, an axis-aligned bounding box (AABB) or a minimum oriented bounding box (OBB) is computed using bounding box fitting, thereby obtaining the three-dimensional dimensions
Lx,
Ly,
Lz. The size factor is defined as the sum of the lengths of the three sides of the bounding box or the length of the longest side, serving as a measure of size:
. Define the anisotropy coefficient based on the aspect ratios of the three sides of the bounding box, using the shape factor as:
where
is the shape-sensitive coefficient This definition results in stronger repulsive force modulation along the axial direction for slender obstacles. For real-time simulation, point cloud data is updated at every control cycle, and the bounding box parameters are recalculated, thereby enabling dynamic adaptation of the shape factor and size factor.
Through the optimization of the potential field function described above, the obstacle avoidance capability of the improved APF algorithm in complex environments has been significantly improved. In a simulation environment containing obstacles of various shapes and sizes, the improved algorithm can more flexibly avoid obstacles, find better paths, and effectively improve the success rate and efficiency of path planning. The results of the simulation experiment are shown in
Figure 4. The effectiveness and improved efficiency of the optimized APF algorithm can be seen from the path planning success rate and average path length, as shown in
Table 1 below.
3.4. Trap Avoidance Strategy
To address the tendency of the conventional APF algorithm to become trapped in local optima, this study incorporates the simulated annealing algorithm as a trap avoidance mechanism. This approach enables the robotic arm to escape local minima and more effectively explore the solution space in search of a global optimum.
Simulated annealing is a probabilistic optimization method inspired by how metals cool and anneal in the real world. When you heat a metal to a high temperature, its atoms gain energy and move around freely. As the temperature slowly drops, the atoms slow down and eventually settle into a stable, low-energy structure. Simulated annealing works the same way: it uses a temperature parameter that decreases over time, and during this cooling process, it sometimes accepts worse solutions with a certain probability. This randomness helps the algorithm avoid becoming stuck in local optima too early, allowing it to explore the search space more thoroughly.
Let the pose of the robotic arm’s end-effector or in joint space be
. Here, Q represents the feasible configuration space of the robotic arm. During path planning, the configuration q
k at each discrete time step is treated as a state of the algorithm. Define the energy corresponding to state q as the total potential energy in the artificial potential field:
where
is the gravitational potential generated by the target point,
is the repulsive potential caused by the obstacle. The lower the value of the energy function
, the closer the state is to the optimal solution—that is, closer to the goal and farther from obstacles. Against the backdrop of robotic arm movement, In the context of robotic arm motion, this represents the change in potential energy resulting from
transition from the current state
to the candidate state
:
If this indicates that the candidate state results in a decrease in total potential energy (moving toward the goal or away from an obstacle), and is the preferred direction of movement; If this indicates a candidate state increases the total potential energy (possibly leading to a trap or moving away from the target), it may still be accepted with a certain probability according to the simulated annealing rules.
In the improved APF algorithm, the simulated annealing algorithm is incorporated into the calculation of the potential field. As the robotic arm moves within the potential field, each iteration determines whether to accept the current direction of motion based on the rules of the simulated annealing algorithm. Specifically, after calculating composite force
and obtaining
based on the aforementioned neighboring solution rule, Based on the current “temperature” (T), Generate a random number r in the range [0, 1]. If
r is less than the acceptance probability
, accept
as the next state; if
is greater than or equal to
, reject that direction and recalculate the resultant force. The acceptance probability
is typically calculated using the Metropolis rule, namely
Here, is the change in potential energy as defined above. As the iterations progress, T gradually decreases. The probability of accepting a suboptimal solution gradually decreases, and the algorithm gradually converges to the global optimal solution.
3.5. Potential Field Smoothing
Abrupt changes in the potential field seriously hurt the stability and reliability of the traditional APF algorithm in complex environments. To lessen their impact on the robotic arm’s movement, we smooth the potential field, which makes the obstacle avoidance process more stable.
Abrupt changes in the potential field tend to happen when the robotic arm becomes close to an obstacle. The repulsive field shifts sharply, causing violent fluctuations that make it hard to control the arm’s movement steadily. In narrow passages or areas with irregularly shaped obstacles, these sudden changes can subject the arm to forces that keep switching direction and strength within a short time. This leads to severe oscillations, and the arm may not be able to get through smoothly.
To address this, we use Gaussian filtering to smooth the repulsive field. Gaussian filtering is a common linear smoothing technique—it works by taking a weighted average of neighboring values. For the repulsive field, we pick a neighborhood of suitable size around each point, calculate the weights based on the Gaussian function, and then take a weighted average of the repulsive force values in that neighborhood. The result is a smoothed repulsive force value.
The specific implementation process of Gaussian filtering is as follows: for each point
in the repulsive field, its smoothed repulsive force value
can be calculated by the following formula:
where
is the Gaussian function:
is the standard deviation of the Gaussian function, which determines the degree of smoothing of the filter; is the size of the neighborhood, usually taken as a suitable odd number to ensure that the center of the neighborhood is the current point. is the original repulsive force value of the point in the neighborhood.
Applying Gaussian filtering to the repulsive field helps smooth out the abrupt changes, making the potential field much more stable. In a simulation environment with narrow passages and irregular obstacles, the smoothed field allows the robotic arm to move more steadily—no more violent oscillations, and it can successfully get through tricky areas. Experimental results show that this improved APF method, with potential field smoothing, boosts the obstacle avoidance success rate in complex environments by 25%, and the overall path planning stability improves noticeably. As can be seen from
Figure 5, there is a difference between the results before and after path smoothing.
Smoothing the potential field with Gaussian filtering reduces the impact of sudden changes on the arm’s movement. It makes the improved APF algorithm more stable and reliable in complex settings, which in turn helps the robotic arm move safely and smoothly.
3.6. Pruning and Path Smoothing Strategies
This strategy aims to address the issues commonly encountered in the RRT (Rapidly Exploring Random Trees) family of algorithms during path planning, namely path redundancy, slow convergence, and poor quality of the final path. Traditional RRT algorithms expand the tree structure through random sampling; whilst this enables rapid exploration of the search space, the resulting paths often contain a significant number of unnecessary detours and backtracking, resulting in paths that deviate considerably from the optimal path. To address this, this paper introduces the ‘triangle inequality pruning with target chains’ method, the core idea of which is as follows: This strategy mainly reduces the path length by expanding the search range of nodes to their parent nodes in the ChooseParent and Review functions, as shown in the figure. At the same time, if there is a collision-free path between x
new and x
tar, then x
new and x
tar are directly connected. This strategy can improve path quality and speed up the path generation. In addition, it is worth noting that, unlike the RRT-APF algorithm, the improved algorithm introduces a rewiring strategy and an optimization objective, making the tree structure converge to the target point more efficiently. This pruning strategy not only improves the ‘effective connection rate’ per expansion but also reduces the total path length through the geometric constraints imposed by the triangle inequality. Whereas the classical RRT requires tens of thousands of iterations to produce a viable path, this method can generate high-quality paths within a few hundred iterations, laying a solid foundation for subsequent smoothing [
22].
Figure 6 illustrates a pruning strategy for triangular inequalities.
Since the path is not a smooth curve, it may have a significant impact on the stability of the robotic arm in some segments. Therefore, after obtaining the initial path, this paper uses the cubic B-spline curve method for further optimization [
23]. Cubic B-splines have some nice properties. Each curve segment depends only on four neighboring control points, so moving one point only changes a small part of the curve—this makes local adjustments easy without messing up the overall smoothness. A cubic B-spline also keeps continuous first and second derivatives along the whole curve, which means velocity and acceleration change smoothly, meeting the robotic arm’s dynamic requirements. Another thing: B-splines do not force the curve to go exactly through every control point; the points just “guide” it roughly into position. This naturally takes the sharp corners off the original polyline and gives you a much smoother path.
The cubic B-spline curve formula is as follows:
Here, denotes the normalized arc length position of the current curve segment; the four basis functions constitute the weighting coefficients for this segment, and their sum is 1, ensuring the convex hull property of the curve; the sequence of control points is taken from four adjacent nodes in the original path (or from feature points obtained through sampling).
Cubic B-splines can effectively remove ‘jaggies’ and sharp angles from a path, resulting in a smoother change in curvature. However, it should be noted that excessive smoothing may cause the path to deviate from the original collision-free region, or even intrude into obstacles. Therefore, it is usually necessary to perform a collision detection after smoothing and make local adjustments to the intruding sections (such as adjusting control point weights or adding constraint points). The strategy outlined in this paper aims to maximize smoothness whilst preserving the original path topology, thereby striking a balance between ‘path length’ and ‘motion smoothness’.
3.7. Ablation Experiment
To validate the effectiveness of the key components in the improved bidirectional RRT and APF fusion algorithm proposed in this paper, ablation experiments were conducted in a cable detection simulation environment. Each configuration was run independently 50 times, and the average number of iterations, average planning time, average path length and average number of nodes were recorded, with the standard deviation of each metric calculated. The specific configurations are as follows: Complete algorithm, remove target-biased sampling and switch to uniform random sampling, Remove the dynamic gravitational coefficient adjustment and dynamic step size; set the gravitational coefficient to a fixed value of g = 1 and the step size to a fixed value of s = 50. The traditional APF potential function is used (excluding shape and size factors, with a fixed repulsive coefficient). Remove the mechanism for escaping local minima in simulated annealing; when a local optimum is reached, apply only random perturbations. Remove the Gaussian smoothing from the potential field and retain the original potential field. Remove triangle inequality pruning and cubic B-spline smoothing, and use only the original RRT path. The results of the ablation experiments are shown in
Table 2.
As can be seen from the table above, target-biased sampling has the greatest impact; upon its removal, the number of iterations increased by 90.2% and planning time increased by 68.0%, confirming that this strategy significantly enhances the directionality of the search. Performance deteriorated markedly following the removal of simulated annealing and dynamic attraction step sizes, with the number of iterations increasing by 78.0% and 63.4%, respectively, demonstrating the critical role of trap avoidance and adaptive obstacle avoidance strategies in complex cable environments. Triangular pruning and smoothing have the most pronounced effects on path length and the number of nodes; upon removal, path length increases by 9.8% and the number of nodes by 84.3%, with a significant increase in standard deviation, indicating that the pruning strategy effectively reduces redundancy and stabilizes path quality. The contributions of the optimized potential field function and Gaussian filtering were relatively modest; upon removal, the number of iterations increased by 43.9% and 34.1%, respectively, whilst the standard deviation of path length rose slightly, indicating that both play a supplementary stabilizing role in high-precision obstacle avoidance and smooth motion. The complete algorithm achieved the optimal mean and the smallest standard deviation across all metrics, demonstrating that the collaborative operation of all components enables efficient, stable, and smooth robotic arm path planning.
Figure 7 is a flowchart of the entire algorithm, designed to provide a comprehensive overview of the algorithm’s workflow.
5. Conclusions
To address the efficiency limitations of the RRT algorithm in 3D obstacle avoidance path planning for six-axis robotic arms—particularly its tendency to explore excessively large spaces and incur high computational costs—this paper proposes an improved approach. The method begins by determining an initial expansion step size based on an adaptive step size strategy. A probabilistic target-biased sampling mechanism is then introduced to guide the generation of random sample points, increasing the likelihood of expansion toward the goal and enhancing overall sample quality.
In addition, a gravitational component with an adjustable coefficient is incorporated into the node expansion process, making the growth of new nodes more goal-directed. Near obstacles, this is combined with a dynamic step size adjustment to help the random tree navigate around obstructions more effectively. Once an initial path is found, it undergoes pruning and optimization.
The refined APF algorithm is subsequently applied for local trajectory fine-tuning through several enhancements: optimization of the potential field function using obstacle-specific attributes for more accurate repulsive force computation, integration of simulated annealing as a trap avoidance mechanism to escape local minima, and application of Gaussian filtering to smooth the repulsive field and improve motion stability. After iteratively refining the path from start to goal, cubic B-spline curves are used to generate a final smooth trajectory.
Simulation experiments conducted in 2D and 3D environments (including dedicated robotic arm obstacle avoidance scenarios) demonstrate that the proposed improved bidirectional RRT-APF fusion algorithm outperforms the algorithm described in Ref. [
24], the bidirectional RRT, and the standard RRT–APF fusion method. The results indicate that both planning time and path length have been reduced, whilst trajectory characteristics are smoother; this confirms the algorithm’s effectiveness in enhancing three-dimensional obstacle-avoidance path planning for robotic arms. Its practicality has also been verified in physical experiments.
The improved bidirectional RRT-APF fusion algorithm proposed in this paper demonstrates superior path planning performance compared to the baseline methods in both simulation and physical experiments. Nevertheless, the current algorithm still relies on a traditional serial computing architecture, which may encounter computational bottlenecks when applied to cable inspection tasks that require extremely high real-time performance. To further enhance the algorithm’s execution efficiency and energy efficiency—especially its potential for deployment on embedded or mobile robotic platforms—we note that the parallel computing paradigm of Cellular Neural Networks (CNNs) offers distinct advantages in robot motion control.
Arena et al. [
25] presented a CNN-based chip for robot motion control. It solves partial differential equations in parallel using locally connected analog processing units, which allows obstacle avoidance and trajectory tracking with very low latency. Inspired by their work, we can map some of the key computations in our algorithm—such as potential field forces, collision detection, and the distance calculations used in triangle inequality pruning—onto a CNN architecture. The natural parallelism and analog nature of CNNs could greatly cut the per-iteration computation time. This is especially relevant for cable detection environments, where a lot of repetitive geometric calculations (e.g., shortest distance between a capsule and a cylinder) are needed. The grid-like parallel structure of CNNs is well suited to such tasks, and could potentially bring planning time down from milliseconds to microseconds.
Another limitation is that our algorithm currently uses fixed parameter settings. In future work, we could bring in reinforcement learning or Bayesian optimization to tune those parameters online, so the system can adapt to changes in cable layout or obstacle density. We also plan to combine the algorithm with neuromorphic hardware—like CNN-based biomimetic chips or FPGA accelerators—to build a real-time obstacle avoidance system that tightly integrates perception, planning, and control.