Path Traversal Around Obstacles by a Robot Using

Terrain Marks for Guidance

A thesis submitted to the

Graduate School of University of Cincinnati

In partial fulfillment of the requirements for the degree of

Master of Science

In the School of Electronic and Computing Systems

of the College of Engineering and Applied Science

April 2011

by

Rabindra Pannu

B.Tech. in Computer Engineering

Kurukshetra University, Kurukshetra, India

Thesis Advisor and Committee Chair: Dr.Raj Bhatnagar Abstract

The problem of autonomous robots avoiding obstacles while traversing a terrain requires efficient . There has been much research work done for the cases where the locations of obstacles are known before the path is planned. We present here an for the case in which the robot has no prior knowledge about the locations of the obstacles.

The robot starts its navigation knowing the coordinates of the start and the destination points and adjusts its path as it encounters obstacles. Many existing algorithms are designed for the contexts in which the robot determines its location based on information provided by either the GPS system or an overhead camera. Our algorithm has been developed for the context in which the robot determines its (x, y) coordinates based on the grid marks on the terrain, and does not depend on the global systems for positioning cues. We have shown that our algorithm can successfully traverse the terrain for most of the situations even though there are some exception cases in which the robot gets stuck while there still is a possible path through the maze of obstacles. The robot also returns to the starting location, navigating only the shortest path running through the cells navigated while going towards the destination. This thesis describes the algorithm, implementation details for the Khepera robot used, and the results obtained with our algorithm.

Acknowledgements

I would like to take this opportunity to express my gratitude to my thesis advisor, Dr.

Raj Bhatnagar, whose guidance, encouragement and patience, inspired me to work on this project. I am extremely grateful to him for his support and co-operation which helped me in successfully completing my Master’s degree. I would also like to thank Dr.

Carla Purdy, Dr. Karen Davis and Dr. Manish Kumar for their presence on my thesis committee.

I would also like to thank Robert Montjoy for his technical support in the research lab.

Most importantly, I would like to thank my family and friends for their love and support. I would like to dedicate this work to them. Contents

1 Introduction1

1.1 Introduction...... 1

1.2 Motivation...... 2

1.3 Our Approach...... 3

1.4 Organization of the Thesis...... 5

2 Literature Review6

2.1 Introduction...... 6

2.2 Offline and Online Algorithms...... 7

2.2.1 Offline Algorithms...... 7

2.2.2 Online Algorithms...... 8

2.3 Maze Traversal...... 8

2.4 Path Planning and Motion Control...... 11

2.5 Problem Formulation...... 14

2.6 Technical Specifications...... 15

2.6.1 Hardware specifications...... 16

2.6.2 Software Specifications...... 17

2.7 Constraints of the Environment...... 18

i 3 Strategy and Algorithms 20

3.1 Introduction...... 20

3.2 Terms Used...... 21

3.3 Path Planning and Obstacle Avoidance...... 23

3.3.1 Navigation...... 23

3.3.2 Obstacle Creation...... 24

3.3.3 Intermediate Goal Formation...... 26

3.3.4 Blacklisting and ...... 29

3.3.5 Strategy Decision...... 30

3.4 Algorithms...... 32

3.4.1 Main Algorithm...... 32

3.4.2 Path Planning Procedure...... 35

3.4.3 Path Planning in the X Direction...... 35

3.4.4 Path Planning in the Y Direction...... 36

3.4.5 Obstacle Avoidance Procedure...... 37

3.4.6 Intermediate Goal Formation...... 38

3.4.7 Backtrack...... 40

3.5 Flowchart for the Maze Traversal Algorithm...... 40

4 Results and Analysis 42

4.1 Introduction...... 42

4.2 Test Cases...... 43

4.2.1 Test Case 1...... 43

4.2.2 Test Case 1 Analysis...... 46

4.2.3 Test Case 2...... 47

ii 4.2.4 Test Case 2 Analysis...... 50

4.2.5 Test Case 3...... 51

4.2.6 Test Case 3 Analysis...... 53

4.2.7 Test Case 4...... 54

4.2.8 Test Case 4 Analysis...... 57

4.3 Test Cases Strategy Dependent Analysis...... 58

4.3.1 Test Case 1 Left Strategy...... 58

4.3.2 Test Case 2 Left Strategy...... 60

4.3.3 Test Case 3 Left Strategy...... 62

4.3.4 Test Case 4 Left Strategy...... 63

5 Conclusions and Future Work 65

5.1 Conclusion...... 65

5.2 Future Work...... 67

iii List of Algorithms

1 Path Planning and Obstacle Avoidance Algorithm ...... 33

2 Path Planning ...... 35

3 Path For X ...... 36

4 Path For Y ...... 37

5 Obstacle Avoidance ...... 38

6 Intermediate Goal ...... 39

7 Backtrack ...... 40

iv List of Figures

1.1 Sample maze design...... 4

2.1 Grid used in the thesis...... 15

2.2 Khepera Robot...... 16

2.3 Different Views of the Khepera Robot...... 18

3.1 Intermediate Goal...... 27

3.2 Backtracking...... 29

3.3 Flowchart for the Maze Traversal Algorithm...... 41

4.1 Test Case 1...... 44

4.2 Test Case 2...... 49

4.3 Test Case 3...... 52

4.4 Test Case 4...... 55

4.5 Test case 1 Strategy Comparison...... 58

4.6 Test case 2 Strategy Comparison...... 60

4.7 Test Case 2 Alternate Goal Strategy Analysis...... 61

4.8 Test Case 3...... 62

4.9 Test Case 4 Left Strategy...... 63

v List of Tables

4.1 Test Case 1 Path details...... 45

4.2 Test Case 1 Analysis...... 47

4.3 Test Case 2 Path details...... 48

4.4 Test Case 2 Analysis...... 50

4.5 Test Case 3 Path details...... 53

4.6 Test Case 3 Analysis...... 53

4.7 Test Case 4 Path details...... 56

4.8 Test Case 4 Analysis...... 57

4.9 Test Case 1 Left Strategy Analysis...... 59

4.10 Test Case 1 Strategy Wise Analysis...... 59

4.11 Test Case 2 Left Strategy Analysis...... 61

4.12 Test Case 2 Strategy Wise Analysis...... 61

4.13 Test Case 3 Strategy Wise Analysis...... 63

4.14 Test Case 4 Left Strategy Analysis...... 64

4.15 Test Case 4 Strategy Wise Analysis...... 64

vi Chapter 1

Introduction

1.1 Introduction

Navigating agents or mobile autonomous robots in a problem space is a significant area of interest for many researchers in the field of Artificial Intelligence. These applications require robots to navigate without colliding into the obstacles present in a work space environment and reach their destinations safely. Modeling the real-world environment is highly complex and in certain situations not a feasible task. The robot in such situations is expected to operate in the most efficient manner even though provided with limited information regarding the working environment [12]. Navigating through a cluttered workspace to reach a destination point or to move material on a factory floor can be viewed as maze traversal problems and the algorithms developed for maze traversal can be applied for these applications as well. Maze traversal, maze escape, finding shortest and most cost effective path between a start and a destination point etc. have been some highly intriguing and difficult problems that scholars have been working on for decades.

Real time motion control, unpredictable and dynamic environment, obstacle avoidance,

1 navigation, communication are some of the issues that the algorithm designers have to face when dealing with such systems. This thesis proposes a grid based maze traversal algorithm for a mobile robot to reach its goal coordinates from the start coordinates in an unknown environment and return to the start coordinates using the most efficient navigated path.

Movement of materials on a factory floor, search and rescue operations in a natural disaster or war situations, performing tasks in situations which are dangerous for humans such as hazardous material disposal, environmental protection, assisting in dangerous war missions including surveillance, bomb detection and detonation, toxic waste disposal, extra-terrestrial and underwater explorations etc. all require autonomous mobile robots which have the capability to navigate in an unknown environment [4, 18, 30,5, 25,1, 17,

23, 21,6, 11]. At some level all these situations can be translated into maze traversal problems and thus, the application of maze traversal algorithms is not just limited to the laboratory environment, but has far reaching applications in the real world. We have tried to achieve the same aim with the development of this algorithm.

1.2 Motivation

The area of robot maze traversal has been studied by researchers for decades and the resulting works can be categorized into two broad categories based on the availability of the terrain model. In a known terrain scenario, the information regarding the terrain is provided as the input and the maze traversal algorithm plans efficient global paths before the robot ventures out into the maze. In an unknown terrain, the terrain model is not provided and the robot obtains the local terrain information by employing audio, visual,

2 touch sensors etc. Thus in the former formulation, the paths are preplanned, whereas in the latter paths are computed incrementally as the robot explores new areas of the terrain [21].

Graph algorithms, Depth First Search, Artificial Potential Fields, Neural networks and Genetic Algorithms, Wall following etc. are some of the maze traversal strategies employed by researchers depending on the problem domains and the terrain model avail- ability. Though highly successful in their application areas, these formulations have some inherent drawbacks. Time and computation complexity, use of external aids such as cam- eras and GPS to determine the location of the robot in the maze, a priori terrain model knowledge etc. are some of the issues associated with these strategies. The following chapter discusses these strategies, their applications and drawbacks in detail.

1.3 Our Approach

Strategies for maze traversal are computationally expensive or use complicated methods to determine the location and direction of the robot in the workspace. We wanted to build a robust, efficient, and cost effective yet simple method to achieve the aforementioned goals. We chose a grid based method to determine the coordinates of the robot and provided it with the direction it’s facing at the beginning of the algorithm. The robot to make its way towards the final goal coordinates avoiding the obstacles it might encounter on its way, and backtracking when required. Also, the robot keeps track of the cells in the grid it’s navigating through, as it needs them to build a path to return to the start position after making its way to the final goal coordinates.

3 The algorithm was designed and tested successfully using a large number of grid

designs. One such sample maze is shown in the Figure 1.1.

(a) Maze Top View (b) Maze Front View

Figure 1.1: Sample maze design

The robot was able to plan a cost effective non-collision path to the goal coordinates and return to the start coordinates using the most efficient navigated path. The robot used IR sensors to visualize its work environment and to determine when it had crossed over from one grid cell to another to keep track of its current coordinates. Diagonal motion in the grid was not allowed so that the robot moved on straight line paths, thus simplifying the path planning process further. No external equipment was required to assist the robot in navigating the grid. The algorithm we designed will be discussed in detail in Chapters 3 and 4, wherein the results and analyses will be provided in detail as well.

4 1.4 Organization of the Thesis

The remainder of this thesis is organized as follows. Chapter 2 reviews relevant exper- imental and theoretical work on path planning strategies, maze traversal, problem for- mulation and technical specifications. The detailed description of the modules designed and algorithms is given in Chapter 3. Chapter 4 discusses and analyzes the test results.

Finally, Chapter 5 summarizes the thesis and presents possibilities for future work.

5 Chapter 2

Literature Review

2.1 Introduction

Maze traversal by an autonomous mobile robot in static or dynamic environment is par- ticularly challenging depending on the amount of information provided to the robot at the beginning of the path planning module. A large number of strategies have been devised to approach the maze traversal problem such as graph algorithms, depth first search, artificial potential field method; using Genetic algorithms and neural networks, wall following etc. to name a few. Though these strategies are effective in their problem domains, most of them suffer from certain drawbacks such as, requiring terrain informa- tion a priori before the algorithm starts, computationally expensive to be of much use in the real world environment, need of sophisticated cameras or other expensive audio visual aids to sense the environment, getting trapped in a local minima etc.

This thesis proposes a grid based maze traversal algorithm that effectively solves the issues encountered in the aforementioned strategies. Its computationally inexpensive, does not require expensive or external audio visual aids to locate the robot in the maze

6 or to help the robot sense its environment. The robot is able to find its way to the goal coordinates even without knowing the layout of the maze beforehand. The strategy devised and the algorithm designed is discussed in detail in the next chapter.

2.2 Offline and Online Algorithms

There are different ways in which algorithms can make paths to traverse a maze depending on the information provided to the robot. Two most important distinguishing strategies, that have been researched on by [3,8,9, 19,4, 18,1, 21, 20, 14, 11], are being discussed here.

2.2.1 Offline Algorithms

When the robot has complete knowledge of its physical environment in the maze, wherein it knows a priori the location of the obstacles, it can generate a path from start to goal before actually venturing out into the maze. This type of robot motion planning is categorized under Offline Algorithms [11]. Note that in problems where the robot has to navigate only through a limited portion of a vast actual terrain, complete knowledge could mean information related to this particular physical area. Rest of the global information is not required in such cases [21, 20,1].

Before the advent of computers, most of the earlier work in maze traversal problems was theoretical and focused on this area of algorithm design. As the technology advanced, so did the interest in the field where maze solving problems could be combined with actual robots implementing them in real world situations [21, 20,1].

7 2.2.2 Online Algorithms

Online Algorithms come into focus when a robot sets out in a maze with unknown terrain and performs path computation to get to its goal location depending on the limited information it accumulates by sensing its local environment [19, 11]. Sensing is usually performed using visual or touch sensors. New path is usually generated every time robot comes across an obstacle on its path. Efficiency of such algorithms depends on a variety of factors such as the complexity of the terrain, computational capability of the robot, amount of information stored by the robot, type of sensor used, shape of obstacles to name a few [3,8].

Both Offline and Online algorithms have applicability in various fields. Although online algorithms seem to have gained more popularity due to their application in com- mercial applications, gaming (such as robot soccer), real world scenarios and even in amateur projects. This thesis employs the use of both offline and online algorithms.

2.3 Maze Traversal

Traditionally was used in solving the maze traversal problem or reaching a

Goal G from a Start S. These algorithms worked well for theoretical purposes but failed to be at par when used in real world environments. These algorithms though produced the shortest path but not necessarily the fastest or the most efficient. Depth first was a popular choice, but considering the constraints in a physical world, back- tracking and speed of execution of this algorithm turned out to be deterrents in its use

[1, 21, 27, 25, 19]. A large number of graph algorithms inspect every node present in the graph to find the optimal path or traverses edges of the graph multiple times to

8 determine the best possible path. These algorithms require prior knowledge regarding the terrain for path planning purposes. On the contrary, our algorithm works efficiently in an unknown terrain and doesn’t inspect all the possible paths in the grid to find the best possible path. It does employ backtracking, but only in the worst case scenarios to help the robot out of a dead end situation.

Several other approaches such as Neural networks and learning algorithms, Genetic

Programming (GP), Wall following, Numerical Potential Field Technique etc to name a few have been employed as well. [4,7, 27,3, 29, 14, 10, 26,2, 24, 32] Discuss these ap- proaches in detail. In the Wall following technique, the robot moves next to a continuous wall, till it reaches the other end of the maze. This technique guarantees success but the path is not necessarily optimal. Also this method fails in case of non-continuous obstacles.

[19] Paths generated by our algorithm are not dependent on the shape and continuity of the obstacles but are intelligently planned by the robot depending on the knowledge acquired by traversing the maze in conjunction with the sensing of environment around it.

Dracopoulos in [7] discussed the use of neural networks in the maze traversal problems.

The earlier experiments with robots in a maze with unseen obstacles involved forcing the robot to learn its way around the maze by colliding into the obstacles. This strategy has limited use since letting the robot collide with obstacles to learn its path can turn out to be hazardous for both the robot and the environment in real life situations. The robot should be able to move in a maze intelligently by adapting to the changes in its environ- ment. Neural networks and learning algorithms provide promising results when applied to the problem of maze traversal as these algorithms involve the concept of learning thus leading to the development of intelligent behavior of the robot.

9 But at the same time these algorithms are computationally expensive especially when applied to the situation where the robot has no knowledge of the terrain. These algo- rithms might fail if the networks are not able to learn correctly based on the data provided

[7]. Also these algorithms work well when the terrain knowledge is provided in advance.

Though in this case, they might still need multiple runs of the algorithm or more than one network to find the path in the maze [26]. In contrast, our maze traversal method does not require multiple runs of the algorithm to generate the path. No terrain knowledge is provided to the robot, other than its start and goal coordinates and the initial direction it’s facing in the grid. It forms its knowledge base and the map of the maze as and when it encounters obstacles on its path. This saves a lot of computation time and storage resources.

In Artificial Potential Field (APF) methods, a force generated by the artificial po- tential field is applied by the mobile robot to its maneuvering or driving system as its control input. The obstacle is considered to be at the highest potential and goal point at the lowest potential. The robot tries to go from high to low potential thus avoiding obstacle and moving on a safe path, till it reaches the goal point. Traditional approaches in this field did not optimize the path generated by this method. Newer approaches use concepts like Fuzzy logic, Genetic Algorithms (GA) to provide robustness and optimiza- tion [29]. These algorithms work highly efficiently as compared to other methods when the terrain information or the working environment is known. These algorithms suffer from problems such as robot might get trapped due to local minima, it might not be able to move between two closely spaced obstacles, or the goal becomes unreachable due to the close proximity of the obstacles [10, 29].

10 Ge S.S. et. al. [10] and Vadakkepat P. et. al. [29] presented simulation results for the proposed methods and algorithms devised to solve the aforementioned problems in the APF approach. These methods require knowing the distance to the goal point and the potential field to be applied at all times. Also they require optimization techniques in conjunction with the path planning algorithms to generate cost efficient paths. The maze traversal algorithm devised in this thesis uses a grid to determine the position of the robot at all times which is simpler and more intuitive. The forward path generated towards the goal and the return path to the start are inherently cost efficient. The prox- imity of obstacles to the goal has no effect on the results. The algorithm was tested and implemented in a real world setting using a physical robot instead of assuming a point automaton in simulation tests.

2.4 Path Planning and Motion Control

Motion planning for mobile autonomous robots in static or dynamic environments is a complex problem. As discussed in section 2.2, if the robot has the complete knowledge about its environment, it can effectively plan a path between two points of interest. The situation changes when the terrain is unknown and the robot has to plan a path dynam- ically depending on the local environmental situations.

Three general processes of localization, path planning and motion control are associ- ated with Navigation [25,5]. Localization is the process wherein the current coordinates of the robot are identified. This might be done using a camera placed on the robot, or an overhead camera monitoring the progress of the robot in the workspace and a computer processing the received images and relaying the information to the robot [4, 18], using a

11 grid [27]; using IR, sonar or touch sensors [21,5, 18, 16, 17]; judging the location based on wheel velocities [23], using GPS [8] etc.

Overhead or robot mounted cameras have been used by researchers in a number of different application areas [18, 16]. The images obtained from the camera are processed by a central computer and then fed to the robot to enable it in locating itself and the obstacles around it. This takes away the image processing load from the robot and it can use its limited resources for other necessary computations. Use of cameras is especially popular in robot soccer tournaments. Sometimes teams might even use multiple color, and black and white cameras to judge the location of the ball, its team and the opponent team’s robots [5, 17]. Though the use of a camera seems like an optimal solution for identifying the coordinates or position and orientation of the robot, this method has its limitations. Sometimes it takes away the autonomy of the robot, since a manual operator may control the robot depending on the images being received from the camera [4, 16].

Also the time and resources involved increase computational overhead and renders com- plexity to the system.

Use of GPS is another strategy for allowing the robot to know its coordinates in outdoor applications [8]. GPS signals are easily interfered with by the presence of build- ings, trees and other obstructions. Atmospheric conditions, ionospheric delay in signals, number of satellites in visible range also effect GPS radio signals [28, 22]. These factors cumulatively affect the accuracy with which the robot position can be calculated. Our application required use of a positioning system indoors to accurately locate the robot’s coordinates in the maze. Though factory GPS is available for indoor applications, its ac- curacy is still dependent on layout of the work space area, number of beacons used, radio shadow etc. Also the cost of the equipment, computation time and complexity required

12 to calculate the robot’s location were deterrents in its use in our application [15, 31]. It is much simpler to rely on Khepera III’s ground sensors to determine when a grid line has been crossed. The sensors are highly sensitive and accurate. The computation time is negligible and works best for our grid based model.

Path Planning can be described as the act of determining and selecting a collision free path for the robot to move on between two locations in a workspace [4]. The objective is to ensure that the robot reaches the goal point safely without colliding into obstacles that it might encounter on its way. In dynamic or unknown terrains sensing helps the robot in visualizing the environment it is surrounded by and make path planning deci- sions accordingly. Depending on the application researchers choose whether to employ offline, online or a combination of both algorithms for path planning module. Over the years much research has been done on graph, , potential field, neural networks, wall following, biologically inspired planning and probabilistic techniques (to name a few) for path planning in a maze [27,2, 10, 29,4,7,3, 14, 24,9, 25, 26].

Robot motion control is important for maneuvering the robot around in the workspace.

Velocity and speed requirements can differ depending on the nature of the terrain. Also depending on the type of algorithm employed, presence of obstacles, the nature of appli- cation for which the robot is being used determines stop and move conditions. In [23]

Breitenberg Vehicles are discussed. Motion control in these vehicles depends on the way motors and sensors are connected together. Thus depending on the excitation of the sensors and their connection with motors, the vehicle turns accordingly.

Bruce and Veloso in [5] employed trapezoidal velocity profile to control robot motion.

In this technique, the robot velocity is increased at maximum acceleration till the robot

13 reaches its maximum speed and is allowed to cruise at this speed before decelerating at maximum allowed value when it needs to stop at the final destination. Usually motion control module is made a part of the path planning algorithms.

2.5 Problem Formulation

In this thesis we consider a 4 X 4 square grid as the map of the terrain. A maze is constructed on this grid with obstacles placed on the boundaries of the cells in the grid.

A Khepera III robot is used to traverse the maze to reach a goal location from the start location and then return to start location using the best navigated path. The robot uses

IR sensors to detect obstacles on its way and to visualize its surroundings. No information regarding the terrain is provided to the robot before the robot ventures out into the maze other than its start and goal locations and the direction its facing at the start coordinates.

It performs path planning and obstacle avoidance as it tries to make its way around the maze to reach its goal. It makes an obstacle database to store the information regarding the coordinates where the obstacles are present.

The motion of the robot is restricted in the maze to move in a straight line and no diagonal motion is allowed. While turning, the robot can make 90◦ turns or in the multiples of it. This is necessary to ensure that the robot is always aware of its location in the grid since it updates its coordinates every time it crosses a grid line using the IR sensors underneath it. No camera has been used either on the robot or above the maze to capture the images of the maze and to provide location information.

14 Figure 2.1 gives the example of the grid used.

Figure 2.1: Grid used in the thesis

2.6 Technical Specifications

Mobile autonomous robots have found use in versatile applications ranging from the traditional robotics to research in artificial intelligence, ; automating factory settings and even in international competitions such as MicroMouse, RoboCup

F180 small size league [5] etc. and non-traditional areas such as bomb detection and diffusion, searching for survivors at the time of natural disasters to name a few [1]. The robot should be able to fulfill certain requirements such as ease of use and programming, robustness, low development cost, flexible configuration, computation capability, ability to traverse rugged terrain, autonomous operation and wireless communication capability

[30].

15 The Khepera robot (Figure 2.2) produced by Swiss Federal Institute of technology in

Lausanne, Switzerland is one such robot that satisfies the above mentioned requirements and is used around the world by people with varying robotic expertise. It has a highly efficient library of on-board applications which aids in control of the robot and to execute user commands. K-Team [13] provides an insight in the technical information given below.

Figure 2.2: Khepera Robot

2.6.1 Hardware specifications

We have used the Korebot II board on the Khepera III base which comes with the standard embedded Linux so that the robot can operate autonomously.

• Processor: DsPIC 30F5011 at 600MHz

• Ram: 64 MB

• Motors: 2 DC brushed servo motors with incremental encoders at roughly 22 pulses

per mm of robot motion. The speed for both the wheels of the robot can be

16 controlled individually since the motors are controlled by separate PID controllers.

This helps in maneuvering the robot around the grid by making precise turns,

accelerating and decelerating according to the environmental conditions. It can

reach a maximum speed of 0.5 m/s.

• Sensors: Khepera III has 8 Infra-red proximity and ambient light sensors with up

to 30cm range, arranged circularly around the robot for a better visual perception

and obstacle detection. 2 Infra-red ground proximity sensors help in line following

and applications. Also 5 Ultrasonic sensors with range 20cm to 4

meters are provided.

• Communication: Communication with Khepera III can be accomplished by using

multiple options such as using a RS232 on a standard serial port, or via USB with

KoreBot up to 115kbps, wireless Ethernet with KoreBot and a Wi-Fi card.

• Extension Bus: Additional expansion modules can be added to the robot using the

KB-250 bus.

• Size: Khepera III has a diameter measuring 130 mm and 70 mm height.

2.6.2 Software Specifications

• Development Environment for Autonomous Application: GNU C/C++ compiler.

• A desktop PC with Ubuntu as the operating system is used to program the al-

gorithms for robot motion control and analyze the output provided by the robot

during program execution.

17 • Simulators: V-REP and Webots are the two most popular choices to simulate an

environment with Khepera III robot executing the programmed algorithms.

(a) Top View (b) Side View 1 (c) Side View 2

(d) Back View (e) Bottom View

Figure 2.3: Different Views of the Khepera Robot

2.7 Constraints of the Environment

There are certain issues that have been addressed in this thesis.

• The robot is not provided with the location of the obstacles before it starts. So the

IR sensors play a major role in helping the robot visualize its surroundings. The

ambient light and the nature of the material used for the obstacles and the grid

affect the sensor readings.

• Since no camera is being used in the laboratory setting, it is an important task for

the robot to keep track of its current coordinates correctly at all times.

• The mobility of the robot in the grid gets restricted as no diagonal motion is allowed.

18 • Since no graph or tree algorithms are being used, maintaining a database of visited

nodes, backtracking and blacklisting will need to be done intelligently and efficiently.

• No manual intervention is provided to the robot, so there is a need to develop

robust, efficient and intelligent autonomous path planning algorithm.

19 Chapter 3

Strategy and Algorithms

3.1 Introduction

The main focus of this thesis is on the development of a Path Planning and Obstacle

Avoidance algorithm. The algorithm involves intelligent path planning by the robot, provided with the direction, and start and goal coordinates information. The problem domain is physically set up in an enclosure in which the robot makes its way around the maze autonomously. The objective is to traverse the maze to reach the goal coordinates from the start coordinates while avoiding obstacles present on the path and return to the start coordinates using the shortest explored path. A 4 by 4 grid is designed for the robot to move on wherein each cell in the grid has equal dimensions. The obstacles are placed along the grid cell boundaries to create a maze. The IR sensors below the robot provide the necessary sensor value information required to determine if a grid line has been crossed by the robot. Accordingly, the coordinates of the robot are updated.

20 3.2 Terms Used

The terms used in the study of the algorithms and strategies are being briefly discussed

below:

1. Start coordinates : The initial coordinates from where the robot starts traversing

the maze towards the set goal and returns to if the forward journey towards the goal

is successful.

2. Final Goal coordinates : The set goal coordinates which the robot should reach in

a maze and begins its return journey from towards the start coordinates.

3. Direction : The direction that the robot is currently facing to keep track of its

orientation in the grid so that the appropriate and informed decisions can be made

such as updating coordinates, strategy decision, obstacle database creation etc.

4. Grid : The grid is the physical layout, or map, of the terrain on which the robot

traverses. In this case, the grid is a square divided into four by four cells.

5. Path : Path is the sequential array of cells generated using predefined strategies to

keep track of the cell that needs to be reached by the robot and the in which

the robot needs to visit cells on the grid in order to reach the destination cell.

6. Obstacle database : Obstacle database is the repository of all the obstacles that

the robot encounters in its path while traversing the maze. The coordinates and the

direction in which the obstacle was encountered are stored for further reference during

path planning.

7. Intermediate Goal : The coordinates of the cell that was to be visited next in

sequence on the path from the current coordinates and that has been rendered un-

21 reachable for the moment due to the presence of an obstacle on the cell boundary

between the cells is added into a special database and is now termed as an Intermedi-

ate Goal. Intermediate goal formation is being discussed in further detail in Section

3.3.3.

8. Backtracking : The act of retracing the path from the cell on the grid where the

robot faces a blocked condition, preventing it to move in the forward direction, to the

cell from where the current path was generated is termed as backtracking.

9. Blacklisting : The coordinates of the cell from which the robot backtracks are termed

to be blacklisted and the process of adding them to the blacklist database is called

blacklisting.

10. Return Path : The robot after reaching the final goal coordinates starts its journey

back to the start coordinates. But instead of retracing its entire forward path it

returns using an intelligently planned shortest navigation path which is generated

simultaneously while it moves in the forward direction by eliminating duplicate cell

entries in the path. Return path strategy will be discussed in detail in this chapter.

22 3.3 Path Planning and Obstacle Avoidance

A mobile robot in a maze has to perform multiple tasks of navigation, path planning, updating database of known obstacles and obstacle avoidance. Static obstacles are con- sidered in the domain of this problem definition. The robot is made to navigate in a maze-like environment where the positions of the obstacles are unknown at the begin- ning. As the robot sees an obstacle while navigating, a corresponding entry is made to the database and a strategy is decided to avoid it followed by the creation of a new path. The different processes related to all the tasks the robot has to perform are being discussed in detail in this chapter.

3.3.1 Navigation

The four directions East, West, North and South are used to navigate a map usually with the help of a compass. Khepera III relies on its sensors for navigation purposes.

The grid designed for it helps in keeping it on its intended path, and determining what coordinates it is currently present on. But crossing a grid line will only inform the robot that it has moved on to the next coordinates. The robot might need to make turns on its path, and a sense of direction would be extremely important in determining whether x or y coordinates need to be changed.

We have used a direction system which is similar to the general navigation system.

Here the directions are numbered 0, 1, 2, and 3 for East, West, North and South. Since the robot only makes 90◦ turns or in multiples of it, its easy to keep track of the direction it is facing. We used a variable direction in our algorithm. Every time the robot makes a 90◦ right turn we add 1 to direction, and subtract 1 from it when a 90◦ left turn is

23 made. To determine the current direction we use the simple equation :-

result = direction mod 4

By the use of this equation, at any given point the direction of the robot can be determined accurately. When this is used in conjunction with the sensor data, the robot is able to navigate efficiently through the grid. The robot equipped with the knowledge of start, goal coordinates and the direction its currently facing can easily make its way around the grid on its own.

3.3.2 Obstacle Database Creation

When the robot sees an obstacle, it adds the entries documenting the coordinates and the direction in which the obstacle is present for further reference. Each time the robot sees an obstacle the database will be checked if the entry regarding this obstacle has been made or not. The values for the boundary line cells are initialized in the beginning. This is done to make sure that the robot has information regarding where the grid ends. By initializing these values we ensure that the robot will not try making paths which will take it off the grid.

The array below provides us with an example where the database for all the obstacles in the 0 direction will be stored for a 4 x 4 grid. Since the robot cannot go further than the coordinates (0,4), (1,4), (2,4) and (4,4) in the 0 direction, so these positions are already marked by a flag in the database.

24   0 0 0 1        0 0 0 1    block0 =      0 0 0 1        0 0 0 1

The entries to the database are made in dual action. The coordinates where the robot is currently present in and the direction in which it sees the obstacle are added to the database. At the same time the coordinates adjacent to the obstacle in the opposite direction are added to the database too.

The following array updations make this process more clear. Here we assume that the robot is present in the coordinates (1,2) and it detected an obstacle in 0 direction in this block. So the entries are updated in the database for direction 0 for coordinates(1,2) and simultaneously for coordinates (1,3) in the direction 2.

    0 0 0 1 1 0 0 0             0 0 1 1 1 0 0 1     block0 =   block2 =       0 0 0 1 1 0 0 0             0 0 0 1 1 0 0 0

This simultaneous action helps in keeping track of obstacles present between two cells

on the grid which share common cell boundary. This technique helps in forming better

path plans. When a new path needs to be made, the database is cross referenced to see if

25 any obstacle might hinder the path. This predetermination of obstacles makes the entire process time efficient.

3.3.3 Intermediate Goal Formation

The next task after updating the obstacle database is the formation of an intermediate goal. Intermediate goal are the coordinates of the cell that the robot was supposed to go to if the obstacle had not hindered its path. Every time an obstacle is encountered such coordinates are added to the intermediate goal database. The original path is suspended for the moment and a strategy is decided to go to this intermediate goal first. When the robot has reached an intermediate goal, these coordinates are marked as visited and are deleted from the database. A path is made to the next intermediate goal present in the database. After all the intermediate goals have been visited, the robot starts moving towards the final goal coordinates.

In order to reach the intermediate goal the robot needs to do path planning and obstacle avoidance. There are three decisions to be chosen from at any point of time by the robot; to either take a right turn, a left turn or to backtrack to avoid the obstacle. In some circumstances though only one of these decisions might hold true. Such conditions would occur if the robot is present in the boundary line cells of the grid. In such cells taking only one of the decisions would be possible since the turn on the other side would take the robot off the grid. Also such situations might occur when the robot has prior knowledge from the database that there are obstacles present either to the left or the right of the current obstacle. In such situations too only one of the decisions might be possible. Lastly if the robot is stuck in a block and no further forward motion is possible then backtracking is chosen.

26 Choosing either one of the right or left strategies implies that the robot goes around the obstacle in either the right or the left direction. Since the coordinates need to be known at all times so the robot goes around the obstacles by crossing into adjacent blocks and turning 90◦ every time a grid line is crossed.

Figure 3.1: Intermediate Goal

Figure 3.1 depicts an ideal case where the robot is moving on a path, and on reaching cell Cell1 it faces an obstacle. It makes the entry in the obstacle database and the cell

IG is made an intermediate goal. Now suppose that the cells Cell1 and IG are boundary line cells, so the robot has only one decision to make to avoid the current obstacle, that is to take a left turn. Also let us suppose that the robot doesn’t come across any further obstacles till it reaches the intermediate goal IG. It turns 90◦ left when it sees the obstacle in cell Cell1. Then it crosses over to cell Cell2 where it turns again to cross over to cell

Cell3. Finally in cell Cell3 it turns to reach the IG.

27 The situation in Figure 3.1 is ideal since no further obstacles are encountered by the robot in its path till it reaches the cell IG. If that was not the case then each time the robot would have seen an obstacle it would have taken either one of the left or the right decisions to avoid the obstacle, and forming intermediate goals.

But in some rare situations robot might not be able to take either of the right or the left decision. Such situations occur when the robot is stuck in a cell from where making further paths is not feasible. In such situations the robot needs to backtrack to the last coordinates it had come from. Also the current cell coordinates are added to a blacklist database. Backtracking and blacklisting are being discussed in detail in the next section.

28 3.3.4 Blacklisting and Backtracking

There can be a number of situations in which the robot finds itself stuck in a cell, and the

path it was moving on cannot be followed further. In such situations there is no other

solution but to return to the cell from where the current path was generated; since the

last successful path was completed on that cell and the current path towards the next

intermediate/final goal was generated there. Figure 3.2 below shows such a situation.

(a) Going towards FG (b) Backtracking process

Figure 3.2: Backtracking

Figure 3.2(a) depicts a situation where the robot is moving on the path towards the

final goal FG but encounters an obstacle O1 in the Cell1. So it tries to avoid it by taking a right turn and reaching Cell4 first and from there on continue towards the final goal FG. But on reaching the Cell4, the robot encounters obstacle O2. It updates the

entry in the obstacle database and tries deciding on the strategy. Here we have assumed

that the Cell4 is on the boundary of the grid so taking a right turn to avoid obstacle O2

is out of the question, since that would take the robot off the grid. Only solution in this

case is to go back to the Cell1 and attempt a new path towards the goal FG. In Figure

29 3.2(b) the robot backtracks to the Cell1, since that was the last coordinate from where

this path had been formed.

Cell4 will never become a part of any path that will be formed by the robot in the

future. Every time a new path needs to be formed, the array of blacklisted cells will be

checked to see if any of these cells is going to be the part of the new path being formed.

If present, the current path is discarded and the strategy to make new path is changed.

This process goes on till a path with no blacklisted cells can be formed. If no path

can be made from a cell without the presence of a blacklisted cell in it, then further

backtracking is tried. If that is not possible too then the algorithm terminates abnormally

with a no solution condition. An example of a case where further backtracking is not

possible is where the robot tries to backtrack to an already blacklisted cell.

Backtracking and Blacklisting ensure that the robot makes paths which are dead end free and efficient. But the scope of decisions by the robot is limited since it checks for backtrack path only for the last cell it had come from. If that is a part of the blacklisted cells now, then the algorithm terminates with a no solution condition.

3.3.5 Strategy Decision

Now that we have discussed all the situations that a robot might face while traversing the maze, we will now discuss how the actual strategy decisions are taken when the robot sees an obstacle.

First thing that needs to be checked when making a strategy decision is to see if the robot is present in any of the boundary line cells. If so, then strategy decisions are limited

30 here, since one of the decisions is canceled out. The robot can decide to go in only one direction either left or right. The turn towards the other side would take it off the grid.

Also if the robot is stuck in a cell from which it cannot go further due to the presence of obstacles, then it can decide to backtrack and blacklist the current cell. But if the robot tries to backtrack to a blacklisted cell then the algorithm terminates with a no solution condition.

If the robot is not present on the boundary line cells, then before taking the next decision the database of known obstacles is cross verified. If there are more than one obstacles present along the boundary of the current cell, then the decision of the robot will depend on the direction in which the obstacles are present. If there is an obstacle on the right side of the robot along with the obstacle in front of it, then it will go towards the left direction and vice versa. If the robot finds itself surrounded by obstacles in all the three directions then it will decide to backtrack. Here again if the robot tries to backtrack to a blacklisted cell then the algorithm terminates with a no solution condition.

Lastly if the obstacle in front of the robot is the only obstacle in the current cell, then the robot tries to go towards the right direction first and rest of the decisions depend on what situations the robot faces further.

31 3.4 Algorithms

The obstacle avoidance algorithms designed for Khepera III are explained in detail here.

Each subsection elaborates on the actual process being carried out by each procedure.

Subsection 1.3.1 describes the main algorithm through which all the other procedures are invoked.

3.4.1 Main Algorithm

Algorithm1, describes the main algorithm designed for path planning and obstacle avoid- ance for the robot.

The algorithm begins by providing the Inputs to the robot before it starts venturing out into the maze. These are its Start and Goal coordinates, and the Direction its facing in the grid. After all this information is provided, the robot uses it to plan its Path from the initial to the final coordinates using procedure Path Planning(). Algorithm

2 explains path planning procedure carried out by the robot.

The motor controllers for the Khepera III are initialized for the wheels to start their movement. The robot starts moving on the Path that has been formed through Path

Planning(). Every time a grid line is crossed while the robot is moving on its Path, the coordinates and the return path database entries are updated. If it comes across any obstacle, then Obstacle Avoidance() procedure is referred to decide on strategy of how to avoid the obstacle. Algorithm 5 discusses obstacle avoidance procedure in detail.

If no obstacles are encountered till the robot reaches it final destination, then it sets the Return Path flag and reaches the start coordinates using the return path and the algorithm terminates successfully.

32 1 BEGIN 2 Input: Start and Goal x, y coordinates; Direction Khepera III is currently facing 3 Initialize Khepera III Motor Controller 1 and 2 ; Start and Goal coordinates 4 Path Planning() /* makes Path from the Start to Goal coordinates */ 5 while True do 6 Start moving on Path; update coordinates when a grid line is crossed 7 Build Return Path database 8 if Obstacle then 9 Obstacle Avoidance() 10 end 11 if (Cur-x == Int-Goal-x and Cur-y == Int-Goal-y) then 12 Update Intermediate goal database 13 if Blacklisted node in Intermediate Goal stack then 14 delete this node 15 end 16 if (Int-Goal-Num == -1) then 17 Path Planning() makes Path to the Final Goal coordinates 18 else 19 Make Path to next Intermediate Goal 20 if Blacklisted nodes exist in each Path robot can make from current coordinates then 21 Terminate program with no solution condition 22 end 23 Repeat till all Intermediate Goals have been visited 24 end 25 end 26 if (Cur-x == Final-Goal-x and Cur-y == Final-Goal-y) then 27 Set Return Path flag and reach Start coordinates using the Return Path database 28 STOP 29 Robot has reached Start coordinates 30 end 31 end 32 END Algorithm 1: Path Planning and Obstacle Avoidance Algorithm

33 Steps 11 through 25 are followed if the obstacles are encountered by the robot while moving towards its final destination coordinates. The robot starts moving towards the intermediate goal coordinates that were set up by the obstacle avoidance procedure. After reaching these coordinates, the robot deletes these coordinates from the intermediate goal database and checks if any further intermediate goals need to be visited. Also the blacklisted cells database is cross-referenced to verify if any of the intermediate goals stored are a part of the blacklisted cells database. If any such entries are found, then they are deleted from the intermediate goal database. This process goes on till a non- blacklisted entry can be found in the intermediate goal database or there are no more entries left in the database. In the latter case, the robot makes Path for the final goal coordinates.

For the former case, a new Path is constructed to the next non-blacklisted entry found in the intermediate goal database. If no Path can be formed without a blacklisted cell featuring in it, then the algorithm terminates with a no solution condition. After all the intermediate goals have been visited, the robot makes Path to go towards the final goal coordinates.

The robot starts its return journey after reaching final goal coordinates. Return path is generated simultaneously as the robot is moving towards the final goal coordinates.

This database stores only those cells which form a connected path from start to goal coordinates and don’t involve any cell to be traversed twice. This ensures that the return path is the shortest explored path. The algorithm terminates successfully when the robot returns back to the start coordinates.

34 3.4.2 Path Planning Procedure

Algorithm2 describes the path planning process carried out by the robot. Result X,Y is

calculated using Current and Goal X,Y coordinates. Procedures PathForX() or Path-

ForY() are called depending on the Result X,Y calculated here.

1 PROCEDURE PathPlanning() 2 res-x = abs(goal-x - cur-x) 3 res-y = abs(goal-y - cur-y) 4 if (res-x <= res-y) then 5 PathForX() 6 else if (res-x > res-y) then 7 PathForY() 8 end 9 end Algorithm 2: Path Planning

Path length is calculated to determine if the Path in the X direction has lesser

number of cells to traverse than the Path in the Y direction or vice versa. Depending

on the path length, the robot decides to move on the shorter path first. If the robot is

equidistant from the Goal coordinates then it always decides to move on the Path in the X direction first.

3.4.3 Path Planning in the X Direction

The Path is formed for the robot to go in the X direction in Algorithm3.

A flag found is initialized to check the condition if any blacklisted cell is present in the Path created to move in the X direction. If cross-verification with the blacklisted cells database comes up with a negative result then the robot starts moving on the Path just created. In case the cross-verification is successful, then the decision of moving in the X direction first is overridden. The end requirement is to form a successful path to

35 1 PROCEDURE PathForX() 2 Make Path that robot needs to follow to reach Goal-x coordinates 3 found = 0 4 if blacklisted node in Path then 5 found = 1 6 break 7 end 8 if (found == 0) then 9 Move on Path just formed 10 end 11 else if (found == 1) then 12 Make Path to go towards Goal-y first 13 if blacklisted node in Path to go towards Goal-y first too then 14 STOP 15 Terminate program with no solution condition 16 else 17 Move on Path to go towards Goal-y first 18 end 19 end Algorithm 3: Path For X

reach the goal coordinates. If the shorter path has a blacklisted cell, then a longer but

successful path can be used by the robot to reach the goal coordinates.

The blacklisted cells database is cross-verified for the Path created to go in Y direc- tion first too. If at this point cross-verification comes up negative then the algorithm terminates prematurely with a no solution condition. On the other hand if there are no blacklisted cells in this Path, then the robot starts moving on it.

3.4.4 Path Planning in the Y Direction

Algorithm4 is a mirror image of Algorithm3.

In this algorithm though the Path to go in the Y direction is made first. If the cross- verification with the blacklisted cells database fails for the Path in the Y direction then

the same procedure is done for the Path in the X direction. If both these references fail,

then the algorithm terminates.

36 1 PROCEDURE PathForY() 2 Make Path that robot needs to follow to reach Goal-y coordinates first 3 found = 0 4 if blacklisted node in Path then 5 found = 1 6 break 7 end 8 if (found == 0) then 9 Move on Path just formed 10 end 11 else if (found == 1) then 12 Make Path to go towards Goal-x first 13 if blacklisted node in Path to go towards Goal-x first too then 14 STOP 15 Terminate program with no solution condition 16 else 17 Move on Path to go towards Goal-x first 18 end 19 end Algorithm 4: Path For Y

In case of successful result, the robot starts moving on the Path in the X direction

first.

3.4.5 Obstacle Avoidance Procedure

When the robot sees an obstacle in its Path, this procedure is used to form the interme- diate goal and backtrack if a blacklisted cell free path cannot be generated. Both these processes are done by procedure intermediate goal and backtrack which will be discussed next.

When an obstacle is seen, Algorithm5 updates the database to reflect the coordinates and the direction in which the obstacle is present. Then the intermediate goal is formed using procedure intermediate goal() so that the robot can avoid the obstacle and upon reaching the intermediate goal continue on towards the final goal. But if that is not pos- sible then the backtrack() procedure is called to take the robot to the last non-blocking

37 1 PROCEDURE ObstacleAvoidance() 2 if obstacle then 3 Update obstacle databse 4 IntermediateGoal() 5 Choose Right or Left Strategy to avoid the obstacle 6 if None of these strategies can be chosen to avoid the obstacle then 7 if Backtracking is possible then 8 Backtrack() 9 else 10 STOP 11 Robot stops with a no solution condition 12 end 13 end 14 Repeat for more obstacles on path 15 end Algorithm 5: Obstacle Avoidance coordinates it had come from.

3.4.6 Intermediate Goal Formation

Algorithm6 deals with formation of an intermediate goal when the robot sees an obstacle.

Depending on the direction the robot is facing when it sees an obstacle, an interme- diate goal is generated for it. In step 2, the Mod of the direction is calculated to switch into the correct switch case in the algorithm. Steps 3 through 19 present the cases for intermediate goal formation on the of position and direction of the robot. After the formation of the intermediate goal, in step 20, its cross-referenced with the blacklisted cells database. If this intermediate goal is a part of the blacklisted cells, then its removed from the list of intermediate goals.

If there are no more intermediate goals in the database then the path is generated for the final goal coordinates. If there are more intermediate goals in the database, then they are visited in turn.

38 1 PROCEDURE IntermediateGoal() 2 switch (Direction mod 4) do 3 case (0) 4 int-goal-x = cur-x 5 int-goal-y = cur-y + 1 6 endsw 7 case (1) 8 int-goal-x = cur-x + 1 9 int-goal-y = cur-y 10 endsw 11 case (2) 12 int-goal-x = cur-x 13 int-goal-y = cur-y - 1 14 endsw 15 case (3) 16 int-goal-x = cur-x - 1 17 int-goal-y = cur-y 18 endsw 19 endsw 20 if recently formed Intermediate Goal is part of the Blacklisted nodes list then 21 Remove recently formed Intermediate Goal 22 if No more Intermediate Goal’s then 23 goal-x = final-goal-x 24 goal-y = final-goal-y 25 PathPlanning() 26 end 27 else 28 goal-x = next-int-goal-x 29 goal-y = next-int-goal-y 30 PathPlanning() 31 end 32 end 33 else 34 Make Path to recently formed Intermediate Goal 35 end Algorithm 6: Intermediate Goal

39 3.4.7 Backtrack

Algorithm7 describes the backtracking procedure for the robot. Firstly, the Path is made to the last coordinates the robot had come from. These are the coordinates from where the current Path had been generated and the robot got stuck while traversing it. Next, the current coordinates are added to the blacklisted cells database so that in future these coordinates are not made part of any path and intermediate goal database.

Also the latest intermediate goal is deleted from the database since it cannot be accessed anymore. Lastly, the robot returns to the last coordinates it had come from. All these

1 PROCEDURE Backtrack() 2 Make Path to the last coordinates the robot had come from 3 Add the current coordinates to the Blacklisted nodes list since no further Path can be made from them 4 Delete latest Intermediate Goal that had been formed 5 Follow Path to reach the coordinates robot had last come from Algorithm 7: Backtrack procedures together help the robot navigate the grid autonomously and take the decision of aborting the algorithm if it cannot find a solution. If the robot reaches the final goal coordinates, it returns a success update and starts its return journey.

3.5 Flowchart for the Maze Traversal Algorithm

The following flowchart gives a generalized view of how the algorithm for this thesis works.

40 Figure 3.3: Flowchart for the Maze Traversal Algorithm

41 Chapter 4

Results and Analysis

4.1 Introduction

The system described in chapter 3 was implemented and tested and the results and analysis are being presented here. A 4 x 4 square grid was used with obstacles placed on the grid cell boundaries. The initial direction the robot is facing, the start and goal coordinates and the placement of the obstacles is changed in the different tests. The maze design, the start and the goal coordinates, strategy decision and obstacle avoidance have a major impact on the path generated by the robot. The initial direction however had no effect on the results.

In this chapter, 4 test results are being presented and discussed. The videos for the same are available as well. Kindly click on the hyperlinks provided to view the test case videos. In the first 3 test cases, the robot successfully reaches the goal coordinates and makes its way back to the start coordinates. In the last case, however, the robot gets stuck in a cell from which it cannot move further and hence, it terminates the algorithm prematurely and stops with a no solution.

42 4.2 Test Cases

We have tested our algorithm with more than ten different configuartions of obstacles

on the terrain grid. The obstacle placements were selected to ensure that all kinds of

backtracking, cell-blacklisting, and path trajectories from start to destination cell get

tested. Four of these ten configurations are presented in the following discussion. For the

first three cases, different types of backtracking and cell-blacklisting are performed by the

path planning algorithm and the fourth case shows the situation in which the robot gets

stuck even though there is a possible path to the destination.

4.2.1 Test Case 1

This test case demonstrates the case in which there is one instance of backtracking the

path and multiple instances of the right-hand strategy failing, causing the robot to re-

sort to the lower priority left hand strategy. The robot eventually finds a path to the

destination location, and returns using the shortest path to the starting location. The

Start and the Goal coordinates for this test case are (1, 0) and (3, 1) respectively. Robot

starts out by facing the 0 direction. At this point the shortest path that robot can make

is to travel to (1, 1) and then turn right 90◦ and move towards the final goal coordinates.

After performing this action it faces its first obstacle at (2, 1) in the direction 1. The robot decides to use the right hand strategy to avoid the obstacle, making (3, 1) as the intermediate goal 1. As the robot turns right 90◦, it faces its next obstacle. This time

too it decides on the right hand strategy to avoid the obstacle, making (2, 0) as the next

intermediate goal. Upon reaching (2, 0), it updates the intermediate goal database to

reflect that it has reached the latest intermediate goal. Here it plans a path to reach the

next intermediate goal (3, 1) which incidentally is the Final goal too. As it plans to move

43 to (3, 0), it faces another obstacle. At this point the robot realizes that it’s stuck in a cell from which it cannot go forward, since it is a boundary line cell and obstacles are present in the direction 0 and 1. So it decides to backtrack to (2, 1), blacklisting (2, 0) in the process. The path details are shown in Figure 4.1.

(a) Test Case 1 (b)

Figure 4.1: Test Case 1

At coordinates (2, 1), the robot already has knowledge about 2 obstacles in direction

1 and 2, so in order to reach (3, 1), it decides to use the left hand strategy to reach (2,

2). As it turns 90◦ left, it encounters the next obstacle. Coordinates (2, 2) are added to the intermediate goal database and the robot decides to use the left hand strategy to reach it. On reaching (2, 2), intermediate goal database is updated and the robot plans to reach the final goal through (3, 2), but is faced by the obstacle ahead in the direction

1. It decides to use the left hand strategy to avoid the current obstacle. As soon as it turns 90◦ left, it encounters the third obstacle at (2, 2) in the direction 0 and decides to use the left hand strategy to reach the intermediate goal (2, 3). Upon reaching (2, 3),

44 Number Forward Path Intermediate Goal Database Return Path 1 (1, 0) (1, 0) 2 (1, 1) (1, 1) 3 (2, 1) (3, 1) (2, 1) 4 (2, 1) (2, 0) 5 (1, 1) (1, 1) 6 (1, 0) (1, 0) 7 (2, 0) (3, 0) (2, 0) 8 (1, 0) (1, 0) 9 (1, 1) (1, 1) 10 (2, 1) (2, 1) 11 (2, 1) (2, 2) 12 (1, 1) (1, 1) 13 (1, 2) (1, 2) 14 (2, 2) (3, 2), (2, 3) (2, 2) 15 (1, 2) (1, 2) 16 (1, 3) (1, 3) 17 (2, 3) (2, 3) 18 (3, 3) (3, 3) 19 (3, 2) (3, 2) 20 (3, 1) (3, 1)

Table 4.1: Test Case 1 Path details the robot plans a path to reach the next intermediate goal in database, i.e. (3, 2). On reaching (3, 2) the last intermediate goal to visit is (3, 1). When the robot reaches (3,

1), all the intermediate goals have been visited and the robot has reached the final goal too.

Table 4.1 provides the path planning and the intermediate goal formation procedure in detail. The blue colored entries in the intermediate goal column mark the goals that the robot successfully reached. The red entry is the intermediate goal that was deleted from the database since the coordinates (2, 0) were blacklisted and this goal was considered to be unreachable.

The robot starts its return journey to the start goal coordinates after reaching the goal. The return path had been formed simultaneously as the robot was moving towards

45 the final goal coordinates. The green path in the Figure 4.1 shows the return journey undertaken by the robot. In Table 4.1 the black entries in the return path column form the final return path that the robot undertakes from goal to start coordinates. As discussed in Chapter 3, this path is formed simultaneously as the robot is moving on the forward path. Every time the robot encounters the duplicate coordinates entry in the return path, all the entries between the duplicate entries including the previous instance of the duplicate entry are deleted. The red entries in the return path column indicate the deleted entries. The black entries form the shortest navigated path traversed by the robot with no duplicate nodes present in the path. Upon reaching (1, 0) the robot stops and the algorithm terminates successfully.

4.2.2 Test Case 1 Analysis

The test cases were analyzed on the efficiency of the algorithm design, path planning strategies chosen; effect of the initial direction, the start and the goal coordinates, and the grid design on the final outcome of the test case. Increasing the velocity of the robot had marginal difference on the overall time required to complete a test case.

To perform the analysis, the number of cells that the robot had to traverse in order to reach the goal coordinates and return to the start coordinates was compared. The robot uses the forward path as the return path too in a way that the shortest return path is devised from the original navigated forward path. The duplicate nodes in the forward path are deleted to create an efficient and shortest return path. Table 4.2 shows the total number of cells traversed by the robot on both the paths.

As was seen in the Table 4.1 when the robot encountered the coordinates (1, 0) at row

46 Forward Path Return Path Number of cells traversed 18 8

Table 4.2: Test Case 1 Analysis

6, all the entries including the previous occurrence of the coordinates (1, 0) at row 1 in the return path were deleted. This action is based on the fact that the robot returned to the same cell while navigating the grid and hence all the cells that it traversed between these two occurrences did not lead to a solution and hence should not be included in the return path. The same action was performed for the pair of rows 8 and 6, 12 and 9; and 15 and 13 of the table. The final return path included the black colored entries in the return path column, and were traversed starting from row 20 and ending at row 8 to reach the start coordinates.

The initial direction that the robot was facing before the start of the algorithm had no effect on the test results as the robot turned and faced the correct direction to move on the planned path. The start and the goal coordinates, in conjunction with the grid design impacted the results considerably since the strategy decisions, obstacle avoidance and path planning were all based on them. This in turn impacted the forward and the return paths.

The video for Test Case 1 can be found at: Test Case 1

4.2.3 Test Case 2

This test case demonstrates a case in which the right-hand strategy does find a long path to the destination when a much shorter path exists if the left hand strategy is used. But if the left-hand strategy is used as the default rule then there is also a similar situation of

finding the inefficient path. We demonstrate with this case that our algorithm is seeking

47 to find a path to the destination, and is not exploring all possible paths to determine the shortest path to the destination. In this test case, as shown in the Figure 4.2, the robot starts at the coordinates (1, 0) facing direction 0 to reach the goal coordinates

(1, 2). It makes a straight line shortest path to reach the goal coordinates through the cell (1, 1). When the robot reaches the cell (1, 1), it faces it’s an obstacle and cannot continue on with its straight line path. Since it’s the first obstacle and the robot has no knowledge about the grid, it decides to use the right hand strategy to avoid the obstacle.

The coordinates (1, 2) are added in the intermediate goal database. As the robot turns right 90◦, it faces another obstacle. This time since the robot has knowledge regarding the obstacle on its left and in front of it, so it decides to use the right hand strategy to avoid the current obstacle. The coordinates (2, 1) are added to the intermediate goal database and a new path is generated to reach them. The robot reaches the cell (2, 1) successfully using the path generated by the right hand strategy. The coordinates (2, 1) are deleted from the intermediate goal database and a strategy is decided to reach the next coordinates in the database.

Number Forward Path Intermediate Goal Database Return Path 1 (1, 0) (1, 0) 2 (1, 1) (1, 2) (1, 1) 3 (1, 1) (2, 1) 4 (1, 0) (1, 0) 5 (2, 0) (2, 0) 6 (2, 1) (2, 2) (2, 1) 7 (3, 1) (3, 1) 8 (3, 2) (3, 2) 9 (2, 2) (2, 2) 10 (2, 3) (2, 3) 11 (1, 3) (1, 3) 12 (1, 2) (1, 2)

Table 4.3: Test Case 2 Path details

48 (a) Test Case 2 (b)

Figure 4.2: Test Case 2

The two possible shortest ways to reach (1, 2) would be to go through (1, 1) or (2,

2). But it decides to take a path through (1, 1), it will be faced by the same obstacles that it has seen and avoided earlier. So it decides to take the path through (2, 2). But as soon as it turns, it’s faced by another obstacle in its path. The coordinates (2, 2) are added to the intermediate goal database and the robot chooses the right hand strategy to avoid the obstacle. The right hand strategy succeeds and the robot is able to reach the latest intermediate goal (2, 2). The intermediate goal database is updated and a path is planned to reach the next intermediate goal (1, 2). Since the cell (1, 2) is adjacent to the cell (2, 2), the robot decides to take the shortest path to reach it which would be to cross into cell (1, 2) from the cell (2, 2) in the direction 3. When the robot tries move on this path, it’s faced by another obstacle. It makes the decision of using the right hand strategy to avoid this obstacle based on the obstacle map it has created so far.

49 The right hand strategy path succeeds and the robot reaches the final goal cell. Now, it starts the return journey to the start goal coordinates. The green path in the figure marks the return path undertaken by the robot. The algorithm terminates successfully when the robot reaches the start coordinates (1, 0).

Table 4.3 Shows the forward path, intermediate goal and return path entries.

4.2.4 Test Case 2 Analysis

Test case 2 was analyzed to determine how many cells the robot had to traverse on its forward and the return path. Table 4.4 presents the results. The robot traversed nearly the same number of cells on both the forward and the return paths. The robot did not have to backtrack or navigate around the maze on pre-explored paths to find the best way to reach the goal. All the intermediate goals were visited in turn too. Only deletion of the duplicate nodes in the return path was in the row pair 1 and 4 of Table 4.3.

Forward Path Return Path Number of cells traversed 11 9

Table 4.4: Test Case 2 Analysis

The grid design and the lack of knowledge of the grid pattern in the beginning of the algorithm in conjunction with the strategy decision to avoid the obstacles led to the development of the paths in the grid. The robot successfully reached the goal and retraced the best navigated path to the start coordinates. The path planning module made efficient paths and the robot didn’t have to backtrack.

The video for Test Case 2 can be found at: Test Case 2

50 4.2.5 Test Case 3

This test case demonstrates that the robot is capable of working within the bounds of the grid and find the path to the destination. There are numerous intermediate goals that it sets and resets and despite this complexity it is able to traverse a straight return path to the start location. Figure 4.3 shows the Test case 3, wherein the robot starts from the cell (0, 0) facing direction 0, and needs to make its way to the final goal coordinates (0,

2). The robot invokes the path planning module and builds the shortest path to the final goal coordinates which is a straight line path from (0, 0) to (0, 2). On reaching cell (0,

1), the robot faces an obstacle on its path. Since this is a boundary line cell, so the robot has only one strategy to choose in order to avoid the obstacle, i.e. right hand strategy.

It adds coordinates (0, 2) to the intermediate goal database and makes a path to avoid the obstacle. But, as soon as it turns right 90◦, it faces another obstacle at the same coordinates. Now, the coordinates (1, 1) are added to the intermediate goal database, and the robot decides on using the right hand strategy to avoid the obstacle again. When the robot reaches the cell (1, 1), the intermediate goal database is updated.

The robot plans the path to the next coordinates in the intermediate goal database but is faced by a third obstacle in the direction 0. Coordinates (1, 2) are added to the intermediate goal database too. The robot has knowledge regarding the obstacle on its left so it decides on using the right hand strategy to avoid the current obstacle. As soon as it turns right 90◦, a fourth obstacle blocks the robot’s path. The robot adds the coordinates (2, 1) to the database and uses the right hand strategy to plan the path. On reaching the cell (2, 1), two entries remain in the intermediate goal database (1, 2) and

(0, 2). Robot tries reaching the goal (1, 2) by planning a path through the cell (2, 2).

51 (a) Test Case 3 (b)

Figure 4.3: Test Case 3

On reaching (2, 2), the robot turns left 90◦ to try crossing over to the cell (1, 2) and reaching the first intermediate goal, but an obstacle blocks the path. The intermediate goal database is not updated since it’s the same cell that the robot is trying to reach currently. This way duplicate entries in the database are avoided. The robot decides on using the right hand strategy and reaches the cell (1, 2), and updates the intermediate goal database. Now the only entry remaining is (0, 2).

In order to reach the cell (0, 2) from (1, 2), only thing the robot needs to do is to turn right 90◦ and cross over the grid line. But a last obstacle is blocking the robot’s path.

Again, the robot decides on using the right hand strategy (since on the left an obstacle is present too). The right hand strategy succeeds and the robot reaches the final and the last intermediate goal. The robot starts with its return journey now and reaches the start

52 Number Forward Path Intermediate Goal Database Return Path 1 (0, 0) (0, 0) 2 (0, 1) (0, 2) (0, 1) 3 (0, 1) (1, 1) 4 (0, 0) (0, 0) 5 (1, 0) (1, 0) 6 (1, 1) (1, 2) (1, 1) 7 (1, 1) (2, 1) 8 (1, 0) (1, 0) 9 (2, 0) (2, 0) 10 (2, 1) (2, 1) 11 (2, 2) (2, 2) 12 (2, 3) (2, 3) 13 (1, 3) (1, 3) 14 (1, 2) (1, 2) 15 (1, 3) (1, 3) 16 (0, 3) (0, 3) 17 (0, 2) (0, 2)

Table 4.5: Test Case 3 Path details coordinates successfully, thus terminating the algorithm. Table 4.5 shows the entries for the intermediate goal, and the forward and the return paths undertaken.

4.2.6 Test Case 3 Analysis

Table 4.6 analyzes and presents the results regarding the number of cells that the robot had to traverse on its forward and return paths.

Forward Path Return Path Number of cells traversed 15 9

Table 4.6: Test Case 3 Analysis

The results show that the return path was efficient as compared to the forward path.

Given the grid design, the robot was successfully able to avoid multiple obstacles and reach the goal. The robot used the shortest navigated return path possible for the grid to reach the start coordinates. The algorithm worked in the most effective way possible

53 to solve this test case. Table 4.5 shows that the robot visited all its intermediate goals.

There were three updates in the return path. The duplicate entries in the row pairs 4 and 1, 8 and 5, and 15 and 13 were deleted.

The above three test results and their analysis, along with the other test cases run for the algorithm show that the algorithm designed for the maze traversal by khepera robot is effective and efficient and can be used in the real world scenarios. The algorithm finds the best possible solution for the given grid design and the information provided to the robot in accordance with the strategies designed for the maze traversal in this algorithm.

The algorithm was not able to find solution in every given test case, as is seen in the test case that follows. But the failure in this case is due to the inability of the robot to traverse through blacklisted cells in the grid.

The video for Test Case 3 can be found at: Test Case 3

4.2.7 Test Case 4

This test case is designed to show the situation in which the algorithm fails to find a path to the destination even though one such path is possible. The robot gets stuck because it runs out of options for its new intermediate destinations, and it cannot backtrack due to the cells on the prior path being blacklisted. There are some ways out of this dilemma but then they come with the risk of robot getting in an infinite loop. The robot starts maze traversal in this test case by facing the direction 3. The start and the goal coordinates are (0, 0) and (3, 2) respectively. The path planning module generates the path for the robot to go through (0, 2), then turn 90◦ right and reach the goal. The robot turns at the start coordinates to face the direction 0 and starts moving on the planned path. When

54 it reaches (0, 2), it turns 90◦ right but is prevented from moving further by the obstacle at (0, 2) cell boundary. It decides to use the right hand strategy to avoid this obstacle.

Coordinates (1, 2) are added to the intermediate goal database. As the robot reaches the cell (0, 1) it turns 90◦ left to cross over to cell (1, 1) but here it faces second obstacle.

Coordinates (1, 1) are added to the database too and robot again decides to use right hand strategy to avoid the obstacle. Figure 4.4 shows the path undertaken by the robot in the maze.

(a) Test Case 4 (b)

Figure 4.4: Test Case 4

When the robot reaches cell (1, 0), it turns to face direction 0 and reach its intermedi- ate goal (1, 1), but is prevented from doing so by a third obstacle blocking its path. Since coordinates (1, 1) are already present in the database, a duplicate entry is not added.

Robot decides to use the right hand strategy to avoid this obstacle as well. On reaching the cell (2, 1), robot turns 90◦ left to reach its intermediate goal (1, 1), yet again an ob- stacle blocks its path. It decides to use the right hand strategy but on turning 90◦ right

55 Number Forward Path Intermediate Goal Database Return Path 1 (0, 0) (0, 0) 2 (0, 1) (0, 1) 3 (0, 2) (1, 2) (0, 2) 4 (0, 1) (1, 1) (0, 1) 5 (0, 0) (0, 0) 6 (1, 0) (1, 0) 7 (2, 0) (2, 0) 8 (2, 1) (2, 2) (2, 1) 9 (3, 1) (3, 2) (3, 1) 10 (2, 1) (2, 1) 11 (3, 1) (3, 1)

Table 4.7: Test Case 4 Path details it faces fifth obstacle. Coordinates (2, 2) are added to the intermediate goal database and right hand strategy is chosen to avoid the obstacle and reach the goal. When the robot reaches the cell (3, 1), it’s prevented from crossing over to cell (3, 2) by another obstacle.

Coordinates (3, 2) are added to the database. Since the cell (3, 1) is a boundary line cell, a right hand strategy cannot be decided upon to avoid the obstacle and reach the goal. So, the robot decides to use left hand strategy instead. On reaching cell (2, 1), it’s clear that the robot cannot go further since this cell has been explored earlier and the obstacles present on the cell boundary prevent the robot from venturing forth. So the robot backtracks to the last coordinates it has come from and blacklists the coordinates

(2, 1). The red arrow in the figure depicts the backtracking process. On reaching cell

(3, 1), the robot has no further way of exploring the cells or moving forward. So the algorithm is aborted and the robot stops with a no solution condition. Table 4.7 shows the entries for the intermediate goals, the forward and the return path. None of the intermediate goals could be reached in this test case. Also since the robot had to abort the algorithm, the return journey is never undertaken.

56 This is a special test case where we see how the type of grid influences the robot’s decisions and thereby the final outcome.

4.2.8 Test Case 4 Analysis

As we have seen, this a special test case. The robot gets stuck in a dead end and is not able to reach the goal coordinates. Still, an analysis was performed for the paths that were formed before the robot had to stop. The Table 4.8 shows that the algorithm was performing well, but due to the blacklist and backtrack procedures the robot’s movement was restricted. There was a marked difference in the number of cells that the robot had

Forward Path Return Path Number of cells traversed 11 5

Table 4.8: Test Case 4 Analysis

traversed so far in the forward path and what the robot had to traverse for the return path, though a conclusive analysis cannot be performed in this test case. In Table 4.7 we see that the duplicate nodes in row pairs 5 and 1, and 10 and 8 were deleted.

The video for Test Case 4 can be found at: Test Case 4

57 4.3 Test Cases Strategy Dependent Analysis

The Test Cases presented in this thesis demonstrate a bias towards right hand strategy implementation. If we changed this bias to left hand strategy, then the results differ for the discussed test cases. In this section, we will present an elaborate analysis for the left hand strategy bias and its comparison with the right hand strategy.

4.3.1 Test Case 1 Left Strategy

In these test cases, we keep the initial direction, start and goal coordinates unchanged.

The strategy decision is changed to left hand strategy when the robot encounters an obstacle for the first time. Path planning and obstacle avoidance procedures implemen- tation remains similar as in the right hand strategy case, but the robot plans a path to go around the obstacle from left hand side first instead of the right. If the path cannot be designed due to the presence of another obstacle, end of grid or left hand strategy has already been explored for that particular cell, then the robot plans a path around the obstacle using the right hand strategy.

(a) Test Case 1 Left Strategy (b)

Figure 4.5: Test case 1 Strategy Comparison

As shown in the Figure 4.5, the robot begins its journey in the grid from the start

58 Number Forward Path Intermediate Goal Database Return Path 1 (1, 0) (1, 0) 2 (1, 1) (1, 1) 3 (2, 1) (3, 1), (2, 2) (2, 1) 4 (1, 1) (1, 1) 5 (1, 2) (1, 2) 6 (2, 2) (3, 2), (2, 3) (2, 2) 7 (1, 2) (1, 2) 8 (1, 3) (1, 3) 9 (2, 3) (2, 3) 10 (3, 3) (3, 3) 11 (3, 2) (3, 2) 12 (3, 1) (3, 1)

Table 4.9: Test Case 1 Left Strategy Analysis

coordinates (1, 0) to reach the goal coordinates (3, 1). It plans the shortest path to reach

the goal coordinates by visiting the coordinates (1, 1) first, turn 90◦ right and continue on

to reach the goal coordinates. But at the coordinates (2, 1), the robot encounters its first

obstacle. Table 4.9 provides the path and intermediate goal stack information. It pushes

the coordinates (3, 1) on the intermediate goal stack, decides on planning the path in

accordance with the left hand strategy and turns 90◦ left. Here it encounters its second obstacle, pushes coordinates (2, 2) on the intermediate goal stack and plans a path to reach the coordinates (2, 2). It subsequently encounters obstacles at the coordinates (2,

2), pushing the coordinates (3, 2) and (2, 3) on the intermediate goal stack. Finally after visiting all the intermediate goals, the robot reaches the final goal coordinates.

Forward Path Return Path Test Result Right Hand Strategy 18 8 Successful Left Hand Strategy 12 8 Successful

Table 4.10: Test Case 1 Strategy Wise Analysis

Table 4.10 provides a comparison of implementing right hand and left hand strategies

for the same test case. Forward path length for right hand strategy is greater than that of

the left hand strategy. The return path length remains the same for both the cases. The

59 robot is able to successfully reach the goal coordinates by implementing either strategy.

The forward path length is greater in the right hand strategy since the robot explored the coordinate (2, 0) in an attempt to reach the goal coordinates, but since these coordinates were blocked off completely, the robot had to backtrack to the coordinates (2, 1). Such backtracking is not required when the robot implemented the left hand strategy bias. If the coordinates (2, 0) were not blocked off, then the robot would have reached the goal coordinates by a much shorter path than what left hand strategy would have devised.

4.3.2 Test Case 2 Left Strategy

In this test case, the start coordinates are (1, 0) and the goal coordinates are (1, 2).

Figure 4.6 shows the path taken by the robot by implementing left hand strategy.

(a) Test Case 2 Left Strategy (b)

Figure 4.6: Test case 2 Strategy Comparison

60 Number Forward Path Intermediate Goal Database Return Path 1 (1, 0) (1, 0) 2 (1, 1) (1, 2) (1, 1) 3 (0, 1) (0, 1) 4 (0, 2) (0, 2) 5 (1, 2) (1, 2)

Table 4.11: Test Case 2 Left Strategy Analysis

Table 4.11 summarizes the path planned by left hand strategy when it encounters the obstacle at the coordinates (1, 1).

Forward Path Return Path Test Result Right Hand Strategy 11 9 Successful Left Hand Strategy 5 5 Successful

Table 4.12: Test Case 2 Strategy Wise Analysis

Table 4.12 compares the left hand and right hand strategy for the same grid pattern.

Left hand strategy shows marked improvement in planning the path than the right hand strategy in this test case. But the results are dependent on the grid pattern and the placement of the start and the goal coordinates.

(a) (b)

Figure 4.7: Test Case 2 Alternate Goal Strategy Analysis

61 If we take a sub test case for this grid, where we change the goal coordinates from (1,

2) to (2, 2), keeping the start coordinates same, then the results for left hand and right hand strategy implementation change as shown in the Figure 4.7. The results in this case are a mirror image of the results for the Test Case 2. The robot is able to reach the goal coordinates in all the 4 cases, but the path lengths differ according to the strategy implemented.

4.3.3 Test Case 3 Left Strategy

In this test case, the start coordinates are (0, 0) and the goal coordinates are (0, 2). The robot plans a straight line path from start to the goal coordinates, but encounters an obstacle at the coordinates (0, 1). Even with the left hand strategy bias, the robot will have to go around the obstacle from the right hand side instead, since the cell (0, 1) is on the boundary line of the grid and no path can be planned using left hand strategy here.

So, the final path planned is the same for both left hand and right hand strategy for this test case. Figure 4.8 shows the path traversal by the robot.

(a) Test Case 3 Left strategy (b)

Figure 4.8: Test Case 3

62 Table 4.13 compares the right and left hand strategy. The average path length is the same for both the strategies.

Forward Path Return Path Test Result Right Hand Strategy 15 9 Successful Left Hand Strategy 15 9 Successful

Table 4.13: Test Case 3 Strategy Wise Analysis

4.3.4 Test Case 4 Left Strategy

The start and the goal coordinates for this test case are (0, 0) and (3, 2) respectively.

Figure 4.9 shows the path planned by the right hand and left hand strategy. As we can see, by using the right hand strategy when the robot encounters the obstacle at the coordinates (0, 2), it eventually gets stuck and has to abort the algorithm with the no solution condition. But by using the left hand strategy, the robot is able to reach the goal coordinates with the path length of 8 cells.

(a) Test Case 4 Left strategy (b)

Figure 4.9: Test Case 4 Left Strategy

63 Number Forward Path Intermediate Goal Database Return Path 1 (0, 0) (0, 0) 2 (0, 1) (0, 1) 3 (0, 2) (1, 2) (0, 2) 4 (0, 3) (0, 3) 5 (1, 3) (1, 3) 6 (1, 2) (1, 2) 7 (2, 2) (2, 2) 8 (3, 2) (3, 2)

Table 4.14: Test Case 4 Left Strategy Analysis

Table 4.14 summarizes the intermediate goal, forward and return path details.

Forward Path Return Path Test Result Right Hand Strategy 11 5 Unuccessful Left Hand Strategy 8 8 Successful

Table 4.15: Test Case 4 Strategy Wise Analysis

Table 4.15 compares the left hand and right hand strategy paths. Right hand strategy in this test case fails to find a path to reach the goal coordinates, If we take the mirror of the this test case and run both left hand and right hand strategies, then the right hand strategy is able to find the solution and reach the goal coordinates by traversing 8 grid cells, but the robot gets stuck by using the left hand strategy.

The test results and their analysis show that the final outcome for any test case is highly dependent on the grid pattern and the strategy decision made by the robot.

The lack of knowledge regarding the grid pattern and the strategy decisions made with the limited information available or acquired by the robot through navigation restricted the movement of the robot in the grid. At the same time, the algorithm performed extremely well in such unpredictable scenarios and generated promising results. Chapter

5 elaborates on how the current algorithm can be expanded to accommodate multiple agents, made dynamic and summarizes the thesis.

64 Chapter 5

Conclusions and Future Work

In this chapter, we summarize the strategy used in this thesis and discuss its future extension.

5.1 Conclusion

The research described in this thesis aimed to implement a motion strategy in a grid based unknown environment using Khepera III robots in a closed enclosure. For many years, researchers have been trying to formulate a motion planning strategy that would enable the robot to traverse a maze from a start to a goal point avoiding obstacles encountered on its path. As discussed in Chapter 2, the strategies varied depending upon the amount of information provided to the robot regarding the maze environment, before it actually starts moving in the maze. Also the nature of the maze, the medium used to provide the visual information to the robot such as a camera, GPS, grid; IR, UV or Sonar sensors etc. determines the efficiency of the strategies.

65 Offline algorithms create a path for the robot to move on prior to actual robot motion, since these algorithms take into account the maze details. After the collision-free path has been generated by the algorithm (if there exists any), the robot moves on the chosen path to reach its destination. Online algorithms on the other hand, generate the path dynamically depending on the environmental conditions faced by the robot in the maze.

These algorithms though more dynamic in nature, are relatively complex and difficult to implement. The robot might have to spend a large amount of time in navigating around the maze and some paths might have to be discarded since they may lead to dead ends.

But these algorithms are highly useful in the real-world scenarios wherein the robot might have to find its way to its destination point in a dynamic and cluttered workspace.

The objective of this research was to build a robust, dynamic and efficient algorithm that would enable the robot to move on collision free paths and avoid any future obstacles encountered. The direction, start and goal coordinates were provided to the robot before it started traversing the maze. It then planned the shortest path to reach the goal. If any obstacles were encountered on the path, the obstacle database was updated; intermediate goal stack was formed; new path was planned to reach the intermediate goals in reverse order of their addition to the stack. If any dead ends were encountered, the corresponding cells in the grid were marked as blacklist cells and were not included as a part of any new paths generated henceforth. Also the corresponding intermediate goals were deleted from the stack. After visiting all the intermediate goals, the robot made its way towards the final goal coordinates. The robot returned to its start position after reaching its final goal, using the most efficient navigation path it had formed during its journey to the goal position.

66 An escape strategy called backtracking was formulated, if the robot reached a dead end in its path. The robot retraced its path to the last non blacklisted coordinates from where it had generated the current path to escape the dead end cell. In certain grid patterns, the algorithm had to abort since the robot would get stuck in cells from where both forward and backtracking strategies could no longer be implemented.

The algorithm was tested on different grids and the results for the same were discussed in detail in Chapter 4. The algorithm works efficiently irrespective of the direction, start and goal coordinates provided to the robot. The nature of the grid however, has a substantial impact on the path generated.

The results showed that the algorithm devised can be used in the real-world scenarios.

5.2 Future Work

The work done in this thesis can be extended further by incorporating certain features being listed below.

• Using a team of robots to scan the maze, so that the information regarding the

terrain of the maze can be exchanged between them. This might lead to more

optimal and efficient paths being generated by each robot as the path planning

decisions would be made based on the local and global information.

• Use of camera, Sonar and/or UV sensors, GPS etc. to generate the terrain map.

• Providing the robot with grid information a priori so that a comparison can be

made between offline and online path planning strategies.

67 • Use of dynamic obstacles along with the static obstacles to increase the complexity

of the system.

• If a team of robots is being used for maze traversal, then a comparison between

centralized control and decoupled approach for path planning can be made to de-

termine which approach gives better results under the stipulated scenarios.

68 References

[1] C.S. Ananian and G Humphreys. Theseus: A maze solving robot. Technical report, Department of Electrical Engineering at Princeton University, May 1997.

[2] M. Bennewitz, W. Burgard, and S. Thrun. Optimizing schedules for prioritized path planning of multi-robot systems. In Robotics and Automation, 2001. Proceedings 2001 ICRA. IEEE International Conference on, volume 1, pages 271–276, 2001.

[3] A. Blum, P. Raghavan, and B. Schieber. Navigating in unfamiliar geometric terrain. In Proceedings of the twenty-third annual ACM symposium on Theory of computing, STOC ’91, pages 494–504, New York, NY, USA, 1991. ACM.

[4] D. Bodhale, N. Afzulpurkar, and N.T. Thanh. Path planning for a mobile robot in a dynamic environment. In Robotics and Biomimetics, 2008. ROBIO 2008. IEEE International Conference on, pages 2115–2120, February 2009.

[5] J. Bruce and M. Veloso. Real-time multi-robot motion planning with safe dynamics. In Lynne Parker, Frank Schneider, and Alan Schultz, editors, Multi-Robot Systems. From Swarms to Intelligent Automata Volume III, pages 159–170. Springer Nether- lands, 2005.

[6] Y.U. Cao, A.S. Fukunaga, and A.B. Kahng. Cooperative mobile robotics: An- tecedents and directions. Autonomous Robots, 4:7–27, 1997.

[7] D.C. Dracopoulos. Robot path planning for maze navigation. In Neural Networks Proceedings, 1998. IEEE World Congress on Computational Intelligence. The 1998 IEEE International Joint Conference on, volume 3, pages 2081–2085, May 1998.

[8] T. Ersson and X. Hu. Path planning and navigation of mobile robots in unknown environments. In Intelligent Robots and Systems, 2001. Proceedings. 2001 IEEE/RSJ International Conference on, volume 2, pages 858–864, 2001.

[9] S. Garrido, L. Moreno, M. Abderrahim, and F. Martin. Path planning for mobile robot navigation using and fast marching. In Intelligent Robots and Systems, 2006 IEEE/RSJ International Conference on, pages 2376–2381, October 2006.

[10] S.S. Ge and Y.J. Cui. New potential functions for mobile robot path planning. Robotics and Automation, IEEE Transactions on, 16(5):615–620, October 2000.

[11] O. Hachour. Path planning of autonomous mobile robot. International Journal of Systems Applications, Engineering & Development, 2(Issue 4), 2008.

69 [12] K. Heero, J. Willemson, A. Aabloo, and M. Kruusmaa. Robots find a better way: A learning method for mobile robot navigation in partially unknown environments. In Proceedings of the 8th Conf. on Intelligent Autonomous Systems, IAS-8, pages 559–566. IOS Press, 2004.

[13] K-Team. http://www.k-team.com/ .

[14] S. Kambhampati and L. Davis. Multiresolution path planning for mobile robots. Robotics and Automation, IEEE Journal of, 2(3):135–145, September 1986.

[15] G. Kantor and S. Singh. Preliminary results in range-only localization and mapping. In Robotics and Automation, 2002. Proceedings. ICRA ’02. IEEE International Con- ference on, volume 2, pages 1818 – 1823, 2002.

[16] B. Keyes, R. Casey, H.A. Yanco, B.A. Maxwell, and Y. Georgiev. Camera place- ment and multi-camera fusion for remote robot operation. In IEEE International Workshop on Safety, Security and Rescue Robotics, 2006.

[17] K.-H. Kim, K.-W. Ko, J.-G. Kim, S.-H. Lee, and H.-S. Cho. The development of a micro robot system for robot soccer game. In Robotics and Automation, 1997. Proceedings., 1997 IEEE International Conference on, volume 1, pages 644–649, April 1997.

[18] S.M. LaValle, H.H. Gonzalez-Banos, C. Becker, and J.-C. Latombe. Motion strate- gies for maintaining visibility of a moving target. In Robotics and Automation, 1997. Proceedings, 1997 IEEE International Conference on, volume 1, pages 731–736, April 1997.

[19] V.J. Lumelsky. A comparative study on the path length performance of maze- searching and robot motion planning algorithms. Robotics and Automation, IEEE Transactions on, 7(1):57–66, February 1991.

[20] M. J. Mataric. A distributed model for mobile robot environment-learning and navigation. Technical report, Massachusetts Institute of Technology, Cambridge, MA, USA, 1990.

[21] S. V. Rao Nageswara, S. Kareti, W. Shi, and S.S. Iyengar. Robot navigation in unknown terrains: Introductory survey of non-heuristic algorithms, 1993.

[22] K. Ohno, T. Tsubouchi, B. Shigematsu, S. Maeyama, and S. Yuta. Outdoor naviga- tion of a mobile robot between buildings based on dgps and odometry data fusion. In Robotics and Automation, 2003. Proceedings. ICRA ’03. IEEE International Con- ference on, volume 2, pages 1978 – 1984, September 2003.

[23] M. Perkowski, A. Aulajkh, I. Devanath, M. Lukac, and J. Biamonte. Quantum breit- enberg vehicles and quantum breitenberg faces. Electrical & Computer Engineering Department, Portland State University, Portland, OR 97207-0751, USA.

[24] G. Sanchez and J.-C. Latombe. Using a prm planner to compare centralized and decoupled planning for multi-robot systems. In Robotics and Automation, 2002. Proceedings. ICRA ’02. IEEE International Conference on, volume 2, pages 2112– 2119, 2002.

70 [25] N. Sariff and N. Buniyamin. An overview of autonomous mobile robot path plan- ning algorithms. In Research and Development, 2006. SCOReD 2006. 4th Student Conference on, pages 183–188, June 2006.

[26] S. Srinivasan, D.P. Mital, and S. Haque. A novel solution for maze traversal problems using artificial neural networks. Computers & Electrical Engineering, 30(8):563 –572, 2004.

[27] C.E. Thorpe and L.H. Matthies. Path relaxation: Path planning for a mobile robot. In OCEANS 1984, pages 576–581, September 1984.

[28] R. Thrapp, C. Westbrook, and D. Subramanian. Robust localization algorithms for an autonomous campus tour guide. In Robotics and Automation, 2001. Proceedings 2001 ICRA. IEEE International Conference on, volume 2, pages 2065 – 2071, 2001.

[29] P. Vadakkepat, K.C. Tan, and M.-L. Wang. Evolutionary artificial potential fields and their application in real time robot path planning. In , 2000. Proceedings of the 2000 Congress on, volume 1, pages 256–263, 2000.

[30] L.F. Wang, K.C. Tan, and V. Prahlad. Developing khepera robot applications in a webots environment. In Micromechatronics and Human Science, 2000. MHS 2000. Proceedings of 2000 International Symposium on, pages 71–76, 2000.

[31] R. Willgoss and V. Rosenfeld. High precision gps guidance of mobile robots. In Proceedings of the Australasian Conference in Robotics and Automation, 2003.

[32] J. Zheng, H. Yu, W. Liang, and P. Zeng. A distributed and optimal algorithm to coordinate the motion of multiple mobile robots. In Intelligent Control and Automa- tion, 2008. WCICA 2008. 7th World Congress on, pages 3027–3032, June 2008.

71