# Real-Time Hybrid Navigation System-Based Path Planning and Obstacle Avoidance for Mobile Robots
## 7 Obstacle-Avoidance
### Decide Offset Angle by Using WSM  
Let \(\alpha_{r},l_{r}\) be angular measure range and long-range of sensor. Let \(\alpha(t)\in[\text{-}\alpha_{\text{r}}/2,\,\alpha_{\text{r}}/2]\) be the desired offset angle of the robot at t when the robot detected the collision, The range of offset angle is based on angular measure range of sensor because the robot keeps moving at high speed that causes dangerous case when the robot turns to the unobservable direction. The offset angle is selected based on these below functions and conditions:  
**Function 1**. _l(\(\alpha\),t) is the distance that pulsed light wave emitted at \(\alpha\) was traveled at time t subtracts dead zone radius. This distance is extracted from sensors data;_  
**Function 2**. \(d_{\text{O}\min}^{R}(\alpha,t)\) is the smallest distance from the robot to the estimated relative trajectory; between the object and the robot at an alpha angle and time t;_  
**Function 3**. \(d_{\text{B}\min}^{R}(\alpha,t)\) is the smallest distance from the new estimated robot position to the desired trajectory when the robot moves in the direction formed by \(\alpha\);_  
**Function 4**. _t\({}_{\alpha}\)(a,t) is the time it takes a robot to achieve compensation angle \(\alpha\) at time t when the robot is moving with \(V_{R}\)(t), \(\omega\)(t);_  
**Condition 1**. _If l(\(\alpha\),t) is maximized at \(\alpha\), \(\alpha\) will be selected;_  
**Condition 2**. _If \(d_{\text{O}\min}^{R}(\alpha,t)\) is maximized at \(\alpha\), \(\alpha\) will be selected;_  
**Condition 3**. _If \(d_{\text{B}\min}^{R}(\alpha,t)\) is minimized at \(\alpha\), \(\alpha\) will be selected;_  
**Condition 4**. _If \(t_{\alpha}\)(a,t) is minimized at \(\alpha\), \(\alpha\) will be selected;_  
These conditions involve four objective functions (33) that must be optimized simultaneously. \[\left. \begin{array}{l}\underset{\alpha}{\max}[(\alpha,t)\\ \underset{\alpha}{\max}d_{\text{O}\min}^{R}(\alpha,t)\\ \underset{\alpha}{\min}d_{\text{B}\min}^{R}(\alpha,t)\\ \underset{\alpha}{\min}t_{\alpha}(\alpha,t)\end{array} \right\}\text{subject to }\alpha\in\left[-\frac{\alpha_{r}}{2},\frac{\alpha_{r}}{2}\right] \tag{33}\]  
A very common method to ranking candidate solutions against a set of n-objective functions is the weighted-sum method. WSM illustrated in Figure 12 turns original n-objective functions into a single objective function. This method's features are described in detail in [19]. We call the needed maximizing function is a beneficial factor and needed minimizing function is a non-beneficial factor. Before WSM takes its role, all factors should be normalized. A beneficial factor will be divided by its optimal value. Inverse of a non-beneficial factor will be multiplied by its optimal value. Let w\({}_{1}\), w\({}_{2}\), w\({}_{3}\), w\({}_{4}\) are weight values of WSM, respectively that meet condition w\({}_{1}+\)w\({}_{2}+\)w\({}_{3}+\)w\({}_{4}\) = 1. By WSM we obtain the total weighted factor f(\(\alpha\),t). Figure 12: Total weighted factor is recurred by WSM. The selected \(\alpha\) that optimal the total weighted factor. By this value, the new subtrajectory is generated. Let \(R_{\alpha}\) be the radius of circle those centers located at current position of the robot, \(\textbf{P}_{\alpha}(t)\) be any point on the circle can be determined via:  
\[\textbf{P}_{\alpha}(t)=R_{\alpha}\left[ \begin{array}{c}\cos(\psi_{R}(t)+ \alpha(t))\\ \sin(\psi_{R}(t)+\alpha(t))\end{array} \right]+\textbf{P}_{R}(t) \tag{34}\]  
\(\textbf{P}_{\alpha}(t)\) is also the destination point of the subtrajectory. Hence, there we have a new anchor point set that includes \(\textbf{P}_{R}(t)\) and \(\textbf{P}_{\alpha}(t)\) to produce subtrajectory. Figure 13 illustrates the subtrajectory set produced by the \(\textbf{P}_{\alpha}(t)\) with different offset angles. However, the value of \(R_{\alpha}\) depends on the current parameters and the kinematic constraint of the robot.