5
MOBILE ROBOT NAVIGATION ON PARTIALLY KNOWN MAPS USING THE A* ALGORITHM AQTR 2010 THETA 17 th edition May 28-30 2010 Cluj-Napoca Romania, Proceedings of 2010 IEEE International Conference on Automation, Quality and Testing, Robotics. http://aqtr.ro, Paul I. Muntean Abstract In these paper I will present a path planning solution for mobile robots navigation based on the A * algorithm which is one of the most used algorithms in path planning now days . For routing requirement under three dimensions is much more complex than under two dimensions, the traditional A* algorithm should be improved to meet the routing requirement. In these paper the traditional A* algorithm will be used since the maps used for nav- igation are 2D maps. IDA* is a space-efficient version of A*, but it suffers from cycles in the search space (the price for using no storage), repeated visits to states (the overhead of iterative deep- ening), and a simplistic left to-right traversal of the search tree. I. INTRODUCTION Recent studies are showing that every day activity of people in cities and countries in modern society is rapidly rising so there is a need for navigating people’s movement . Researchers have tried to come with new and better navigation technologies in the last years[3](Jones, 2001). In order to understand path find- ing it is necessary to have a short look on the history . All start- ed in the nineteen seventies when some scientists started re- search on the routing solution for moving chess in the chess- board or moving fragment in the puzzle map[2](Eklund et al., 1996). The main reason for starting the research in these fields is that these problems can be easily abstracted and further on the results can be applied to more complex fields of study. And with the development of path finding, several new classical routing al- gorithms have been introduced to generate better routing solution. For example the Dijkstra algorithm is the most fa- mous one, which evaluates the moving cost from one node to any other node and sets the shortest moving cost as the con- necting cost of two nodes[2](Eklund et al., 1996). Around at the same period of time Best-First-Search algorithm is also introduced in the researchers community. A little dif- ferent from the Dijkstra algorithm, Best-First-Search algorithm has an different approach because it estimates the distance from current position to goal position , and it chooses the step that is more closer to the goal position[1](Amit). The difficulty was growing with the new path finding situations so the old path finding algorithm had to be improved to meet the new introduced requirements. A new path finding algorithm was introduced and it was named the A* algorithm.The A* algo- rithm tries to combine the advantages offerd by Dijkstra algo- rithm and Best-First-Search algorithm, A* algorithm tries for each movement to take the shortest step and it also takes into account about the choosing step whether on the direction which is just from source to target[3](Jones, 2001). The key point of research has become algorithms efficiency in the moment when the real development of the A* algorithm started. The A* algorithm is a breadth first algorithm, it uses huge amounts of memory to keep the data of current proceed- ing nodes[5](Nelson and Toptsis, 1992). During the traversing of all nodes which are possible to be placed on the optimized path the disadvantage is that it uses a huge size of stack which is needed to contain the considering grids. Not only the devel- opment of the A* algorithm’s and its own efficiency are for interest , new methods of using A* algorithm are also consid- ered by the researchers. Like the bidirectional A* algorithm searching method which was used in order to reduce the time cost of the A* algorithm. The most important difference of the bidirectional A* algorithm compared to the classical A* algo- rithm which is searching from source to target is that as his name says that it searches from source to target and vice versa. The searching stops immediately when the two direction’s searching progresses meet each other in bidirectional A* algo- rithm[5](Nelson and Toptsis, 1992). Now days regarding the computer society it can be observed an three dimensional trend , three dimensional A* algorithm’s development has caught more attentions. The A* algorithm can be used also with some small differences in computing paths along 3D maps which are more like the real world challenges that path planning algorithm will have to face .An example would be the path planning of a cart in a mine system which has more levels. One frequently used approach for solving three dimensional path planning problem, is to map the three dimensional map into a two dimensional expression in order to use traditional A* algorithm for solving the path finding request[4](Makanae and Takaki, 2004). These technique of mapping 3D to 2D is work- ing for path finding requirement under some simple 3D situa- tions, under complex situations these mapping method could not easily be used for path finding so the recommendation is to use a more advance method. Let´s take for example the restricted spatial situations such as mining and inner of tall buildings where the overlapping layers may appear frequently, and these situations are impossible to be solved by using the traditional A* algorithm solution, for mapping 3D into 2D and deriving the optimum path are nearly impossible under these special circumstances. The A* algo- rithm can be improved to meet these new challenging situa- tions. As an evolution of the A* algorithm the three dimensional A* algorithm emerged which can work with more restrictive situa- tions. A few precise modifications should be taken for the

Mobile Robot Navigation on Partially Known Maps Usign the a Star Algorithm-muntean Paul i 2

Embed Size (px)

Citation preview

Page 1: Mobile Robot Navigation on Partially Known Maps Usign the a Star Algorithm-muntean Paul i 2

MOBILE ROBOT NAVIGATION ON PARTIALLY

KNOWN MAPS USING THE A* ALGORITHM

AQTR 2010 THETA 17th

edition May 28-30 2010 Cluj-Napoca Romania, Proceedings of 2010 IEEE International Conference

on Automation, Quality and Testing, Robotics. http://aqtr.ro, Paul I. Muntean

Abstract

In these paper I will present a path planning solution for mobile

robots navigation based on the A * algorithm which is one of the

most used algorithms in path planning now days . For routing

requirement under three dimensions is much more complex than

under two dimensions, the traditional A* algorithm should be

improved to meet the routing requirement. In these paper the

traditional A* algorithm will be used since the maps used for nav-

igation are 2D maps. IDA* is a space-efficient version of A*, but it

suffers from cycles in the search space (the price for using no

storage), repeated visits to states (the overhead of iterative deep-

ening), and a simplistic left to-right traversal of the search tree.

I. INTRODUCTION

Recent studies are showing that every day activity of people in

cities and countries in modern society is rapidly rising so there

is a need for navigating people’s movement . Researchers have

tried to come with new and better navigation technologies in

the last years[3](Jones, 2001). In order to understand path find-

ing it is necessary to have a short look on the history . All start-

ed in the nineteen seventies when some scientists started re-

search on the routing solution for moving chess in the chess-

board or moving fragment in the puzzle map[2](Eklund et al.,

1996). The main reason for starting the research in these fields

is that these problems can be easily abstracted and further on

the results can be applied to more complex fields of study. And

with the

development of path finding, several new classical routing al-

gorithms have been introduced to generate better routing

solution. For example the Dijkstra algorithm is the most fa-

mous one, which evaluates the moving cost from one node to

any other node and sets the shortest moving cost as the con-

necting cost of two nodes[2](Eklund et al., 1996).

Around at the same period of time Best-First-Search algorithm

is also introduced in the researchers community. A little dif-

ferent from the Dijkstra algorithm, Best-First-Search algorithm

has an different approach because it estimates the distance

from current position to goal position , and it chooses the step

that is more closer to the goal position[1](Amit). The difficulty

was growing with the new path finding situations so the old

path finding algorithm had to be improved to meet the new

introduced requirements. A new path finding algorithm was

introduced and it was named the A* algorithm.The A* algo-

rithm tries to combine the advantages offerd by Dijkstra algo-

rithm and Best-First-Search algorithm, A* algorithm tries for

each movement to take the shortest step and it also takes into

account about the choosing step whether on the direction which

is just from source to target[3](Jones, 2001).

The key point of research has become algorithm’s efficiency in

the moment when the real development of the A* algorithm

started. The A* algorithm is a breadth first algorithm, it uses

huge amounts of memory to keep the data of current proceed-

ing nodes[5](Nelson and Toptsis, 1992). During the traversing

of all nodes which are possible to be placed on the optimized

path the disadvantage is that it uses a huge size of stack which

is needed to contain the considering grids. Not only the devel-

opment of the A* algorithm’s and its own efficiency are for

interest , new methods of using A* algorithm are also consid-

ered by the researchers. Like the bidirectional A* algorithm

searching method which was used in order to reduce the time

cost of the A* algorithm. The most important difference of the

bidirectional A* algorithm compared to the classical A* algo-

rithm which is searching from source to target is that as his

name says that it searches from source to target and vice versa.

The searching stops immediately when the two direction’s

searching progresses meet each other in bidirectional A* algo-

rithm[5](Nelson and Toptsis, 1992).

Now days regarding the computer society it can be observed an

three dimensional trend , three dimensional A* algorithm’s

development has caught more attentions. The A* algorithm can

be used also with some small differences in computing paths

along 3D maps which are more like the real world challenges

that path planning algorithm will have to face .An example

would be the path planning of a cart in a mine system which

has more levels.

One frequently used approach for solving three dimensional

path planning problem, is to map the three dimensional map

into a two dimensional expression in order to use traditional

A* algorithm for solving the path finding request[4](Makanae

and

Takaki, 2004). These technique of mapping 3D to 2D is work-

ing for path finding requirement under some simple 3D situa-

tions, under complex situations these mapping method could

not easily be used for path finding so the recommendation is to

use a more advance method.

Let´s take for example the restricted spatial situations such as

mining and inner of tall buildings where the overlapping layers

may appear frequently, and these situations are impossible to

be solved by using the traditional A* algorithm solution, for

mapping 3D into 2D and deriving the optimum path are nearly

impossible under these special circumstances. The A* algo-

rithm can be improved to meet these new challenging situa-

tions.

As an evolution of the A* algorithm the three dimensional A*

algorithm emerged which can work with more restrictive situa-

tions. A few precise modifications should be taken for the

Page 2: Mobile Robot Navigation on Partially Known Maps Usign the a Star Algorithm-muntean Paul i 2

standard A* algorithm and the result is the new improved 3D

A* algorithm.

2.THE A* ALGORITHM

The [12]A* algorithm uses a best-first search and finds the

least-cost path from a given initial node to one goal node (out

of one or more possible goals). It uses a distance-plus-cost heu-

ristic function (usually denoted f(x)) to determine the order in

which the search visits nodes in the tree. The distance-plus-cost

heuristic is a sum of two functions.The path-cost function,

which is the cost from the starting node to the current node

(usually denoted g(x)) and an admissible "heuristic estimate" of

the distance to the goal (usually denoted h(x)).

F = G + H (1)

The h(x) part of the f(x) function must be an admissible heuris-

tic; that is, it must not overestimate the distance to the goal.

Thus, for an application like routing, h(x) might represent the

straight-line distance to the goal, since that is physically the

smallest possible distance between any two points or nodes.

If the heuristic h satisfies the additional condition

h(x)≤d(x,y)+h(y) (2)

for every edge x, y of the graph (where d denotes the length of

that edge), then h is called monotone, or consistent. In such a

case, A* can be implemented more efficiently, roughly speak-

ing, no node needs to be processed more than once, and A* is

equivalent to running Dijkstra's algorithm with the reduced cost

.

d'(x,y): = d(x,y) − h(x) + h(y) (3)

As A* traverses the graph, it follows a path of the lowest

known path, keeping a sorted priority queue of alternate path

segments along the way. If, at any point, a segment of the path

being traversed has a higher cost than another encountered path

segment, it abandons the higher-cost path segment and travers-

es the lower-cost path segment instead. This process continues

until the goal is reached.

Like all informed search algorithms, it first searches the routes

that appear to be most likely to lead towards the goal. What

sets A* apart from a greedy best-first search is that it also takes

the distance already traveled into account; the g(x) part of the

heuristic is the cost from the start, not simply the local cost

from the previously expanded node.

Starting with the initial node, it maintains a priority queue of

nodes to be traversed, known as the open set (not to be con-

fused with open sets in topology). The lower f(x) for a given

node x, the higher its priority. At each step of the algorithm, the

node with the lowest f(x) value is removed from the queue, the

f and h values of its neighbors are updated accordingly, and

these neighbors are added to the queue. The algorithm contin-

ues until a goal node has a lower f value than any node in the

queue (or until the queue is empty). (Goal nodes may be passed

over multiple times if there remain other nodes with lower f

values, as they may lead to a shorter path to a goal.) The f value

of the goal is then the length of the shortest path, since h at the

goal is zero in an admissible heuristic. If the actual shortest

path is desired, the algorithm may also update each neighbor

with its immediate predecessor in the best path found so far;

this information can then be used to reconstruct the path by

working backwards from the goal node. Additionally, if the

heuristic is monotonic (or consistent,), a closed set of nodes

already traversed may be used to make the search more effi-

cient.

3.IMPLEMENTATION

The Open List in A* is implemented as a balanced binary tree

sorted on f values, with tie-breaking in favor of higher g values.

This tie-breaking mechanism results in the goal state being

found on average earlier in the last f-value pass. In addition to

the standard Open/Closed Lists, marker arrays are used for

answering (in constant time) whether astate is in the Open or

Closed List. We use a “lazy-clearing” scheme to avoid having

to clear the marker arrays at the beginning of each search. Each

path finding search is assigned a unique (increasing) id that is

then used to label array entries relevant for the current search.

The above optimizations provide an order of magnitude per-

formance improvement over a standard “textbook” A* imple-

mentation[6].

Figure 1.The A* algorithm part 1

function A*(start,goal)

closedset := the empty set// Set of nodes already evaluated.

openset := set containing the initial node // Tentative nodes

to be evaluated.

g_score[start] := 0 // D. from start along optimal path.

h_score[start] := heuristic estimate distance(start, goal)

f_score[start] := h_score[start]// Estimated total distance

from start to goal through y.

while openset is not empty

x := the node in openset having the lowest f_score[]value

if x = goal

return reconstruct_path(came_from[goal])

remove x from openset

add x to closedset

foreach y in neighbor_nodes(x)

if y in closedset

continue

tentative_g_score := g_score[x] + dist_between(x,y)

if y not in openset

Page 3: Mobile Robot Navigation on Partially Known Maps Usign the a Star Algorithm-muntean Paul i 2

Figure 2.The A* algorithm part 2

The closed set can be omitted (yielding a tree search algorithm)

if a solution is guaranteed to exist, or if the algorithm is

adapted so that new nodes are added to the open set only if

they have a lower f value than at any previous iteration.

4.EXPERIMENTS

These section is divided into two sections. In the first section I

will present test results obtained with a application designed

for testing the A* algorithm under different environment condi-

tion and also when using different parameters under the same

conditions map conditions.

The second part will present the test results obtained with an-

other application designed for mobile robot path planning in an

partially known environment[9]. The goal of these second part

is not only to observe the test results and times obtained for

different runs but also to see hove the robot control by the algo-

rithm remotely manages to follow the path and avoids un-

known obstacles.

4.1 The A* vs. Fast A* algorithm test results

In order to determine the time needed to determine an optimum

path from the starting position to the target position the appli-

cation uses a high resolution timer which was implemented

using the Kernel32.dl , the obtained times obtained for calcu-

lating the path have 4 decimals so it can be guaranteed that the

test results are precise and.

Fig 3.Map used for Algorithm testing

After applying the A* algorithm under the same condition by

changing his parameters it was need a comparison between the

classical A* algorithm and a more advanced A* algorithm

which is faster if we because it leaves the open node in the

priority queue.

T.N. H D F. P. F. T [sec]

1 0 y y m 0.0975

2 1 y y m 0.0302

3 2 y y m 0.0104

4 3 y y m 0.0033

5 4 y y m 0.0034

6 0 y y M(x,y) 0.1025

7 1 y y M(x,y) 0.0494

8 2 y y M(x,y) 0.0275

9 3 y y M(x,y) 0.0173

10 4 y y M(x,y) 0.0110

11 5 y y M(x,y) 0.0108

12 6 y y M(x,y) 0.0087

13 7 y y M(x,y) 0.0075

14 8 y y M(x,y) 0.0078

15 0 y y D. S. 0.108

16 1 y y D. S. 0.0286

17 2 y y D. S. 0.0114

18 3 y y D. S. 0.0034

19 4 y y D. S. 0.0037

20 0 y y E 0.1120

21 1 y y E 0.0499

22 2 y y E 0.0254

23 3 y y E 0.0205

24 4 y y E 0.0146

25 5 y y E 0.0153

26 0 y y SQR 0.1235

27 1 y y SQR 0.0155

28 2 y y SQR 0.0012

add y to openset

tentative_is_better := true

elseif tentative_g_score < g_score[y]

tentative_is_better := true

else

tentative_is_better := false

if tentative_is_better = true

came_from[y] := x

g_score[y] := tentative_g_score

h_score[y] := heuristic_estimate_of_distance(y, goal)

f_score[y] := g_score[y] + h_score[y]

return failure

function reconstruct_path(current_node)

if came_from[current_node] is set

p = reconstruct_path(came_from[current_node])

return (p + current_node)

else

return current_node

Page 4: Mobile Robot Navigation on Partially Known Maps Usign the a Star Algorithm-muntean Paul i 2

29 3 y y SQR 0.0011

30 4 y y SQR 0.0015

31 0 y no m ≥30

32 1 y no m 1.3443

33 2 y no m 0.0124

34 3 y no m 0.0322

35 0 y no M(x,y) 10.685

36 1 y no M(x,y) 2.7441

37 2 y no M(x,y) ≥ 30

38 0 y no D. S. ≥30

39 1 y no D. S. 1.3152

40 2 y no D. S. 0.0358

41 3 y no D. S. 0.3453

42 0 y no E 25.305

43 1 y no E 2.2041

44 2 y no E ≥ 30

45 0 y no SQR 25.966

46 1 y no SQR ≥ 30

Table 1.Test Results for A* vs A* Fast

The Table 1 must be explained:T.N. (test number),H

(heuristic),D(allow yes/no diagonals),F.P.(yes/no A*

Fast),F(formula),T(Time),y(yes),n(no),m(manhattan),M(x,y)

(Max(Dx,Dy)),D.S(diagonalshortcut),E(euclidean),SQR(Euclid

ean without square).First test run the fast A* algorithm and for

each formula the heuristic number was increased until the time

need for path calculation started to rise ,this was the moment

when the next formula was taken and the proces started

again.The second test run the exact procedure was applied but

with the classical A* algorithm.

4.2 Path Planning with the Pioneer robot.

Testing with the Pionner 2 robot Simulator[7] robot using

two unkwon environments.

The PathPlaning application used for testing the Pionner Simu-

lator was eveloped for handling partially unknown maps like

the two that will be further on preseneted.For these simulation I

used the C12 laboratory map.One time with 1 unknown

obstacle and the second time with 2 unknown obstacles each

time unknown for the simulator.These two obstacels were only

present in the Pioneer Map because the scope is to simulate a

real environment where the robot has to sense the world and

based on sensor readings to decide the further necessary

actions, like for example avoiding obstacles.

The map used in the path planning application is a 2D map

composed of squares wich in real life are of dimension 10x10

centimeters.The application can handle maps up to 10x10

meters.The path planning solution was completly developed in

java[8]programming language using the JNI (Java Native

Interface) ,the [11]Aria library .In order to simulate the two

maps the runs were needed for each of the two maps because

two different running modes were tested .The first one is called

fast mode and the second one slow mode[10].Fast mode

differes from slow mode in some action limiters that are not

added to the robot and also by chanching the parameter of a

action added to the robot which has a distance parameter set for

slow mode to 225 which represent millimeters and for fast mo-

de it is set to 50 millimeters, actually these tells the robot how

to interpret the data obtained from the ultrasonic sensors.

The obstacles ar represented by the boxes with two diagonal

lines inside them.It can be observed that the obstacles that

appear in the maps loaded in the Pioneer simulator are not

present in the PathPlanner application so the robot has to avoid

them in order to go to his final destination.For each of these

two maps the time will be determined.

Figure 3.The Path Planner map.

Fig 4.The First Pionner Simulator Map

Page 5: Mobile Robot Navigation on Partially Known Maps Usign the a Star Algorithm-muntean Paul i 2

Fig 5.The Second Pionner Simulator Map

Test run Fast Mode Map Time [sec]

1 Yes S.Map 40

2 No S.Map 45

3 Yes F.Map 61

4 No F.Map 47

Table 2. Test results for the path planner

5.CONCLUSIONS

The data obtained from the A* algorithm simulator shows a big

difference between the two variants of the A* algorithms.

The Fast A* algorithm allows to increase the heuristic number

for seven up to eight runs insteed the classic A* lets the an

increase up to value of three .

The shortest time is also obtained for the Fast A* algorithm

wich also shows that the performances of the classical A*

algorithm can be further increased in order to gain more speed.

It is recomanded for further research on these topic to use more

advanced variant of the A* algoritm like the bidirectional A*,

the IDA* algorithm or D* algoritm.

Regarding the results obtained from the simulation of the A*

algorithm on the Pionner Simulator the tests should be made on

more type of maps wich is not a problem since the Path Planner

application supports creation and importing of maps and so

does the Pioneer Simulator application.

The Table 2. Shows that when ussing the Fast mode variant of

the A* algorithm on the Second Map the time decreases with 5

seconds wich is not to be neglegted.

When simulating the same algorithm on the first map wich has

two obstacles the time increases because the range of the

sonars is reduced to 50 millimeters and so the obstacle is

detected later which ends in a recover actions needed to

recover the robot and so precios time is lost.

Since these application uses only data collected from ultrasonic

sensors it is recomanded to use sensor fusion and to adapt the

application to real applications which use a combination of

radar, GPS and laser sensors in order to offer to the mobile

robot a more precise description of the environment.

RERENCES

[1] Amit, Amit's Game Programming Information. http://www-

csstudents.

stanford.edu/~amitp/gameprog.html. (accessed 28

Jan.2008)

[2] Eklund, P.W., Kirkby, S. and Pollitt, S., 1996. A Dynamic

Multi-source Dijkstra' Algorithm for Vehicle Routing. In: N.a.

Jain (Editor), Conf. on Intelligent Information Systems,

Australian New Zealand.

[3] Jones, J.H., A* Tutorial.

http://www.geocities.com/jheyesjones/astar.html. (accessed 28

Jan.2008)

[4] Makanae, K. and Takaki, M., 2004. Development of the 3-

Dimensional Urban Spatial Data Model and Application to the

Pedestrian Navigation System. ITS .

[5] Nelson, P.C. and Toptsis, A.A., 1992. Unidirectional and

Bidirectional Search Algorithms. Digital Object Identifier, 9(2):

[6]. Siegwart R., Nourbakhsh Illah R., Introduction to Autonomous

Mobile Robots, Massachusetts Institute of Technology, 2004

[7]. Saphira Operations and Programming Manual Version 6.2, Mo-

bileRobotsROBOTICS, 1999

[8]. Konolige, K., K. Myers The SAPHIRA architecture: a design for

autonomy. In Artificial Intelligence Based Mobile Robots: Case Stud-

ies of Successful Robot Systems, MIT Press, 1998.[10] WiBox 2100

Quick Start Guide, Lantronix, 2004

[9] F. Lingelbach, “Path Planing for mobile manipulation using prob-

abilistic cell decomposition”.Inteligent Robots and Systems, 2004

(IROS 2004).Proceedings ,IEEE,vol3,pages 2807-2812,2004.

[10] J.Rosel and P.Iniguez “Path planning using Harmonic Functions

and Probabilistic Cell Decomposition”, Procedings of the IEEE Inter-

national Conference on Robotics and Automation ,pages 1803-1808,

[11] ActivMedia Robotics, Inc. Aria Reference Manual 1.1.10,

November 2002.

[12] The A* algorithm

.http://en.wikipedia.org/wiki/A*_search_algorithm