A Novel AGV Path Planning Approach for Narrow Channels Based on the Bi-RRT Algorithm with a Failure Rate Threshold

The efficiency of the rapidly exploring random tree (RRT) falls short when efficiently guiding targets through constricted-passage environments, presenting issues such as sluggish convergence speed and elevated path costs. To overcome these algorithmic limitations, we propose a narrow-channel path-finding algorithm (named NCB-RRT) based on Bi-RRT with the addition of our proposed research failure rate threshold (RFRT) concept. Firstly, a three-stage search strategy is employed to generate sampling points guided by real-time sampling failure rates. By means of the balance strategy, two randomly growing trees are established to perform searching, which improves the success rate of the algorithm in narrow channel environments, accelerating the convergence speed and reducing the number of iterations required. Secondly, the parent node re-selection and path pruning strategy are integrated. This shortens the path length and greatly reduces the number of redundant nodes and inflection points. Finally, the path is optimized by utilizing segmented quadratic Bezier curves to achieve a smooth trajectory. This research shows that the NCB-RRT algorithm is better able to adapt to the complex narrow channel environment, and the performance is also greatly improved in terms of the path length and the number of inflection points. Compared with the RRT, RRT* and Bi-RRT algorithms, the success rate is increased by 2400%, 1900% and 11.11%, respectively.


Introduction
With the increasing economic benefits brought to traditional industries by automation and artificial intelligence technology, the need for industrial intelligence transformation is becoming more urgent.Automated Guided Vehicles (AGVs) are increasingly being used in various fields, such as in intelligent warehouses [1,2], automated ports [3,4], unmanned factories [5,6], and in smart agriculture [7,8], to improve the level of intelligence.AGVs have advantages such as their high work efficiency, low cost, and high safety.The research on AGVs includes navigation algorithms [9,10], path planning algorithms [11,12], path tracking algorithms [13,14], and vehicle scheduling algorithms [15,16].Of these, path planning determines the route by which the AGV will move, and plays a fundamental role in determining the operating costs.Moreover, as the operating environments of AGVs have become increasingly complex, path planning has remained a focus of and challenge in research [11].Currently, the most commonly used path planning algorithms include the graph-based A* [17] algorithm, the sample-based rapidly exploring random tree (RRT) [18] algorithm, and bio-inspired intelligent algorithms, of which the RRT algorithm is the most widely applied.
The RRT algorithm has several advantages, such as its simple structure, small number of parameters, complete path probability, ability to search effectively in a variety of environments, and the fact that there is no limitation on the spatial dimensions.However, the RRT algorithm also has several drawbacks, including node redundancy, slow convergence

Background 2.1. Problem Definition
This section uses mathematical symbols to describe the path planning problem of a forklift AGV.The state space is denoted by S, and the obstacle space composed of shelves is represented by S obs .The free search area without obstacles in the space is expressed as S search = S/S obs .(S, n start , n goal ) defines a path planning problem where the random tree is growing, n start is the root node of the tree, and n goal is the target node of the tree.If there is a continuous function f : [0, 1] → S, and the function is a bounded variation, then the function is a path.If v ∈ [0, 1], f (v) ∈ S search , then the path f is a collision-free path from the root node to the target node.
Definition 1 (Feasible path planning).For the path planning problem (S, n start , n goal ), v is collision-free, v(0) = n start , v(1) = n goal , and the feasible path is any solution corresponding to v. If no solutions are found, failure is reported.
Definition 2 (Shortest path planning).Given the path planning problem (S, n start , n goal ), after a viable path c(v*) is found, such that c(v*) = min c(v): v is feasible, where c(v) is the full length of the path v.If no solutions are found, failure is reported.Definition 3 (Fast path planning).Within a certain number of iterations i ∈ R, the optimal solution path with minimum cost is found.Failure is reported if the upper bound for the number of iterations is exceeded.

Related Work
The rapidly exploring random tree (RRT) [18] algorithm samples the free space in a completely random manner, and gradually establishes the construction of a search tree that extends from the root node to the target node.Different from RRT, the RRT* algorithm adds the parent node re-selection and path update strategies, making the cost of new nodes lower, so as to obtain a path at a lower cost than the RRT algorithm.The Bi-directional Rapidly exploring Random Tree (Bi-RRT) [23] algorithm generates two trees simultaneously, one from the root point and one from the target point.The speed of the bidirectional search is faster, and the success rate of path planning can be effectively improved.The algorithm proposed in this paper is improved based on Bi-RRT, and the pseudo-code for the Bi-RRT algorithm is shown in Algorithm 1.
The functions of the pseudo-code are explained as follows: • Sample: Random sample in the environment and return the sample point n rand .

•
Nearest(T, n rand ): Returns the node closest to n rand in the tree T.

•
Steer(n nearest , n rand ): Extend a length from n nearest to n rand to get a new node.
In the pseudo-code of the Bi-RRT algorithm, T 1 and T 2 are two trees growing from n start and n goal , respectively.E 1 and E 2 record the parent node information of all nodes in T 1 and T 2 , respectively.The first tree T 1 is grown by running lines 4-7, and extended to the new node n new .The expansion approach of the second tree T 2 differs slightly from that of T 1 as it involves two expansion steps.The details of the first step are described in lines 8-12, where the second tree expands in the direction of the new node n new to obtain the node n new .If there is no collision, lines 13-21 are executed to continue expanding in the same direction to obtain n new as the second step.Subsequently, the number of nodes in the two trees is compared, and the Swap function is used to exchange the tree with the fewest nodes with the first tree.This process is repeated until the two trees are connected.

Improved Bi-RRT Algorithm with Search Failure Rate Threshold (SFRT)
The NCB-RRT algorithm proposed in this paper improves the Bi-RRT algorithm in three main respects.Figure 1

Dual Index-Exchange Search Tree
The RRT algorithm has the problem of requiring a large amount of time when performing AGV path planning.Compared with RRT, the Bi-RRT algorithm has a faster search speed, but there is the risk that the search tree will become trapped by obstacles in narrow channel environments.The unbalanced growth of the search tree is not able to

•
Balanced growth strategy: The growth priority of the bidirectional tree of the Bi-RRT algorithm is improved.The number of nodes in each tree and the distance from the target point are used as cost indicators, and the growth of the tree with the lower cost is given priority in order to make the sampling more uniform.

•
High-quality search strategy: The node closest to the target point on the search tree is selected to carry out the search.Three search strategies were designed to adapt to different environments.The calculated real-time sampling failure rate was compared with the failure rate threshold to determine whether the current environment was simple, complex, or the most complex.When sampling becomes increasingly difficult, the adaptive sector search strategy, the dynamic right angle search strategy, and the target-biased RRT search strategy are gradually implemented to help the algorithm adapt to the obstacle environment.At the same time, the parent node re-selection and the path pruning methods are introduced to reduce redundant nodes and further improve search quality.

•
Path smoothing strategy: After generating an initial path, the piecewise quadratic Bezier curve method is used to optimize the corners of the path, so that the smoothness of the path is higher and more in line with the steering motion of AGV.

Dual Index-Exchange Search Tree
The RRT algorithm has the problem of requiring a large amount of time when performing AGV path planning.Compared with RRT, the Bi-RRT algorithm has a faster search speed, but there is the risk that the search tree will become trapped by obstacles in narrow channel environments.The unbalanced growth of the search tree is not able to give full play to the advantages of a two-way search.The main improvement presented in this section is that, on the one hand, two trees are extended simultaneously in each iteration; on the other hand, a value function is designed to optimize the birth order of the two trees.The value function is composed of two Indexes: the number of nodes and the distance.The value function of the two trees is calculated according to Equations (1) and (2): (1) where Value1 is the growth value of tree T 1 , which is extended from the root point, c 1p is the number of nodes of T 1 , and c 1l is the nearest distance between T 1 and the end point; Value2 is the growth value of tree T 2 , which is extended from the end point, c 2p is the number of nodes of T 2 , and c 2l is the nearest distance between T 2 and the root point.The value function is recalculated at each iteration.When Value1 is greater than Value2, T 2 grows preferentially.Otherwise, T 1 grows preferentially.

Three-Stage Search Strategy
The steps with which the Bi-RRT algorithm is extended are shown in Figure 2. Three search strategies are designed in this paper based on real-time sampling failure rate.The new search strategy will change the expansion of n rand and n new in Bi-RRT, so that the new algorithm can adapt to environments of different complexity.The search strategies are selected according to Equation (3): where p 1 and p 2 are the search failure rate threshold, p 1 , p 2 ∈ (0, 1), and p is the real-time sampling failure rate.The search failure rate threshold (SFRT) is designed as a value that is obtained by dividing the number of failed samples by the total number of samples.The search strategy of each sampling is determined by p.When p ≤ p 1 , the adaptive sector search (ASS) strategy is selected for the sampling points.When p 1 < p < p 2 , the dynamic right-angle search (DRAS) strategy is run for sampling; otherwise, the target biased RRT (TBRRT) search strategy is switched to.
Sensors 2023, 23, 7547 6 of 20 is obtained by dividing the number of failed samples by the total number of samples.The search strategy of each sampling is determined by p.When   , the adaptive sector search (ASS) strategy is selected for the sampling points.When    , the dynamic right-angle search (DRAS) strategy is run for sampling; otherwise, the target biased RRT (TBRRT) search strategy is switched to.The pseudo-code of the ASS strategy is shown in Algorithm 2. Firstly, the algorithm finds the nearest point nnearest of the search tree to the end point.In line 3, Algorithm 3 returns the set of reference points between nnearest and ngoal.Then, the reference point in the set that does not collide with nnearest is denoted as nnew by lines 4-10, and nnew is added to the search tree.If all the points in the set collide, then lines 11-16 are run, and a sampling point is returned from an adaptive sector area defined by Algorithm 4.  The pseudo-code of the ASS strategy is shown in Algorithm 2. Firstly, the algorithm finds the nearest point n nearest of the search tree to the end point.In line 3, Algorithm 3 returns the set of reference points between n nearest and n goal .Then, the reference point in the set that does not collide with n nearest is denoted as n new by lines 4-10, and n new is added to the search tree.If all the points in the set collide, then lines 11-16 are run, and a sampling point is returned from an adaptive sector area defined by Algorithm 4. The functions in the pseudo-code are as follows:

Algorithm
• Len: Calculate the length of the list.

•
Samplesector: Sample in a fan-shaped space and return new nodes.

•
Extending nodes: The collection of a series of reference points, which is composed of reference points (n ref in Figure 3) that extend around the vertices of each obstacle at a certain length.4), α is calculated, and r is calculated according to Equation ( 5): Sensors 2023, 23, 7547 where α is the central angle, r is the radius, k is the scaling factor, and L is the extended step size of AGV.The DRAS strategy and the ASS strategy are basically the same in the algorithm flow.The difference between the two is that the DRAS strategy replaces the sector sampling area in Algorithm 4 with the dynamic right-angle sampling area in Algorithm 5.The rightangle sampling region is expanded towards ngoal with nnearest as the right-angle vertex.The angle between any right-angle edge and the line segment connected by nnearest and ngoal is an acute angle.The shape of the right-angled sampling area when the ngoal is at the upper right of the nnearest is shown in Figure 6.The right-angled area is composed of two identical rectangles that are perpendicular to each other and superimposed.The longer side b1 and the shorter side b2 in the rectangle are determined according to Equations ( 6) and ( 7):    The DRAS strategy and the ASS strategy are basically the same in the algorithm flow.The difference between the two is that the DRAS strategy replaces the sector sampling area in Algorithm 4 with the dynamic right-angle sampling area in Algorithm 5.The rightangle sampling region is expanded towards ngoal with nnearest as the right-angle vertex.The angle between any right-angle edge and the line segment connected by nnearest and ngoal is an acute angle.The shape of the right-angled sampling area when the ngoal is at the upper right of the nnearest is shown in Figure 6.The right-angled area is composed of two identical rectangles that are perpendicular to each other and superimposed.The longer side b1 and the shorter side b2 in the rectangle are determined according to Equations ( 6) and (7): The DRAS strategy and the ASS strategy are basically the same in the algorithm flow.The difference between the two is that the DRAS strategy replaces the sector sampling area in Algorithm 4 with the dynamic right-angle sampling area in Algorithm 5.The right-angle sampling region is expanded towards n goal with n nearest as the right-angle vertex.The angle between any right-angle edge and the line segment connected by n nearest and n goal is an acute angle.The shape of the right-angled sampling area when the n goal is at the upper right of the n nearest is shown in Figure 6.The right-angled area is composed of two identical rectangles that are perpendicular to each other and superimposed.The longer side b 1 and the shorter side b 2 in the rectangle are determined according to Equations ( 6) and ( 7): where k 1 and k 2 are the gain coefficients, L is the extended step size of AGV, e is the Euler number, and p is the extended failure rate.As p keeps increasing, the sample area in Figure 6 gradually shrinks from the shape delineated in orange to that marked in green.
where k1 and k2 are the gain coefficients, L is the extended step size of AGV, e is the Euler number, and p is the extended failure rate.As p keeps increasing, the sample area in Figure 6 gradually shrinks from the shape delineated in orange to that marked in green.The functions in the pseudo-code that are different from those in the ASS strategy are described as follows: • rectangle: Calculate the length of two adjacent edges of the rectangle.

•
Srec: Plan out the right-angle sampling area.
The TBRRT search strategy indirectly affects the generation of nnew by adding a targetbiased strategy to the RRT to change the selection of nrand.Random sampling point selection is performed according to Equation ( 8): where rand() is a random number between 0 and 1, it is given randomly by the algorithm before TBRRT is run.m is the threshold of the target bias.The growth direction of new nodes is determined by m.When rand() > m, the growth tree will grow toward ngoal; otherwise, the growth tree grows randomly in the sampling space.
In this section, we design three search strategies.When the three strategies are used separately, ASS is more advantageous in simple environments.In more complex environments, the success rate of ASS will be reduced by half.DRAS has a high success rate in simple, complex, and more complex environments, and the feasible paths obtained in simple and complex environments are shorter, but DRAS has a longer search time in simple and complex environments than ASS.TBRRT can search in a global environment and find a feasible path without considering the number of iterations, so it can escape from local searches in extreme environments.However, TBRRT requires too many iterations and The functions in the pseudo-code that are different from those in the ASS strategy are described as follows: where rand() is a random number between 0 and 1, it is given randomly by the algorithm before TBRRT is run.m is the threshold of the target bias.The growth direction of new nodes is determined by m.When rand() > m, the growth tree will grow toward n goal ; otherwise, the growth tree grows randomly in the sampling space.
In this section, we design three search strategies.When the three strategies are used separately, ASS is more advantageous in simple environments.In more complex environments, the success rate of ASS will be reduced by half.DRAS has a high success rate in simple, complex, and more complex environments, and the feasible paths obtained in simple and complex environments are shorter, but DRAS has a longer search time in simple and complex environments than ASS.TBRRT can search in a global environment and find a feasible path without considering the number of iterations, so it can escape from local searches in extreme environments.However, TBRRT requires too many iterations and consumes too much time.Considering the advantage of the fast search time of the ASS in simple environments and the high success rate of DRAS in more complex environments, we use ASS when the SFRT is low, DRAS when the SFRT is high, and TBRRT when the use is higher.

Path Cost Optimization Strategy
The RRT and Bi-RRT algorithms have too many redundant nodes in narrow channel environments, which is an important reason for the high cost of the path.This paper optimizes the problem of node redundancy in the RRT algorithm in two ways.Firstly, with reference to the idea of the RRT* algorithm, the parent nodes re-selection strategy presented in Algorithm 6 is run after sampling new nodes, thus reducing the cost of the new nodes.Secondly, the path is triangularly trimmed after a feasible path has been obtained.
After each new node n new is obtained, the parent node re-selection strategy presented in Algorithm 6 is run.The strategy defines a neighborhood S near with n new as the center of the circle and a fixed length as the radius.Then, the algorithm takes the point n min in S near with the smallest path cost after connecting to n new as the parent node of n new .The triangle pruning strategy is employed after the algorithm finds a feasible path.At its core is the fact that the sum of the lengths of any two sides of a triangle is greater than the length of the third side.The path pruning process is shown in Figure 7.When the non-collision point n 2 in the original path is pruned, a new path, n 1 -n 3 -n 4 , is obtained.we use ASS when the SFRT is low, DRAS when the SFRT is high, and TBRRT when the use is higher.

Path Cost Optimization Strategy
The RRT and Bi-RRT algorithms have too many redundant nodes in narrow channel environments, which is an important reason for the high cost of the path.This paper optimizes the problem of node redundancy in the RRT algorithm in two ways.Firstly, with reference to the idea of the RRT* algorithm, the parent nodes re-selection strategy presented in Algorithm 6 is run after sampling new nodes, thus reducing the cost of the new nodes.Secondly, the path is triangularly trimmed after a feasible path has been obtained.
After each new node nnew is obtained, the parent node re-selection strategy presented in Algorithm 6 is run.The strategy defines a neighborhood Snear with nnew as the center of the circle and a fixed length as the radius.Then, the algorithm takes the point nmin in Snear with the smallest path cost after connecting to nnew as the parent node of nnew.The triangle pruning strategy is employed after the algorithm finds a feasible path.At its core is the fact that the sum of the lengths of any two sides of a triangle is greater than the length of the third side.The path pruning process is shown in Figure 7.When the non-collision point n2 in the original path is pruned, a new path, n1-n3-n4, is obtained.

Bezier Curve Optimization
Most of the path corners generated by the path planning algorithm are sharp turns, which can negatively impact the operation efficiency and stability of AGVs, and especially of heavy-duty AGVs.Therefore, it is necessary to smooth the corners of the path.Spline interpolation is widely used in path post-processing, but this would greatly change the original search path.At the same time, the Runge-Kutta phenomenon is prone to occur at high orders, and there is a lack of stability in narrow channel environments.Based on the work of Durakli et al. [34], this paper introduces a local path smoothing method based on a quadratic Bezier curve to smooth each path corner.The shape of the quadratic Bezier curve is determined according to Equation (9): where P 0 , P 1 , P 2 are control points, B(t) is a quadratic Bezier curve, and t is a time parameter.
According to the method designed by Durakli, P 0 , P 1 and P 2 are used as control points to generate a continuous arc line.P 0 and P 2 are retained in the new arc line, and P 1 is discarded.By replacing the two straight lines of P 0 -P 1 and P 1 -P 2 in the original path with new arcs, path smoothing at the inflection point of the path is achieved.
In particular, for the path processed using the ordinary methods, there is a possibility of collision occurring between the path and the obstacle.However, Durakli's method, described in this section, avoids collisions by adjusting the positions of P 0 and P 2 .This makes the work in this section more effective and superior.

Simulation Results
In this paper, we compared the simulation results of the NCB-RRT algorithm with those of the RRT, RRT* and Bi-RRT algorithms.Kang designed different environments to test the performance of the RRT algorithm [35].With reference to Kang's research on simulation environments, we established five simulation environments with which to evaluate the performance of the algorithms.
Firstly, four environments were used to evaluate the performance of the four algorithms.The sizes of the four environments were 500 cm × 500 cm, with the AGV running from (40,40) to (460,460).Figure 8a depicts a simple environment with few obstacles and a large free space.The multi-obstacle environment B is illustrated in Figure 8b, with a more dispersed obstacle distribution to test the convergence speed of the algorithm.Environment C featured concave-convex obstacles, as shown in Figure 8c, posing a significant challenge in obtaining the shortest path.Environment D represented a narrow channel environment, as shown in Figure 8d, where it is difficult of the algorithms to obtain a feasible path.
high orders, and there is a lack of stability in narrow channel environments.Based on the work of Durakli et al. [34], this paper introduces a local path smoothing method based on a quadratic Bezier curve to smooth each path corner.The shape of the quadratic Bezier curve is determined according to Equation ( 9): where P0, P1, P2 are control points, B(t) is a quadratic Bezier curve, and t is a time parameter.According to the method designed by Durakli, P0, P1 and P2 are used as control points to generate a continuous arc line.P0 and P2 are retained in the new arc line, and P1 is discarded.By replacing the two straight lines of P0-P1 and P1-P2 in the original path with new arcs, path smoothing at the inflection point of the path is achieved.
In particular, for the path processed using the ordinary methods, there is a possibility of collision occurring between the path and the obstacle.However, Durakli's method, described in this section, avoids collisions by adjusting the positions of P0 and P2.This makes the work in this section more effective and superior.

Simulation Results
In this paper, we compared the simulation results of the NCB-RRT algorithm with those of the RRT, RRT* and Bi-RRT algorithms.Kang designed different environments to test the performance of the RRT algorithm [35].With reference to Kang's research on simulation environments, we established five simulation environments with which to evaluate the performance of the algorithms.
Firstly, four environments were used to evaluate the performance of the four algorithms.The sizes of the four environments were 500 cm × 500 cm, with the AGV running from (40,40) to (460,460).Figure 8a depicts a simple environment with few obstacles and a large free space.The multi-obstacle environment B is illustrated in Figure 8b, with a more dispersed obstacle distribution to test the convergence speed of the algorithm.Environment C featured concave-convex obstacles, as shown in Figure 8c, posing a significant challenge in obtaining the shortest path.Environment D represented a narrow channel environment, as shown in Figure 8d, where it is difficult of the algorithms to obtain a feasible path.Next, a more complex environment E was established to test the superiority of the algorithm.This environment was based on an actual map of a railway warehouse, and integrated the characteristics of environments A-D.The size of environment E was 8000 cm × 4800 cm, with the AGV running from (40,40) to (460,460).In Figure 8e, the white part  C, D, and E, respectively.(f) Overhead view of the forklift AGV.The vertical length of the AGV is 3r (r = 570 cm), the horizontal length is a (a = 775 cm), the geometric center of the AGV is the center of the circle.The blue rectangle is the driving wheel that controls the front and back movement of the AGV, and it is able to control the steering movement of the AGV.The green rectangle is the driven wheel.
Next, a more complex environment E was established to test the superiority of the algorithm.This environment was based on an actual map of a railway warehouse, and integrated the characteristics of environments A-D.The size of environment E was 8000 cm × 4800 cm, with the AGV running from (40,40) to (460,460).In Figure 8e, the white part represents the sampling area, and the black rectangles represent the shelves.In order to search for the AGV as a particle, we extend the projection size of the AGV to the shelves.The slate-grey area around the shelves is the extended range, and the obstacles are composed of black and slate-grey rectangles together.The top view of the AGV is shown in Figure 8f, and the slate-grey expansion distance is the radius of the yellow circle.
In particular, the search part of the NBC-RRT proposed in this paper consists of three stages.The SFRT is the indicator that divides the three stages.To optimize the performance of the NCB-RRT, different thresholds need to be selected for different environments.Therefore, the combination of the SFRT traverses the distance between 0 and 1 at a step size of 0.1.We designed a cost function to select the group with the lowest average cost in each environment as the final threshold.The cost function is as show in Equation ( 10): where Cost is the total cost, node is the average number of nodes, len is the average path length, iter is the average number of iterations, and t is the average running time.Each group was iterated for 20 rounds to obtain the threshold data of Table 1.The role of the three search strategies of NBC-RRT in different environments is shown in Figure 9.A is a simple environment.Although ASS is able to search faster, DRAS accounts for 80% of the whole process because of its greater advantages in terms of path length.The number of obstacles in environment B is large and scattered, causing the algorithm to easily become trapped in local optima; therefore, TBRRT is needed to give full play to its advantages in terms of global search.The barrier-free space of environment C is more continuous than that of environment B, so the path disadvantage of ASS is not obvious compared with DRAS.At the same time, the rapid search of ASS causes the overall advantages of ASS to seem more prominent, such that the use of ASS in environment C reaches 50%.
In particular, the bumpy obstacles in Environment C make it easy to get stuck, causing TBRRT to be used for up to 40% of the process.Environment D has two continuous large barrier-free spaces, which makes it easier for ASS to take advantage of its search speed and help the algorithm to reach the narrow channel as soon as possible.The narrow channel is a more complex environment, however, and DRAS can achieve higher success rates in more complex environments under the same number of iterations, so DRAS also plays a great role.In particular, there are few obstacles in environment D, and they are evenly distributed, so the proportion of the process for which TBRRT is used is very small.The barrier-free space of Environment E is small, which makes it impossible for ASS to exert its speed advantage.Similar to environment D, environment E has more home channel space, resulting in DRAS playing a more important role.At the same time, the obstacles in environment E are evenly distributed, so the use of TBRRT is also very low.In addition, it can easily be seen from Figure 9 that the SFRTs of environment A and E are consistent.However, after the above analysis, the reasons for which DRAS has an advantage in these two environments are different.In Environment A, the path advantage of DRAS results in it playing a greater role, while in environment E, it relies more on the ability of DRAS to successfully search in more complex environments.successfully search in more complex environments.

Performance Testing
The paths planned by the four algorithms in the four environments are shown in Figure 10.The root points and the target points are represented by the blue squares and the blue pentagrams, respectively.The growth trees are represented by the green lines, and the obtained paths are indicated by the red lines.The smoothed paths are the blue lines.It can be seen from Figure 10 that the RRT algorithm occupies a large search space.
Although RRT was able to obtain a feasible path, that path is long, and there are too many inflection points.Compared with the RRT algorithm, the RRT* algorithm was able to plan a shorter path.However, RRT* needed to be iterated continuously throughout the space, making it difficult to balance the path cost and time consumption.The Bi-RRT algorithm reduced the number of redundant points by using a two-way search, and was able to quickly find a feasible path.However, there are many corners in the obtained path, which may lead to the unstable operation of AGVs in real environments.

Performance Testing
The paths planned by the four algorithms in the four environments are shown in Figure 10.The root points and the target points are represented by the blue squares and the blue pentagrams, respectively.The growth trees are represented by the green lines, and the obtained paths are indicated by the red lines.The smoothed paths are the blue lines.It can be seen from Figure 10 that the RRT algorithm occupies a large search space.Although RRT was able to obtain a feasible path, that path is long, and there are too many inflection points.Compared with the RRT algorithm, the RRT* algorithm was able to plan a shorter path.However, RRT* needed to be iterated continuously throughout the space, making it difficult to balance the path cost and time consumption.The Bi-RRT algorithm reduced the number of redundant points by using a two-way search, and was able to quickly find a feasible path.However, there are many corners in the obtained path, which may lead to the unstable operation of AGVs in real environments.
In contrast, the red solid line of the fourth image of each row represents the planning results of the NCB-RRT algorithm proposed in this paper, and the blue solid line is the smoothed path.Compared with the RRT, RRT* and Bi-RRT algorithms, the NCB-RRT algorithm was able to effectively deal with a variety of environments with fewer iterations.As shown in Figure 10a, the path obtained using the NCB-RRT algorithm has the fewest path inflection points.It is not difficult to see from Figure 10b,c that the path obtained using the NCB-RRT algorithm has the largest turning angle, causing the AGV to run more smoothly in the multi-obstacle and concave-convex environments.In the narrow channel environment shown in Figure 10d, the NCB-RRT algorithm can still obtain a feasible path quickly.After optimizing the path using the segmented quadratic Bezier curve, the path turning is smoother and more suitable for the AGV's steering motion.
The average data of the four algorithms after being run 100 times on the simple environment (Figure 10a), the multi-obstacle environment (Figure 10b), the concave-convex environment (Figure 10c), and the narrow channel environment (Figure 10d) are shown in Tables 2-5, respectively.
From Tables 2-5, it is evident that as the environment complexity increased, finding a path became more challenging for the RRT and RRT* algorithms.The Bi-RRT algorithm managed to find feasible paths in all four environments, but the path cost was higher than RRT*.The NCB-RRT algorithm proposed in this paper is obviously superior to the other algorithms.Firstly, the NCB-RRT algorithm can still be rapidly implemented in a narrow channel environment due to the balanced growth strategy of the bidirectional tree.
Secondly, the three-stage search strategy makes NCB-RRT better able to adapt to different environments, improving the success rate of path finding.Thirdly, NCB-RRT achieves a shorter path cost and fewer turns through the combination of the parent node re-selection strategy and the triangle pruning strategy.The simulation results show that the search ability of NCB-RRT is better than that of other algorithms.It is also notable that NCB-RRT is able to balance performance indicators such as path cost, number of iterations, and number of corners.Of these, corners are defined as places in the path where it is necessary to turn.Compared with RRT, RRT*, and Bi-RRT, NCB-RRT acheives a reduction in path cost of 17.15-40.7%,a decrease in the number of corners by 66.11-94.18%,a decrease in the number of iterations by up to 96.44%, and a reduction in time consumption of up to 92.54%.In contrast, the red solid line of the fourth image of each row represents the planning results of the NCB-RRT algorithm proposed in this paper, and the blue solid line is the smoothed path.Compared with the RRT, RRT* and Bi-RRT algorithms, the NCB-RRT al- of inflection points in a variety of environments.At the same time, the NBC-RRT algorithm is able to balance this performance against time consumption and number of iterations.It is not difficult to see from Figure 12e that with increasingly complex environments, the gap between the success rate of the algorithm proposed in this paper and the success rate of the other algorithms gradually expands.The NCB-RRT algorithm can obtain better paths in five environments, thus demonstrating the superiority of the NCB-RRT algorithm.

Discussion
A superior AGV trajectory will embody characteristics such as minimal path cost, small numbers of corners, minimal time consumption, low number of iterations, and a smooth route.The simulation results show that the balanced strategy helps NCB-RRT solve the problem of tree growth being trapped in narrow channel environments.The proposed balanced growth strategy reduces the consumption and number of iterations of the algorithm.It is not difficult to see from Figure 12b,c that the NCB-RRT algorithm has the lowest time consumption and number of iterations in each environment.The analysis presented in Tables 2-6 shows that compared with Bi-RRT, the time consumption overhead and number of iterations of the NCB-RRT algorithm are reduced by up to 93.4% and 57.93%, respectively.
The three-stage search strategy improves the success rate of NCB-RRT in narrow channel environments, and maintains its search advantage in other environments.The success rate of NCB-RRT is the highest in each environment, as shown in Figure 12e.Compared with the RRT, RRT* and Bi-RRT algorithms, the success rate of the algorithm proposed in this paper represents and increase of up to 2400%, 1900% and 11.11%, respec-

Discussion
A superior AGV trajectory will embody characteristics such as minimal path cost, small numbers of corners, minimal time consumption, low number of iterations, and a smooth route.The simulation results show that the balanced strategy helps NCB-RRT solve the problem of tree growth being trapped in narrow channel environments.The proposed balanced growth strategy reduces the consumption and number of iterations of the algorithm.It is not difficult to see from Figure 12b,c that the NCB-RRT algorithm has the lowest time consumption and number of iterations in each environment.The analysis presented in Tables 2-6 shows that compared with Bi-RRT, the time consumption overhead and number of iterations of the NCB-RRT algorithm are reduced by up to 93.4% and 57.93%, respectively.
The three-stage search strategy improves the success rate of NCB-RRT in narrow channel environments, and maintains its search advantage in other environments.The success rate of NCB-RRT is the highest in each environment, as shown in Figure 12e.Compared with the RRT, RRT* and Bi-RRT algorithms, the success rate of the algorithm proposed in this paper represents and increase of up to 2400%, 1900% and 11.11%, respectively.The introduction of the parent node re-selection strategy allows NCB-RRT to initially optimize tree growth during the search process.By integrating the triangle construction strategy, NCB-RRT is able to trim the path well both during and after the search process.The fusion of the two methods solves the problems of there being too many path turns and too much instability in the RRT algorithm.As seen in Figures 10 and 11, the paths obtained using NCB-RRT have the fewest inflection points.The analysis presented in Tables 2-6 shows that the number of corners using the proposed algorithm is much smaller than using the other algorithms.Compared with the RRT, RRT* and Bi-RRT algorithms, the number of corners obtained using the NCB-RRT algorithm represents a reduction by 94.18%, 93.75% and 94.24%, respectively.
By optimizing the corners using a piecewise quadratic Bezier curve to make the path smoother, the difficulty of the path obtained not being suitable for AGV operation is solved.It can be seen from the blue lines in Figures 10 and 11 that the optimized paths allow smoother transit at the corners, thus meeting the expected requirements.
It is not difficult to see from Figures 10 and 11 that the algorithm proposed in this paper is able to find a better path in a narrow channel environment, while still having good performance in other environments.However, compared with Bi-RRT, NCB-RRT adds more strategies, which results in it having some weaknesses.It can be seen from Table 3 that the running time of NCB-RRT is slightly higher than that of Bi-RRT in relatively simple environments.

Conclusions
In this paper, the NCB-RRT algorithm with sampling SFRT was proposed to solve the path planning problem for AGVs in narrow channels.Firstly, two alternating random trees were established using the balance strategy to search for new nodes.Then, we designed a three-stage search strategy to improve the quality of the sampling points.The new search method demonstrated a higher success rate and a greater adaptability than the RRT, RRT* and Bi-RRT algorithms in an actual warehouse environment with narrow channels.Next, we added the parent node re-selection strategy following the generation of new nodes, and the path pruning strategy was performed after the generation of the initial path.The problems of faced by the RRT and RRT* algorithms of having too many redundant nodes, too many iterations and excessive path length were solved by the integrated path pruning strategy.Finally, the segmented quadratic Bezier curve was used to further optimize the path, so that the path corner was smooth and more in line with the driving requirements of the AGV.The simulation results showed that the proposed algorithm is able to effectively reduce the path cost and improve the search efficiency through complex narrow channel environments.However, this algorithm only takes the path planning of a single AGV into consideration.In actual storage application, increasing numbers of collaborating AGVs are required for transportation, and this will be the next topic to be studied.

20 Figure 1 .
Figure 1.The process of the improved algorithm.

Figure 1 .
Figure 1.The process of the improved algorithm.

Figure 2 .
Figure 2. Two-way search tree expansion diagram.T1 is a random tree that starts from the starting point nstart, T2 is a random tree that starts from the end point ngoal, nnew is a new node extended by T1, n′new and n″new are nodes grown by T2.

Figure 2 .
Figure 2. Two-way search tree expansion diagram.T 1 is a random tree that starts from the starting point n start , T 2 is a random tree that starts from the end point n goal , n new is a new node extended by T 1 , n new and n new are nodes grown by T 2 .
• S sur : A rectangular dynamic search region between n nearest and n goal .• Angle: Calculate the central angle and radius of the fan from n nearest to n goal .• S sec : Plan out the fan-shaped sampling area.Sensors 2023, 23, 7547 8 of 20

Figure 4 .
Figure 4. Select the reference points.

Figure 3 .
Figure 3. Reference point extension diagram.The generation of reference points is shown in Figure 3.The cyan circle n ref is the reference point, which is obtained by extending each vertex of the obstacle outward.The dark green points in Figure 4 are the returned reference points, which are distributed in a square with its center between n nearest and n goal .O is the center of the square, d is the distance from n nearest to O, and a is the side length of the square area.The dark green circle n ref is the reference point to return.The fan-shaped sampling area is shown in Figure 5.The line segment composed of the fan-shaped vertex n nearest and the end point n goal divides the fan-shaped center angle α.The center angle α and radius r are related to the real-time sampling failure rate p.As the failure rate increases, the central angle becomes larger, and the radius becomes smaller.According to Equation (4), α is calculated, and r is calculated according to Equation (5):

Figure 4 .
Figure 4. Select the reference points.

Figure 4 .
Figure 4. Select the reference points.

Figure 4 .
Figure 4. Select the reference points.

•:
rectangleCalculate the length of two adjacent edges of the rectangle.• S rec : Plan out the right-angle sampling area.The TBRRT search strategy indirectly affects the generation of n new by adding a targetbiased strategy to the RRT to change the selection of n rand .Random sampling point selection is performed according to Equation (8):

Figure 8 .
Figure 8. Simulation environment and forklift AGV dimensions.(a-e) Simulation environments A, B, C, D, and E, respectively.(f) Overhead view of the forklift AGV.The vertical length of the AGVis 3r (r = 570 cm), the horizontal length is a (a = 775 cm), the geometric center of the AGV is the center of the circle.The blue rectangle is the driving wheel that controls the front and back movement of the AGV, and it is able to control the steering movement of the AGV.The green rectangle is the driven wheel.

Figure 8 .
Figure 8. Simulation environment and forklift AGV dimensions.(a-e) Simulation environments A, B, C, D, and E, respectively.(f) Overhead view of the forklift AGV.The vertical length of the AGV is 3r (r = 570 cm), the horizontal length is a (a = 775 cm), the geometric center of the AGV is the center of the circle.The blue rectangle is the driving wheel that controls the front and back movement of the AGV, and it is able to control the steering movement of the AGV.The green rectangle is the driven wheel.

Figure 9 .
Figure 9. SFRT of the search strategy of NBC-RRT in five environments.

Figure 9 .
Figure 9. SFRT of the search strategy of NBC-RRT in five environments.

Sensors 2023, 23 , 7547 14 of 20 Figure 10 .
Figure 10.Path results of four algorithms in four environments.(a-d) Simple environment, multiobstacle environment, concave-convex environment and narrow channel environment, respectively.In each row, the planning results obtained by the RRT, RRT*, Bi-RRT and NCB-RRT algorithms are presented from left to right, respectively.The blue square is nstart, and the blue pentagram is ngoal.

Figure 10 .
Figure 10.Path results of four algorithms in four environments.(a-d) Simple environment, multiobstacle environment, concave-convex environment and narrow channel environment, respectively.In each row, the planning results obtained by the RRT, RRT*, Bi-RRT and NCB-RRT algorithms are presented from left to right, respectively.The blue square is n start , and the blue pentagram is n goal .

Figure 12 .
Figure 12.The performance of each algorithm in five environments.(a-d) Average path length, average time, average number of iterations and average number of corners of RRT, RRT*, Bi-RRT and NCB-RRT, respectively; the lower the value, the better the performance.(e) Success rate of path finding; the higher the value, the better the performance.

Figure 12 .
Figure 12.The performance of each algorithm in five environments.(a-d) Average path length, average time, average number of iterations and average number of corners of RRT, RRT*, Bi-RRT and NCB-RRT, respectively; the lower the value, the better the performance.(e) Success rate of path finding; the higher the value, the better the performance.