Smart Obstacle Avoidance Using a Danger Index for a Dynamic Environment

: The artiﬁcial potential ﬁeld approach provides a simple and effective motion planner for robot navigation. However, the traditional artiﬁcial potential ﬁeld approach in practice can have a local minimum problem, i.e., the attractive force from the target position is in the balance with the repulsive force from the obstacle, such that the robot cannot escape from this situation and reach the target. Moreover, the moving object detection and avoidance is still a challenging problem with the current artiﬁcial potential ﬁeld method. In this paper, we present an improved version of the artiﬁcial potential ﬁeld method, which uses a dynamic window approach to solve the local minimum problem and deﬁne a danger index in the speed ﬁeld for moving object avoidance. The new danger index considers not only the relative distance between the robot and the obstacle, but also the relative velocity according to the motion of the moving objects. In this way, the robot can ﬁnd an optimized path to avoid local minimum and moving obstacles, which is proved by our experimental results.


Introduction
Moving in free space while avoiding collisions within the dynamic environment is known as obstacle avoidance or path planning, which is the backbone of mobile robots.Many well-known path planning algorithms have been proposed in robotics research literature.The reward-based planning algorithms [1][2][3] propose to give the robot a positive reward when it reaches the target, and give the robot a negative reward when it collides with the obstacle.The path is then obtained by maximizing the cumulative future reward.However, due to the discretization of the state and control space, their trajectories are mostly not smooth [4].The sampling-base planning algorithms, such as the Rapidly exploring Random Tree (RRT) [5] and the Probabilistic Road Maps (PRM) [6], generally connect a series of randomly sampled points from a barrier-free space, and attempt to establish a path from the initial position to the target position.Although their time cost is less, the random sampling introduces the randomness of the planned path.Therefore, we cannot predict the result of the path planner, which is not optimal in general.The grid-based planning algorithms, such as the A* [7] and the Dijkstra's [8] algorithm, which have been used in the robotic operating systems (ROS), can find the optimal trajectory, but their time cost and memory usage grow exponentially with the dimension of the state space [4].The novel artificial potential field (APF) developed by Khatib [9][10][11] is a simple and effective path planning method.The theory behind APF is simple and straightforward: it has an attractive potential field for attracting the robot to the target point, and a repulsive potential field for pushing the robot away from obstacles.The APF approach can be used for global and local path planning.
However, there are some inherent problems in traditional artificial potential field approaches: (1) oscillations in the presence of obstacles due to the large move step of the robot; (2) goal nonreachable with obstacles nearby (GNRON); (3) trapped in a local minimum region; and (4) moving obstacles avoidance.Solving these problems has become an interesting topic in the field of APF based path planning [12,13].Park et al. [14] deal with the local minimum region by filling it with the virtual obstacle.Zhu et al. [15] introduce simulated annealing to look for the global minimum and escape the local minimum region.Doria et al. [16] use the Deterministic Annealing (DA) approach to avoid local minima in APF by adding a temperature parameter into the cost function of the APF approach.The value of the temperature parameter starts to increase until the robot goes away from the local minimum region.Lee et al. [17] propose to use two modes to control the APF, i.e., one mode is to go directly to the target using traditional APF and the other mode uses a new point APF algorithm to avoid collisions with the static obstacle.Mode 1 can be switched to mode 2 when the robot is trapped in a local minimum region or blocked in front of the obstacle.A new direction is synthesized using the robot motion information and direction between the robot and the goal point, which can guide the robot to escape the local minimum region.Weerakoon et al. [18] propose an improved repulsive force for overcoming a local minima problem, which generates a new repulsive force to the primary force when the robot detects an obstacle within its sensory range.The new repulsive force component turns the robot smoothly away from the obstacles.Kim et al. [19] modify the APF approach with the collision cone approach, which adds an artificial force to the existing attractive and repulsive forces when the relative velocity vector between the robot and obstacle is included in a collision cone.The improved resultant force can guide the robot to reach the goal.These algorithms may help the robot to escape the local minimum region in a simple statistic environment, but require to detect whether the robot is trapped in the local minimum region.
For the dynamic environment, the moving objects can affect the performance of the APF.Ge et al. [20] define a virtual force which is the negative gradient of the potential with respect to both relative position and velocity between the robot and the target or obstacles.The motion of the mobile robot is then determined by the total virtual force through the Newtons Law or steering control depending on the driving type of the robot.Cao et al. [21] propose a simultaneous target tracking and moving obstacle avoidance method using a threat coefficient based force function by taking into account the relative velocities of the target with respect to the robot and the relative velocities of the robot with respect to the obstacles.Montiel et al. [22] introduce a parallel evolutionary artificial potential field for the dynamic environment, which makes possible controllability in complex real-world sceneries with dynamic obstacles if a reachable configuration set exists.These methods make decisions according to the relative position and velocity direction between robot and obstacle, but the magnitude of the obstacle speed is not fully considered.
In this paper, we propose a dynamic APF approach (DAPF).The contributions of our work are the following: first, to predict and avoid the local minimum region, we combine the APF with the dynamic window approach [23], which employs a cost function to evaluate simulated trajectories, such that the local minimum region can be found in the prior step, and the robot can avoid the obstacle in a short path without any oscillations.Second, we propose an evolutionary potential field function based on an improved minimum danger index (DI) [24,25], which can plan an optimal path using not only the relative distance and velocity direction information, but also the magnitude information of the robot and obstacle speeds.The robot can make a smart decision to avoid moving obstacles, e.g., if the obstacle moves fast, the robot goes behind the obstacle.We demonstrate the proposed ideas using a real mobile robot system in static and dynamic environment, respectively, which shows the improved performance using our idea.

The Proposed Method
In this section, we analyze the problems of the traditional APF approaches and further introduce the proposed idea in detail.

Dynamic Window Based Artificial Potential Field (DAPF)
In the artificial potential field, the robot motion is controlled by the attractive force and the repulsive force, i.e., the attractive force is generated by the distance and direction to the target point, whereas the repulsive force is generated by the distance and direction to obstacles.The forces of the robot in the artificial potential field are shown in Figure 1, where F 2 is the repulsive force between the obstacle and the robot F 1 is the attractive force between the target point and the robot, and F is the resultant force for controlling the robot.The attractive potential field function is defined as: where φ = (x, y) T is the coordinate of the robot, k a is the coefficient constant of the attractive field, and φ g is the coordinate of the target point.The negative gradient of the attractive potential field function is defined as the attractive force function, which is: where F att (φ) is a vector directed toward to φ g , which is a linear correlation with the distance from φ to φ g .Obstacles provide repulsive force and repel the robot.When the robot is far enough from obstacles, obstacles will not affect the motion of the robot.As shown in Equation ( 3), the repulsion potential field function can be defined as: where k r is the coefficient constant of the repulsion field, d max is the maximum impact extent of the single obstacle, and d(φ) is the current distance between the robot and the obstacle.The repulsive force is the negative gradient of the repulsive potential function, which is The total repulsive potential field is the summation of the repulsive potential fields from all obstacles.The final artificial potential field function is as follows: The resultant force on the robot is F(x) = F att (x) + ∑ F req (x).
In some situations, the goal can be unreachable and the robot can be trapped in a local minimum region using the traditional APF approach as shown in Figure 2.For instance, the robot can not reach the target point when the target point is very close to the obstacle.In addition, the resultant force on the robot can be reduced gradually until the target point is reached.However, the resultant force of the robot is also likely to be zero or minimized, when the attractive force and repulsive force are almost equal and collinear but in the opposite direction.The robot in this situation is trapped in a local minimum region.To solve the GNRON problem, the distance between the current position and the target position can be added to the repulsion field function, such that the repulsive force can be relatively reduced when the robot closes to the target point.The improved repulsive potential field function is defined as where k r is the repulsion field coefficient constant and n is an arbitrary real number which is greater than zero.The improved repulsive force function is defined as where F req1 (φ) and F req2 (φ) are two components of the F req (φ), which are defined in Equation ( 9) and (10): The direction of F req1 (φ) is from the obstacle to the mobile robot, and F req2 (φ) is from the robot to the target point.
For solving the local minima problem, we propose a dynamic APF approach (DAPF), which employs the dynamic window approach (DWA) to predict the local minimum region and solve the oscillations.The key idea of the DWA is to sample a number of predicted trajectories according to the current position (x t , y t ), direction θ t and velocity v r as shown in Figure 3.The sampled directions θ ω are the following: where θ t is the current direction of the robot, θ is the angular step between samples and n is the number of samples.Using these sampled directions, we simulate a number of positions that the robot might go as x t y t ... ... x t y t ... ...
where x 1 , ..., x n and y 1 , ..., y n are coordinates of simulated positions, and v r is the velocity of the robot.
The final choice of the position can be defined as the one whose APF cost function is minimum: where x, y is the coordinate of the position whose resultant force value is minimum.Based on the improved APF function, the closer the robot is to the target, the smaller the resultant force value is.Before the robot enters the obstacle's influence range, it applies the DWA approach to simulate positions and calculate the resultant force for every simulated position.If the simulated position is in the obstacle range, the resultant force value is less than 0. If the simulated position is outside of the obstacle range, the resultant force of the simulated position that is closer to the target point is less than the positions that are far from the target point.Finally, the robot can obtain a simulated position that is close to the target point but not in the obstacle area, such that the local minimum region can be avoided using the DAPF approach.If the target point is within the obstacle range, the DWA method will be stopped when the distance of the robot from the target point is less than the distance from the obstacle.

Danger Index Based Artificial Potential Field (DIAPF) for a Dynamic Environment
To avoid the moving obstacles, the APF must consider not only the position information of the obstacles, but also the motion information of the obstacles, e.g., the direction and magnitude of the velocity.In the paper, we define the motion model of the dynamic obstacle as: which can be written in matrix form: where δ(t) = (x o , y o ) T is the coordinate of the dynamic obstacle, p(t + 1) = (δ(t), v o (t)) T is the state is the state transition matrix, and a o = (0, a o ) T is the acceleration of the dynamic obstacle.In this paper, a uniform motion model is adopted and the a o is a zero vector.The APF should not only consider the spatial location of the dynamic obstacle, but also consider the motion state of the dynamic obstacle.Therefore, the velocity repulsive potential field is added to the dynamic window based artificial potential field function (DVAPF) to avoid dynamic obstacles, which is defined as where k ro is a proportionality constant, v ro = v r − v o is the relative velocity between the robot and the dynamic obstacle, α is the angle between the v ro and the vector from the robot to the obstacle, ρ cmax is the maximum range of the local map, and ρ cm is the current distance between the robot and the dynamic obstacle.The velocity repulsive potential field starts to work when the dynamic obstacle enters the local map whose range is defined by the distance parameter ρ cmax , which can be chosen according to the sensor range.The velocity repulsive force is the negative gradient of the velocity repulsive potential function: The DVAPF approach can handle dynamic obstacle avoidance problem when the velocity difference between the robot and the dynamic obstacle is large.The effectiveness of the velocity repulsive force can be decreased if the relative velocity is small.We here propose an improved method using a novel danger index considering relative distance and velocity between the robot and the dynamic obstacle, which includes three factors: (1) Distance influence factor: where η = ( ρ cmin ρ cmax ρ cmax −ρ cmin ) is the distance scale factor, and ρ cmin is the minimum allowed distance between the robot and the dynamic obstacle.
Distance influence factor is influenced by the distance relationship between the robot and the dynamic obstacle.The closer the distance between the robot and the dynamic obstacle, the larger the distance influence factor.
(2) Speed influence factor: where ε is the speed scale factor, |v o | and |v r | are the magnitudes of the dynamic obstacle velocity and robot velocity, respectively, and sgn() is the sign function.Speed influence factor is influenced by the speed relationship between the robot and the dynamic obstacle.If the speed of the dynamic obstacle is ε times the speed of the robot, the speed influence factor is an integer and vice versa.
(3) Danger index: where k ro is a proportionality constant, f cm is the distance influence factor, α is the angle between the (v r − f cm v o ) and the vector from the robot to the obstacle.β is the angle between the (v r + f cm v o ) and the vector from the obstacle to the robot.The novel danger index includes distance influence factor and speed influence factor.The robot can make smarter avoidance decisions according to the speed influence factor, i.e., the robot can move in front of the moving obstacle if the speed of the robot is not larger than ε times that of the dynamic obstacle, whereas the robot can move behind the moving obstacle for other situations.
If the distance between the robot and the dynamic obstacle is very close, the distance influence factor will be large, such that the robot will move parallel with the dynamic obstacle, which is to ensure the safety of the path.If the distance between the robot and the dynamic obstacle is far, the distance factor will be small, such that the robot will not over-react to the obstacle motion, which can increase the efficiency of the robot motion.Furthermore, if the moving obstacle is outside of the local map, i.e., ρ cm > ρ cmax , the danger index is 0, so the robot will not react to such a situation.
The danger index combines the distance influence factor and the speed influence factor to optimize the planned path to avoid dynamic obstacles.The danger index based APF (DIAPF) function is defined as where U(φ) is the value returned from the DAPF function.To summarize, the whole algorithm of our proposed DIAPF approach in the dynamical environment is shown in Figure 4.

Experiment and Analysis
To evaluate the performance of the proposed idea, we use a Turtlebot robot to demonstrate the algorithm in the real environment where we have built a known map.The nurse robot plays as a moving obstacle in the map.To simplify the problem, the map of the environment and the motion status of the obstacle (nurse robot) are known for the Turtlebot.The Turtlebot robot and experimental environment are shown in Figure 5.We first compare the DAPF to the standard APF approach in the static environment to show how the dynamic window approach can improve the performance of the APF, and then compare the DIAPF with the DAPF, the DVAPF and ROS (robot operating system) path planning algorithm to show how the danger index can help the robot avoid the moving obstacle.

Static Environment
For a static environment, we place several obstacles randomly in the room.The DAPF and the standard APF algorithms are carried out using the experimental parameters defined in Table 1.
Table 1.The experimental parameters in a static environment.
The robot has the oscillation problem and can not avoid the local minimum region using the standard APF algorithm as shown in Figure 6a,c, respectively.In contrast to the APF, the proposed DAPF approach has a smooth planned path along the edge of the influence range of obstacles as shown in Figure 6b,d.For the local minimum problem, the DAPF has no need to detect whether the robot has entered a local minimum region, since the DWA can predict and avoid such a situation in advance.

Moving Obstacle
For dynamic environment, we compare three methods to avoid the moving obstacle, i.e., DAPF, DVAPF and DIAPF.We show that these methods have different performance for faster and slow moving obstacles.The experimental parameters are shown in Table 2.
The performance using the DAPF for avoiding the slow and fast obstacles are shown in Figures 7  and 8 respectively.For the slow obstacle, the DAPF has a period of oscillation when the obstacle is in front of the robot.For the fast obstacle, the situation is worse, i.e., the collision between the robot and the obstacle occurs.The DVAPF is better than the DAPF as shown in Figures 9 and 10, where we can see that the DVAPF prefers a path behind the moving obstacle.Using such a strategy, the robot and the dynamic obstacle will move in opposite directions when the obstacle enters the robot's local map if the dynamic obstacle is faster than the robot, and the robot will continue to move towards the target point when α ∈ (−π, − π 2 ) ∩ ( π 2 , π) or the obstacle leaves the robot's local map.If the moving obstacle is slower than the robot or their velocity is similar, the planned path can be inefficiency and dangerous as shown in Figure 10, i.e., the robot enters the influence area of the obstacle since the robot's deflection angle is too small to avoid the obstacle.In contrast to the DVAPF and DAPF, the DIAPF has the best performance according to the experiment results as shown in Figures 11 and 12. From the experimental results, it can be seen that the DIAPF approach can make a prediction according to the state of the moving obstacle: if the obstacle velocity is similar or faster, the robot can plan a path behind the obstacle.If the obstacle velocity is slower, the robot can plan a path in front of the obstacle.This strategy makes the planned path more efficient.In addition, the distance influence factor plays a key role to increase the safety and effectiveness of the planned path, e.g., the distance influence factor can reduce the robot's deviation angle if the moving obstacle is far away, and can increase this angle if the moving obstacle is closer.

Dynamic Environment
In this section, we compare the proposed DIAPF method to the ROS [26] path plan package which employs the DWA and A* algorithm.The experimental environment includes four static obstacles and a moving obstacle.As can be seen from Figure 13, the ROS uses A* algorithm to plan a global path and uses the DWA algorithm to handle nearby obstacles in the local map.If the speed of the moving obstacle is slow, the robot can avoid the obstacle directly as shown in Figure 13a.However, if the obstacle moves fast, the robot needs to re-plan the path according to the position of the obstacle.The global path also needs to replan according to the local path changes as shown in Figure 13b.In contrast to the ROS method, the proposed DIAPF can make decisions in advance according to the relative velocity between the moving obstacle and robot as shown in Figures 14 and 15.The planned path using the DIAPF is more efficient than the one using the ROS module as seen in Figure 16, which shows the changes of the distance between the robot and the target point.The DIAPF shows a linear decrease of the distance while the ROS shows a curve that decreases first and then increases due to a re-planned path.

Conclusions
In this paper, we introduce a dynamic window approach (DWA) and danger index (DI) based artificial potential field (APF) for static and moving obstacle avoidance.The dynamic window approach based APF (DAPF) can overcome the local minimum problem since the DWA can predict the local minima region and in advance.For moving obstacles, we propose a novel danger index based APF (DIAPF) that considers not only the relative distance, but also the relative velocity between the robot and the moving obstacle.In this way, an optimized strategy can be made according to the motion status of the moving obstacle, which leads to a safer and efficient planned path compared to the state-of-the-art works, e.g., ROS path plan module.Finally, we demonstrate the proposed idea in the real environment using the Turtlebot robot, and the experiment results prove our claims.Future work will be extending current work to the environment with an unknown map and multiple randomly moving obstacles.

Figure 1 .
Figure 1.Definition of attractive force and repulsive force in artificial potential field.

Figure 2 .
Figure 2. Problems of a traditional artificial potential field (APF): (a) unreachable goals with obstacles nearby (GNRON) and (b) trapped in a local minimum region.

Figure 4 .
Figure 4. Danger Index Based Artificial Potential Field (DIAPF) based moving obstacle avoidance algorithm.

Figure 6 .
Figure 6.Experimental results using APF (a,c) and proposed DAPF (b,d) in the static environment where the gray solid circles are obstacles, the circles that around obstacles means the influence range, the small green circle is the robot position, and the red curve is the planned path.The APF has the oscillation problem that occurs in the (a) and local minimum problem that occurs in the (c), whereas the DAPF solves such problems and achieves better results as shown in (b,d), respectively.

Figure 7 .Figure 8 .
Figure 7.The robot uses the DAPF approach to avoid the slow moving obstacle: (a) shows the robot is before obstacle avoidance; (b-e) show that the robot is avoiding the obstacle, and (f) shows that the robot finishes obstacle avoidance.

Figure 9 .Figure 10 .Figure 11 .Figure 12 .
Figure 9.The robot uses the dynamic window based artificial potential field (DVAPF) approach to avoid a fast moving obstacle: (a) before avoiding; (b) avoiding the obstacle; and (c) finish avoiding.

Figure 13 .
Figure 13.The robot uses path planner in robot operating system (ROS) to avoid a (a) slow and (b) fast moving obstacle in the dynamic environment.

Figure 14 .Figure 15 .
Figure 14.The robot uses the DIAPF approach to avoid a fast moving obstacle in the dynamic environment: (a) before avoiding; (b) avoiding the dynamic obstacle; and (c) finish avoiding.

Figure 16 .
Figure 16.The changes of the distance between the robot and the target point using the proposed DIAPF method (blue) and ROS path plan module (red).

Table 2 .
The experimental parameters for moving obstacle avoidance