Skip to main content
. 2024 Feb 26;24(5):1520. doi: 10.3390/s24051520
Algorithm 1 APF-GFARRT Algorithm
01: Initialize Xinit, Xgoal, and other parameters.
02: Initialize an empty tree T with the root node as Xinit
03: for i=1 to MaxIterations do
04:  XrandNewRandPoint
05:  apf_forceAPF_attXrand,Xgoal
06:  XguidedGenerateGuidedXrand,apf_force
07:  DlineDistanceXguided,Xstart,Xgoal
08:  XnearNearestT,Xguided
09:  If CollisionFreeXnear, Xguided then
10:   obsDensityObstacleDensityXguided, fixedRadius
11:   adaptiveStepFuzzyAdaptiveStepobsDensityStep
12:   If findPath==0 then
13:    XnewSteerXnear,Xguided,adaptiveStep
14:   else
15:    αDlineDThreshold? ComputeAlphaK,Dline:1
16:    XnewSteerXnear,Xguided,adaptiveStepα
17:   end if
18:   XnearestNearCT,Xnew,r
19:   XminChooseBestParent(Xnearest,Xnew)
20:   AddNodeEdge(T,Xmin)
21:   XnearnewparentUpdateParent(Xnew,Xnearest)
22:   PruneNodesXnearnewparent,Xnearest
23:   RewireT
24:  end if
25:  if GoalReachedXnew, Xguided then
26:   return ReconstructPathT,Xinit,Xgoal
27:  end if
28: end for
29: return NoPathFound