# Autonomous Agent Navigation Model Based on Artificial Potential Fields Assisted by Heuristics
## 3 Proposed Approach
### Artificial Potential Fields Approach  
Artificial Potential Fields (APFs) are defined as follows:  
\[F=-\
abla f_{p}(q) \tag{1}\]  
Hence, the gradient of a potential function \(f_{p}(q)\) (Equation (1)) yields the corresponding force in a space of the same dimensions as \(q\). Only two dimensions are considered herein (\(q\in\mathbb{R}^{2}\)): \(X\) and \(Y\). Notice that there is no constraint about the number of dimensions as long as \(f_{p}\) is derivable.  
The first potential functions proposed in [7; 8] generated by targets were directly proportional to the square of the straight-line distance to the desired point (\(x_{d}\) in Equation (2)). For obstacle avoidance, forces are inversely proportional to the square of the distance to object \(O\) (Equation (3)).  
\[f_{x_{d}}=\frac{1}{2}k_{p}(x-x_{d})^{2} \tag{2}\]  
where \(k_{p}\) is a magnitude-adjustment constant and \(x\) is the position of the agent.  
\[f_{O}=\left\{\begin{array}{ll}\frac{1}{2}\eta\left(\frac{1}{\rho}-\frac{1}{ \rho_{0}}\right)^{2}&\text{if }\rho\leq\rho_{0}\\ 0&\text{if }\rho>\rho_{0}\end{array}\right. \tag{3}\]  
Equation (2) acts as a proportional control. Therefore, \(F_{x_{d}}(0)=0\), which is desired when the target \(x_{d}\) is reached. On the other hand, in Equation (3), \(\rho_{0}\) is the influence limit distance, \(\rho\) is the shortest distance to obstacle \(O\) and \(\eta\) is a constant that allows the adjustment of the field's magnitude, depending on the intended behavior and considering the specific agent's dynamics and time restrictions. This results in a field that acts as a _barrier_, given that the function has an asymptote.  
Figure 1 shows a wall in black with a target in red. The agent is represented in blue in the lower left corner. A field is generated by the potential function (Equation (4)) around the wall. This figure illustrates how the repulsive forces generated by the wall can potentially cause a local minimum and make it very challenging for the agent to reach its target. Note that the agent is outside the area of influence of the potential field, that is, the effect of the \(\rho\) parameter.  
\[f_{O}=\left\{\begin{array}{ll}\frac{1}{2}k(\frac{1}{\rho})^{2}&\text{if }\rho\leq\rho_{0}\\ 0&\text{if }\rho<\rho_{0}\end{array}\right. \tag{4}\]  
where \(\rho\) is the distance to the obstacle and \(\rho_{0}\) is a limit that stops the field from progressing to infinity and eventually causing a division by 0. Parameter \(k\) is a constant that allows the adjustment of the generated field's magnitude, while (Equation (4)) is a simplification of (Equation (3)) with similar behavior.  
The aforementioned functions show two fundamental features that are not always useful. Equation (2) grows rapidly with distance; therefore, a velocity control is needed.  
Figure 1: Repulsor field generated by a wall. \(\rho_{0}=1.5\), \(k=1\).  
Equation (3) can yield forces as high as needed to avoid the obstacle. Although such behavior is desired, it is not suitable for any application since actuators will eventually saturate or even be destroyed. In case the agent's actuators are not able to stop the movement, \(\rho\) can reach the value 0 (Equation (4)), leading to a division-by-zero condition.