Mobile Robot Path Planning in a Trajectory with Multiple Obstacles Using Genetic Algorithms

Path planning is an essential algorithm to help robots complete their task in the field quickly. However, some path planning algorithms are computationally expensive and cannot adapt to new environments with a distinctly different set of obstacles. This paper presents an optimal path planning based on a genetic algorithm (GA) that is proposed to be carried out in a dynamic environment with various obstacles. First, the points of the feasible path are found by performing a local search procedure. Then, the points are optimized to find the shortest path. When the optimal path is calculated, the position of the points on the path is smoothed to avoid obstacles in the environment. The simulation results show that the proposed algorithm successfully finds the optimal path in an environment with multiple obstacles. Compared to a traditional GA-based method, our proposed algorithm has a smoother route and a faster computation time due to path optimization. Therefore, this makes the proposed method advantageous in a dynamic environment. Keywords—genetic algorithm, mobile robot, optimal path, path planning, shortest path.


INTRODUCTION
The industrial revolution is claimed to be the era of automation, such as businesses, research facilities, and academic institutions around the world are researching robotics. Robots are increasingly prominent in our daily lives and have taken a significant part in humanitarian assistance [1], services industry [2], security [3], and drone photography [4], [5]. Robots are developed to make human life more comfortable, both for daily activities such as cleaning [6], cooking [7], assisting the elderly [8] and customer in a shopping center [9], even with risky activities such as monitoring hazardous environment [10] or for outdoor surveillance [11]. One of the crucial things that can help a robot complete its task quickly and accurately is path planning.
Path planning is an action to produce a path or movement series from the initial position to the desired state with a collision-free performance under certain restrictions and limitations [12]. The path planning algorithms aim to provide robot mobility to overcome specific obstacles without human intervention while achieving the shortest path with minimal energy consumption and the lowest running time [13]. The shortest path is a common constraint on path planning algorithms. While the robot follows the shortest path, it takes less time to do the work, and energy consumption will be kept to a minimum. Since the robot is equipped with limited energy, it is crucial to keep the energy as long as possible.
In general, the path planning algorithm is divided into two main implementations: probabilistic and artificial potential fields, i.e., genetic algorithms. Some algorithms for path planning are computationally expensive, especially when new environments and constraints are introduced. These algorithms cannot adapt to the new environment or recognize a different set of constraints. A method in [14] presents an outline of an autonomous mobile robot path planning algorithm that focuses on techniques to provide an ideal route for the robot to traverse the environment. Dijkstra algorithm is exploited in [15] to find the shortest path in a twodimensional grid planar robot workspace. This method reduces time complexity since one adjacent grid node is only inspected once. But, this can only be implemented in a static environment with a single constraint. When the environment changes or more constraints are added to the system, the performance was not evaluated. Authors in [13] used information from sensors installed on the robot to avoid obstacles. A near-shortest path for mobile robot (NSPMR) algorithm was introduced based on local path planning with energy consumption and processing time limits. Though, the number of obstacles the robot can avoid is limited and static. If the obstacles increases and their position change, the robot needs to restart the sensing process, so the processing time will increase.
A primal-dual based heuristic for planning robot paths with different loading conditions is proposed in [16]. Since the robot has a wide variety of payloads, the time consumption and work handling of the system is heterogeneous. Nevertheless, this method can cause the expansion of the selected nodes and increase the computation time when several active subsets with the same constraint value are selected and go through the iteration process. Moreover, if the iteration result does not meet the constraints, the discarded components will be reselected to undergo the same procedure. This will certainly increase the processing time. Rapidly-exploring random tree (RRT) is implemented in [17] and [18] to modify the current path when an unknown obstacle blocks the path. Although the process shows high flexibility in path planning, the higher number of dynamic obstacles resulted in higher computational cost. Since the advent of artificial intelligent methods, path planning algorithms have been developed by introducing a genetic algorithm (GA) for node selection or possible path detection. A GA-based method was presented to find the shortest path for robots in a static environment and a fixed number of obstacles [19], [20]. These methods ensure the convergence of the algorithm, and the optimal path chosen is the shortest. However, there is no discussion of the time consumption of the algorithm. Time consumption appears to be high since the algorithms will calculate all possible paths between the starting and destination points with a randomly selected initial point. The selection of the adjacent points should be made based on the fixed conditions of the workspace map. If there is no prior knowledge about the position of obstacles, these methods cannot perform optimally. GA is integrated in [21] to find the Bezier curve control points to define a smoother and more consistent path. The purpose of this method is to reduce energy loss in the robot. But, as the algorithm emphasizes path quality, the processing time increases. The computation time will be much higher when the environment has more obstacles.
A method in [22] improves a new mutation operator in dynamic environments to find the optimal path faster. However, due to the mutations which are not randomized, the complexity of the algorithm is high. The algorithm will check all free nodes close to the mutation node and compare them with the fitness value of the complete path instead of selecting the nodes one by one. GA enhancement is proposed in [23] using multi-domain inversion to increase the number of offsprings. This method was claimed to be able to overcome the slow convergence and preterm population in traditional. As the number of offspring increases, a fitness condition is used to eliminate unwanted offsprings during the calculation. Although this method has superior performance compared to conventional methods, the complexity of this algorithm is increasing and sacrificing computational time. A method in [24] combined GA with the travelling salesman problem (TSP). This method claims that the simulated algorithm is feasible and could be implemented in real-world experiments. Since the GA and TSP have high computational costs, the authors need to consider the cost function regarding the obstacle position and numbers. This paper proposes an improvement of the GA-based path planning algorithm that can be implemented in a dynamic environment with changeable obstacles. Since there is no prior information about the adjacent points between the starting and destination nodes, GA is used to find the feasible path by performing a local search procedure. The points found are then optimized to get an optimal path that focused on the shortest and smoother routes while avoiding obstacles in the trajectory. Centralized computation is implemented so that there will be no additional burden to the systems in the robot. Thus, the resulting path can be efficient.
The remainder of the paper is organized as follows. Section II and III introduce the path planning objectives and an overview system of the proposed method. Section IV presents the results and discussion. Finally, conclusions are drawn in Section V.

A. Genetic Algorithm
In this paper, the simulation of the autonomous mobile robot is designed for viewing the workspace, locating the robot position in the environment, recognizing obstacles, and improving the path route. Therefore, path planning is a crucial step for the navigation of the robot since it is challenging to ensure convergence towards a dynamic environment.
GA works simultaneously with individual populations and explores several new areas in the solution space in parallel [25]. Environmental information is known beforehand and before the navigation process [26]. Thus, it can reduce the probability of the search space trapped within the local minimum to reach the target [27], [28]. The genetic algorithm process is described as follows:

1) Population
GA is initiated by randomly generating an initial population representing the possible paths (chromosomes) from the start point to the target point [29]. However, all of the possible shortest paths are initially considered as a population. If the entire population is found to be blocked during path planning by a robot collision, the configuration space is increased locally to ensure that alternative paths can be found. Therefore, the configuration space is only extended as needed to reduce the computational costs of finding a path.

2) Fitness function
The population of paths is evaluated using the fitness function during each reproduction cycle [30]. The fitness function used in this method considers the values for the path length, smoothness or angle of the path, and the number of feasible steps as follows The smoothness of the path is considered because a smoother route directly impacts the time cost of the robot to travel from the starting point to the target point. If the path has rough angles, the robot has to slow down for each turn which increases the total travel time. The feasible paths include additional points generated for avoiding the obstacles in the path. Therefore, the fitness function in this paper can produce a path with a minimum length, minimum time, and minimum speed to reach the target.

3) Encoding of chromosomes
The chromosome or path represents a candidate solution to find an optimal path planning [31]. A chromosome consists of a start point, a target point, and points that are generated along the path for the mobile robot to pass. These points are referred to as chromosomal genes. In our method, the points are represented as pixel locations in the two-dimensional environment by   , nn xy.

4) Selection method
The selection procedure stores the best genes on chromosomes for transfer to new generations. given to prevent some chromosomes from becoming dominant in the population. In the last step, the two chromosomes with the highest probability are selected as parents to mate via crossover to produce new chromosomes.

5) Crossover operator
The crossover operator takes two parents and divides their features in half at the center position. Half of each parent is then used to form a new individual. So that two offsprings are produced. The crossover of two infeasible chromosomes can generate a new infeasible path. To solve this problem, every chromosome must be checked. If it intersects with an obstacle while generating the initial population, the genes intersecting on the chromosomes are randomly changed to a feasible one.

6) Mutation operator
All candidate chromosomes in the population undergo random mutations after the crossover operation. This procedure is applied with uniform probability to all genes of all individuals in the population. The mutation operator takes a random point from the path and replaces it with a random path to its neighboring point. Therefore, mutations can increase population diversity and avoid premature convergence.

B. Environment
In this paper, four main points (i.e., A, B, C, and D) are simulated to be selected as a start point (S) and a target point (T) in a two-dimensional environment. Obstacles (blue square) can be randomly generated and their location information is known, as shown in Fig. 1. The path planning is designed to find the optimal path from S to T within ten randomly generated points (small blue circle) that do not collide with the obstacles. Then, a robot (yellow circle) is converted into a single point in the field of computational geometry [32]. The points on the path are indicated by   where pn is the n-th gene of chromosomes or points in the path. The coordinate of pn is denoted as (xn, yn).
In our method, length and smoothness are used as path optimization which is related to energy loss in the path. If the distance of the robot from the obstacles during running is less than the sensor safe distance, this can be a dangerous situation that can damage the robot. Therefore, a considerable distance between the robot and the obstacle is required for a safer route. The objectives designed to improve the optimal route of the robot as follows:

1) Path length
The path length can be calculated as the sum of the distances between each point in a path as follows where L is the length of the chromosome, d is the distance of every two points connected which can be calculated using the Euclidean distance as follows      

2) Path smoothness
The path smoothness can be assumed as the degree of path sleekness. A smoother route can reduce the energy loss of the robot when running along the path. First, the average turning angle of the path is calculated by [33]             Then, the total average turning angle in  New generated individual stored in child population POP'. 7. Output the optimal solution. 8. The robot starts moving to travel along the path.

A. Path Planning Improvements
In the selection operator, the best individuals are selected and stored in POP. Two individual in POP are selected and their features are swap by a crossover operation. The location of the points and individual in POP are evaluated to improve the optimal solution as follows:

1) Shortest path
A single point variation is used to determine the shortest path when passing by the obstacles. A point in the path is randomly selected and replaced with a point randomly generated around an obstacle. The path that is produced after the mutation can be better or worse than the previous path. Therefore, mutations are continued until the shortest path is optimal. Fig. 2 shows the point mutation to find the shortest path.

2) Position update
Several three continuous points   where  is the displacement of the n p in the solution space, can be calculated by where α and β are the velocity constraints in the updated position which are set to ±1% of the vector distance between the upper and lower boundaries of the solution space,

B. Obstacle Avoidance Approach
In the case of infeasible path, the solution operator is performed to change the position of several points to create a feasible path. The infeasible path usually occurs when two or more points intersect an obstacle. Every two vertices are connected to form a new set of edges between the obstacle and the two selected points   1 , n n pp  , as shown in Fig. 4. The edge that intersects with the obstacles will be deleted. Djikstra algorithm is applied to achieve the optimal shortest path based on graph vertices and edges. The path p can be

IV. RESULTS AND DISCUSSION
We compared the results with the traditional GA method to evaluate the performance of the proposed method. The robot is run from a start point to a target point with 5, 8, and 10 obstacles in the environment. The numbers (x,y) indicate the center position of the obstacles. Fig. 5, 6, and 7 show the results of path planning using the traditional GA method and the proposed method.
In Fig. 5 (a), point 4 has a non-optimal location which makes the path longer, where it should have been between points 3 and 5 could have a shorter path. Between point 5 and the target point some improper points cause the path to intersect with the obstacle. Our proposed method can solve this problem, as shown in Fig. 5(b), the points 4 and 5 are updated so that the path can be shorter and avoid the obstacles. The same situation occurs in Fig. 6(a) and 7(a), the path generated by the traditional GA method cannot solve the problem of the infeasible path which makes the path not optimal and collides with obstacles. Fig. 6(b) and 7(b) show that our proposed method fixes these common problems of path planning and produces the optimal path while avoiding obstacles. A solution is found when the best fitness value meets the average fitness value, as shown in Fig. 5(c), 6(c), and 7(c). Table I shows that the proposed method has shorter and smoother path compared to the traditional GA method. Table  II summarizes the performance results of our proposed method. The more obstacles generated in the path would allow the algorithm to produce more individual generations and mutation operators. More mutations occur because the path has more obstacles, which means it is more difficult to find the optimal path solution.   In Fig. 6(a), the traditional GA method cannot find a path that can avoid the obstacle between points 2 and 3, the same situation happens between points 4 and 5. Our proposed method updates the position for point 2 so that the path between points 2 and 3 do not hit obstacles, which also fix the position of point 5 so that the path is more optimal, as shown in Fig. 6(b).
In Fig. 7(a), there are 5 points that are not optimal to create a path between a start point to a target point. Our proposed method makes the path more optimal with a few additional points to avoid obstacles around point 1 and a shorter path between points 2 and 4, as shown in Fig. 7(b).

V. CONCLUSIONS
This paper has presented path planning improvements for a mobile robot using genetic algorithms in an environment with multiple obstacles. Two objectives to be optimized are applied to find the optimal path. The GA operators are proposed to accelerate the evolution of individual populations in the path. This method selects points according to the fitness value of the total path rather than the direction of movement through the mutated points. Compared with the traditional GA method, the proposed method shows that the chromosomes generated by path planning have better characteristics and a faster computation time in the solution space. The average fitness values and the number of generations generated on this improved GA are more suitable for optimal path planning than the traditional method. Thus, the resulting path is shorter and smoother and can be used as a travel path for a mobile robot in a real application. For future works, the characteristics of the sensors in the robot can be considered for better path planning implementation.