**4.4.1 Obstacle nature prediction: Time collision concept**

Typically ultrasonic sensors calculate the distance between the robot and the obstacle and therefore they do not provide information about the obstacle's nature (mobile or static) and its position in the future state. However, this kind of information is necessary to predict conflict situations in the future. In order to overcome this problem, in our work, the robot uses this distance to calculate new information called "Time Collision" between the robot and the obstacle.

The Time Collision (TC) represents the time left for the robot before a collision occurs with an obstacle. In order to predict the nature and the position of the obstacle in the future, the robot operates as follows. At time Ti, the robot should observe its environment (using the perception model). If it detects an obstacle, it calculates a Time Collision Needed (TCN) representing the time required to collide with this obstacle in the future while keeping the same velocity (see figure 3). At time Ti+1, it repeats the same procedure to recalculate a Time Collision Remaining (TCR) representing the time required to collide the same obstacle in the future while keeping the same velocity (see figure 3). The TC can be obtained by applying the formula 2. Di represents the distance between the robot and the obstacle at time Ti, and VRi represents the velocity of the robot.

$$\text{TC} = \text{D}\_i / \text{VR}\_i \tag{2}$$

Fig. 3. Illustration of "the Time Collision".

From these two values, the robot can calculate a Difference Time Collision (DTC) with this obstacle by applying formula 3. If the DTC is equal to zero, it means that the obstacle in the trajectory of the robot is static. In this situation, the robot should immediately change its direction in order to avoid local minimum. If the DTC is positive, then the obstacle is considered as a mobile one. In this situation, the robot can expect that the trajectory will be free after a period of time and then it does not need to change its direction. If the DTC is negative, then obstacle is mobile and it is going towards the robot. In this case, the robot should minimise its velocity in order to avoid conflict with this obstacle, and then decide to change the direction completely if it is possible (moves to another subspace, which is safe), or wait until this mobile object moves away (the current subspace will be free), if there is no other free subspace.

$$\text{DITC=TCN-TCR} \tag{3}$$

The advantage of this information is that it allows the robot not only to avoid collision and local minimum at real time with obstacles around it, but also to anticipate their natures and their positions in the future so as to predict conflict situations.

We present in figure 4 the FLC of angular velocity. We describe four linguistic variables that are: the DTCL, DTCF, DTCR, and TO. These variables represent respectively: the difference time collision on the left, the difference time collision in the front, the difference time collision on the right and the current target orientation between the robot and the goal. Each

Fig. 4. Fuzzy controller of heading angular

DTC have two membership functions: Fixed Obstacle and Moving Obstacle. The DTCL is used to control the left area. We present in algorithm 1 the reasoning process of the robot that is used to predict the nature of the nearest obstacle in this area. Thus, if the DTCL is


152 Serial and Parallel Robot Manipulators – Kinematics, Dynamics, Control and Optimization

direction of the robot or not. In contrast, the velocity allows the robot to predict if there is conflict in the future. In the reminder of this section, we present robot behaviour modules implemented as fuzzy logic controllers. Each behaviour module receives data input that describes the situation and produces an output to be addressed to the actuators. Our fuzzy architecture is composed of two fuzzy controllers. The first controller is in charge of determining the angular velocity of the two wheels. This controller allows the robot to change its angular orientation based on the prediction of the nature of the obstacle, in order to avoid conflict and to move closer to its target. The second controller uses the velocity of the obstacle. It is in charge of determining whether the robot's speed should be increased (accelerate its speed if there is a free space) or decreased (minimise its speed if there is an

Typically ultrasonic sensors calculate the distance between the robot and the obstacle and therefore they do not provide information about the obstacle's nature (mobile or static) and its position in the future state. However, this kind of information is necessary to predict conflict situations in the future. In order to overcome this problem, in our work, the robot uses this distance to calculate new information called "Time Collision" between the robot

The Time Collision (TC) represents the time left for the robot before a collision occurs with an obstacle. In order to predict the nature and the position of the obstacle in the future, the robot operates as follows. At time Ti, the robot should observe its environment (using the perception model). If it detects an obstacle, it calculates a Time Collision Needed (TCN) representing the time required to collide with this obstacle in the future while keeping the same velocity (see figure 3). At time Ti+1, it repeats the same procedure to recalculate a Time Collision Remaining (TCR) representing the time required to collide the same obstacle in the future while keeping the same velocity (see figure 3). The TC can be obtained by applying the formula 2. Di represents the distance between the robot and the obstacle at

TC=Di/VRi (2)

From these two values, the robot can calculate a Difference Time Collision (DTC) with this obstacle by applying formula 3. If the DTC is equal to zero, it means that the obstacle in the trajectory of the robot is static. In this situation, the robot should immediately change its direction in order to avoid local minimum. If the DTC is positive, then the obstacle is

obstacle in its trajectory).

and the obstacle.

**4.4.1 Obstacle nature prediction: Time collision concept** 

time Ti, and VRi represents the velocity of the robot.

Fig. 3. Illustration of "the Time Collision".


Algorithm 1. The robot's behaviour is based on the prediction of the nature of the obstacles in left and right areas

smaller or equal to Δ (the time interval between two successive perceptions) it means that the obstacle is static; else it is considered as mobile. We can obtain the value of this variable from the formula 4. The same reasoning process is applied to the right area based on the DTCR that can be obtained from the formula 5. The value of DTCF variable can be obtained from the formula 6. Algorithm 2 describes the reasoning mechanism of the robot that is used to predict the nature of the nearest obstacle in the front area. For example, if the DTCF is equal to zero, this means that the obstacle is static. Therefore, the robot should change its trajectory immediately in order to avoid collision. Otherwise, if the DTCF is equal to infinity, this means that the space is free. In order to move toward a specific goal, the robot

A Reactive Anticipation for Autonomous Robot Navigation 155

The fuzzy controller for angular velocity uses the DTC that gives information about the nature of an obstacle and its trajectory. So, the robot is able to predict the future situation of the environment if it keeps moving in the same direction. While the second fuzzy controller for linear velocity uses the obstacle's velocity in the front area. This information determines whether the robot's speed should be increased or decreased to respond to the nearest

Hence, the obstacle's velocity can be calculated according to formula 7 where D represents

The distance D is calculated according to formula 8 where Xc and Yc represent the

c and Y'

2

Xc=Xa+൫Xb-Xa൯ cos θ -(Yb-Ya)sin θ Yc=Ya+ሺYb-Yaሻ cos θ +(Xb-Xa)sin θ

Cord= (9)

+(X'c-Y'c)

2

ϑ = D/Δ (7)

c represent the coordinates of the obstacle

(8)

Fig. 6. The definition of angular velocity output membership functions.

**4.4.2 Linear velocity prediction: Obstacle velocity concept** 

the distance travelled by the obstacle during the time interval Δ.

at ti+Δ (see figure 7). The coordinates are obtained according to formula 9.

coordinates of the obstacle at time ti and X'

D=ට(Xc-Yc)

Fig. 7. Illustration of distance traversed by the obstacle.

situation detected.

1: **if** (DTCF) =0 **then** 2: The obstacle is static. The robot should change its trajectory 4: **else** 5: **if** ((DTCF)>0) and ((DTCF) < + ∞) **then** 6: The obstacle is mobile and it is moving away from the robot. 7: **else** 8: **if** ((DTCF) <0) and ((DTCF)> −∞) **then** 9: The obstacle is mobile and it is going toward the robot. 10: **else** 11: **if** (DTCF) =- ∞ **then** 12: The space is considered as free at ti 13: **else** 14: **if** (INF (DTCF) =+ ∞ **then** 15: No obstacle in front of the robot. Free space 17: **end if** 18: **end if** 19: **end if** 20: **end if** 21: **end if** 

Algorithm 2. The robot's behaviour is based on the prediction of the nature of the obstacles in front area

should have an idea about the area in which the target exists. For this purpose, the TO which gives an idea about this position is combined with the DTC for each area in order to reach a compromise between "avoid conflict" and "reach goal". The TO has three membership functions that are: L: Left, F: Front, R: Right. The output of this controller is the angular velocity, it has five membership functions: LLT: Large Left Turn, SLT: Small Left Turn, NT: No Turn, SRT: Small Right Turn, LRT: Large Right Turn. Note that figure 5 describes the input of the fuzzy sets involved in the definition of the heading angular. Figure 6 describes the output variable for the angular velocity.

$$\text{DTCL} = \text{Sup (DTCL}\_i\text{) where i=3, 4} \tag{4}$$

$$\text{DTCR} = \text{Sup (DTCR) where i=5, 6} \tag{5}$$

$$\text{DTCF} = \text{Inf}\left(\text{DTCF}\_{\text{i}}\right) \text{where } \text{i} = 1, 2, 7, 8 \tag{6}$$

Fig. 5. The definition of angular velocity input membership functions.

Algorithm 2. The robot's behaviour is based on the prediction of the nature of the obstacles

should have an idea about the area in which the target exists. For this purpose, the TO which gives an idea about this position is combined with the DTC for each area in order to reach a compromise between "avoid conflict" and "reach goal". The TO has three membership functions that are: L: Left, F: Front, R: Right. The output of this controller is the angular velocity, it has five membership functions: LLT: Large Left Turn, SLT: Small Left Turn, NT: No Turn, SRT: Small Right Turn, LRT: Large Right Turn. Note that figure 5 describes the input of the fuzzy sets involved in the definition of the heading angular. Figure 6 describes the output

Fig. 5. The definition of angular velocity input membership functions.

DTCL = Sup (DTCLi) where i=3, 4 (4)

DTCR = Sup (DTCRi) where i=5, 6 (5)

DTCF = Inf (DTCFi) where i=1, 2, 7, 8 (6)

2: The obstacle is static. The robot should change its trajectory

6: The obstacle is mobile and it is moving away from the robot.

9: The obstacle is mobile and it is going toward the robot.

5: **if** ((DTCF)>0) and ((DTCF) < + ∞) **then**

8: **if** ((DTCF) <0) and ((DTCF)> −∞) **then**

12: The space is considered as free at ti

15: No obstacle in front of the robot. Free space

1: **if** (DTCF) =0 **then**

11: **if** (DTCF) =- ∞ **then**

14: **if** (INF (DTCF) =+ ∞ **then**

variable for the angular velocity.

4: **else**

7: **else**

10: **else**

13: **else**

17: **end if** 18: **end if**

in front area

19: **end if** 20: **end if** 21: **end if** 

Fig. 6. The definition of angular velocity output membership functions.

#### **4.4.2 Linear velocity prediction: Obstacle velocity concept**

The fuzzy controller for angular velocity uses the DTC that gives information about the nature of an obstacle and its trajectory. So, the robot is able to predict the future situation of the environment if it keeps moving in the same direction. While the second fuzzy controller for linear velocity uses the obstacle's velocity in the front area. This information determines whether the robot's speed should be increased or decreased to respond to the nearest situation detected.

Hence, the obstacle's velocity can be calculated according to formula 7 where D represents the distance travelled by the obstacle during the time interval Δ.

$$\mathfrak{B} = \mathbf{D} / \Delta \tag{7}$$

The distance D is calculated according to formula 8 where Xc and Yc represent the coordinates of the obstacle at time ti and X' c and Y' c represent the coordinates of the obstacle at ti+Δ (see figure 7). The coordinates are obtained according to formula 9.

2

+(X'c-Y'c)

2

Fig. 7. Illustration of distance traversed by the obstacle.

D=ට(Xc-Yc)

$$\begin{aligned} \text{Cord} &= \begin{cases} \text{X}\_{\text{c}} = \text{X}\_{\text{a}} + \text{(X}\_{\text{b}} \text{-X}\_{\text{a}}\text{)} \cos \theta \text{-(Y}\_{\text{b}} \text{-Y}\_{\text{a}}\text{)} \sin \theta\\ \text{Y}\_{\text{c}} = \text{Y}\_{\text{a}} + \text{(Y}\_{\text{b}} \text{-Y}\_{\text{a}}\text{)} \cos \theta + \text{(X}\_{\text{b}} \text{-X}\_{\text{a}}\text{)} \sin \theta \end{aligned} \tag{9}$$

(8)

A Reactive Anticipation for Autonomous Robot Navigation 157

6: Reduce the velocity of the robot in order to avoid conflict in the near future.

9: Keep the same speed if the velocity of the robot and the velocity of the

Algorithm 3. The velocity of the robot according to the concept of the velocity of the obstacle

Robot navigation is actually governed by rules in the fuzzy controller which represent qualitatively the human driving heuristics. The fuzzy logic controllers are applied to coordinate and to combine the various behaviours of the robot in order to choose a suitable decision. The fuzzification converts the input variables into input grades by means of the membership functions shown in figure 5 and figure 9. The inference and aggregation generate a resultant output membership function with respect to fuzzy rules. The defuzzification gives the output membership function shown in figure 6 and in figure 10. Therefore, the total number of rules to determine the angular velocity is N= 24. We can reduce this number into 9 if-else rules by eliminating redundancies (rules that have different values of input variables and the same value of the output variable can be replaced by one rule). We present in table 2 the fuzzy rules for the angular velocity. For example, if DTCF=M (the obstacle in the front area is moving) and TO=F (the target is in front area) then Δθ=NT (the robot do not change its trajectory) whatever the value of DTCL and DTCR. Likewise, for

the linear velocity there are N=18 rules, but we can reduce them into 9 if-else rules.

DTCF F M

Table 2. The fuzzy rules for the angular velocity.

The use of a small number of rules is required in dynamic environments, this is especially important when a fast response to the changes is required (short execution and high frequency of sensor readings). We use the method of Center of Gravity Defuzzification to

DTCL F M F M DTCR F M F M F M F M

F LRT LRT SLT SLT NT NT NT NT L LRT LRT LLT LLT NT NT LLT LLT R LRT LRT LRT LRT NT LRT NT LRT

obstacle 10: are close or accelerate if they are different.

1: **if** (VO) =0 **then**

4: **else**

7: **else**

11: **else**

TO

2: The obstacle is static

5: **if** (VO < VA) **then**

8: **if** (VO > VA) **then**

13: **end if** 14: **end if** 15: **end if**

**4.4.3 Fuzzy system rules** 

3: The robot must minimise its acceleration.

12: Keep the same speed.

We present in figure 8 the fuzzy logic controller for the linear velocity. This controller determines whether the robot's speed should be increased or decreased. It is used to determine the speed change Δϑ (the linear velocity).

Fig. 8. Fuzzy controller of speed change

The D, ϑO, and the ϑR represent respectively the distance between the robot and the nearest obstacle in the front area, the velocity of the nearest obstacle in the front area and the current velocity of the robot. The input and output membership functions of the fuzzy controller for linear velocity are shown respectively in figure 9 and figure 10.

Fig. 9. Input membership functions for the linear velocity

Fig. 10. Output membership functions. Velocity up/down control.

So, the speed of the robot can be influenced by the velocity of the obstacle in the front area. We present in algorithm 3 the reasoning process of the robot used to predict the velocity of the nearest obstacle in this area in order to determine its velocity. For example, if the velocity of the obstacle is smaller than the velocity of the robot, then the robot decreases its speed in order to avoid collision in the near future. If the velocity of the obstacle is larger than the velocity of the robot, the robot keeps the same speed if its velocity and the velocity of the obstacle are close. However, if there is a difference between the speed of the robot and the obstacle, it accelerates.


Algorithm 3. The velocity of the robot according to the concept of the velocity of the obstacle
