gullstrand gunnar 05164

Upload: iulian-alex

Post on 02-Mar-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/26/2019 Gullstrand Gunnar 05164

    1/42

    Obstacle Avoidance for a Mobile Robot

    GUNNAR GULLSTRAND

    Masters Degree ProjectStockholm, Sweden 2005

    TRITA-NA-E05164

  • 7/26/2019 Gullstrand Gunnar 05164

    2/42

    Numerisk analys och datalogi Department of Numerical Analysis

    KTH and Computer Science

    100 44 Stockholm Royal Institute of TechnologySE-100 44 Stockholm, Sweden

    GUNNAR GULLSTRAND

    TRITA-NA-E05164

    Masters Thesis in Computer Science (20 credits)

    at the School of Vehicle Engineering,

    Royal Institute of Technology year 2005

    Supervisor at Nada was Patric JensfeltExaminer was Henrik Christensen

    Obstacle Avoidance for a Mobile Robot

  • 7/26/2019 Gullstrand Gunnar 05164

    3/42

    ABSTRACTObstacle Avoidance for a Mobile Robot

    A notorious problem in mobile obstacle avoidance is the detection and avoidance ofobstacles. This thesis evaluates several well-known methods for controlling the motion

    of a mobile robot in an unknown dynamic environment. One of these methods, theGlobal Dynamic Window Approach, is selected and, using a laser range finder as the

    only range sensor, the method is implemented and tested on a mobile robot platform, aPioneer 2 from ActivMedia. The result showed that the method is indeed an effectiveway for detecting and avoiding obstacles in real-time, in out-door tests the robot has

    traversed obstacle courses at velocities up to 1.2 metres per second. The methodhowever showed to have some drawbacks; and should be combined with a higher-level

    algorithm that directs the robot to the best path.

    SAMMANFATTNINGHinderundvikning fr en mobil robot

    Denna rapport beskriver ett examensarbete utfrt vid Centrum fr Autonoma System,

    CAS, vid institutionen fr numerisk analys och datalogi vid Kungliga TekniskaHgskolan. Mlet med examensarbetet var att vlja ut och implementera en metod frhinderundvikning fr en mobil robot. Rapporten inleds med en bakgrund till robotik och

    sensorer. Drefter beskrivs ett antal olika metoder fr hinderundvikning. En av dessametoder, the Global Dynamic Window Approach, r utvald och testad p en av demobila plattformarna vid CAS. Resultaten presenterade hr visar att algoritmen r en

    bra metod till hinderundvikning, i tester gjorda utomhus har plattformen kt igenom enhinderbana i hastigheter upp till 1.2 meter per sekund. Resultaten i denna rapport byggerp att roboten anvnder en laser skanner som sin enda avstndsmtare, resultaten r inte

    ndvndigtvis samma som om andra sensorer hade anvnts. Tyvrr r inte metoden heltfullndad, i slutet av rapporten diskuteras hur den skulle kunna kombineras med ett

    beteende p hg niv som ger metoden anvisningar om t.ex. vgval.

  • 7/26/2019 Gullstrand Gunnar 05164

    4/42

    ACKNOWLEDGEMENTSA completed task is always preceded by a chain of events. All of which we are not incontrol or even aware of. Many actions have guided me towards completing this thesis.

    Some dating back to when my parents persuaded me to study when I was young andsome to when my thesis supervisor did the same a few years later. I cannot thank my

    family enough for the support and understanding. And I cannot thank my supervisorPatric Jensfelt enough for the hours of support and time to answer stupid questions.

    Without you the code would be nothing but a big segmentation fault and the thesiswould have to wait a few more years. I would also like to express my sincere gratitudeto Prof. Henrik I. Christensen and all the people at the Centre for Autonomous Systems.

    My time at CAS has been very pleasant and educational.

  • 7/26/2019 Gullstrand Gunnar 05164

    5/42

    PREFACEThis M.Sc. Project has been carried out at the Centre for Autonomous Systems (CAS),which is a research centre at the Royal Institute of Technology in Stockholm. The centre

    does research in autonomous systems including mobile robot systems for manufacturingand domestic applications [23]. CAS has several robotic systems and some of them are

    presented in short in the appendix.

    AssignmentIn mobile robotics one of the major areas of concern is how to control the robotsmovements, making the robot move without hitting any obstacles. The algorithmmaking these decisions is called an obstacle avoidance algorithm. The motivation for

    this thesis is to find a way to improve the obstacle avoidance algorithm that is in use atCAS. The current algorithm is built on a technique called the Vector Field Histogram, amethod that has several inherent drawbacks, probably most serious of these is that it in

    no way considers the dynamics of the robot. A new way of controlling the robots wasrequested and I was given free reins, I was to do a literature study on the obstacleavoidance and implement the method that I found would yield the best result.

    The title, Obstacle Avoidance for a Mobile Robot well defines what this thesis isabout, it is fairly easy to decide what is part of the thesis and what is not. Obstacle

    avoidance is however an important part of a robotic system, it is a big research field thathad its peak a few years ago and many theories and methods have been put forth. It isnot possible to present but a small subset of the different ideas here. The selected

    methods are however some of the more important ideas and studying them give a goodunderstanding of obstacle avoidance.

    The requirements that were put on the algorithm were that it should be fast, robust andnot dependent on prior information about the environment. It has to be fast for severalreasons, firstly because a fast algorithm lets the robot react to changes in the

    environment quickly. It also means that the robot will be able to drive at highervelocities. Low computation time also lets several processes run concurrently on the

    CPU so that the robot can do more things than just avoid obstacles at the same time.Naturally the algorithm and especially the implementation also have to be robust. It istrusted to manoeuvre an expensive robot in environments where people and other robotsare present so it must not fail, allowing the robot to collide. Nor can the algorithm

    depend on prior information since the surroundings can change quickly, furniture can bemoved and people walk about. This information is not present in any map so the robothas to decide as it goes where it can drive.

  • 7/26/2019 Gullstrand Gunnar 05164

    6/42

    TABLE OF CONTENTS

    1. Introduction ..................................................................................................... 11.1. Robot behaviour ....................................................................................... 11.2. Robot Architectures.................................................................................. 2

    1.3. Avoiding obstacles................................................................................... 3

    2. Sensors and Actuators...................................................................................... 42.1. Sensors .................................................................................................... 42.2. Actuators ................................................................................................. 6

    3. Representing the Environment.......................................................................... 83.1. Occupancy grid....................................................................... ................. 9

    4. Obstacle Avoidance ........................................................................................104.1. Potential fields ........................................................................................104.2. The Vector Field Histogram Method........................................................124.3. The Dynamic Window Approach.............................................................14

    4.4. The Global Dynamic Window Approach .................................................174.5. Conclusion..............................................................................................19

    5. Algorithm.......................................................................................................205.1. The Map .................................................................................................205.2. The NF1..................................................................................................215.3. The GDWA.............................................................................................22

    6. Experiments and Results .................................................................................246.1. The Map Size..........................................................................................246.2. The NF1..................................................................................................276.3. The GDWA.............................................................................................276.4. Outdoors.................................................................................................31

    6.5. Conclusions ............................................................................................32

    7. Summary and Conclusions..............................................................................33

    8. Future Work...................................................................................................34

    References..........................................................................................................35

  • 7/26/2019 Gullstrand Gunnar 05164

    7/42

    1

    1. INTRODUCTIONMobile robot systems currently available on the market vary from autonomous dust-busters and lawnmowers to pet toys. Prices can in many cases seem a bit off-putting but

    low cost robots have started to surface on the market and more will certainly appearwhen robots start to exist in our every day life. The range of applications where robots

    can be useful is vast, anywhere where it is too dangerous for humans, too demanding orjust too boring. In every robotic system the ability not to collide with objects but instead

    find an alternative path is not only central but also indeed a demand. Obstacle avoidancehas been a research field since the first mobile robots saw daylight but had its peak afew years ago.

    This chapter is an introduction to the field of robotics and in part based on the book

    Behavior-Based Roboticsby Ronald C. Arkin [2]. It gives a background to how we canbuild a system that lets a robot accomplish different tasks. In chapter 2 the sensors thatare most commonly put on a robot are discussed. As we will see, they have limitations

    to what they can tell the robot. No matter what sensor is chosen, the robot cannot getvery exact information about its environment. The key is to combine different sensorsand remember their limitations. In 3, Representing the Environment, we discuss how the

    sensor data should be used so that the robot can extract accurate and reliableinformation. Some of the effect that the imperfect sensors have can be limited byrepresenting the data in a clever way. Chapter 4 gets down to business and discusses thedifferent methods of obstacle avoidance covered in this thesis. The chapter ends with adiscussion of why the method selected was preferred. Chapter 5 describes theimplementation of the selected method at high level. In 6, Experiments and Results, the

    methods performance is examined in various tests both in- and outdoor. Chapter 7summarises the results and some of the things that could improve the robotsperformance but not covered in this thesis are discussed in chapter 8.

    1.1. Robot behaviourWhen we want to make a robot do something, whether it is fetching something or

    cleaning our room, it is the robot behaviourthat answers the what in what does ourrobot do. In a robotic system we usually distinguish between two types of behaviours,reactive and deliberative. In short, deliberative control has a high level of intelligence, ittries to model and understand the world. This makes the behaviour slow and

    susceptible to errors when the world is changed. Reactive control on the other hand doesnot try to understand anything, but simply reacts to sensor data. Reactive control istherefore very fast but lacks the ability to plan ahead and evaluate possible actions

    before execution. The two methods characteristics are outlined in Figure 1-1.

    Figure 1-1:Characteristics of reactive and deliberative control systems.

    Deliberative reasoningA deliberative system is something that plans ahead, it requires relatively completeknowledge about the world and uses this knowledge to predict the outcome of the

    various actions it can perform. A robot with the ability to grade its performance aheadof acting is able to optimise its behaviour, and, given that the algorithm is complete andoptimali, always choose the best course of action. There is however a big drawback todeliberative reasoning, it requires near perfect information about the environment,which is hard to obtain. In addition, any changes in the environment from the time whenthe information was acquired to when the plan is executed may result in serious error.

    iA completesearch algorithm will always find a solution if there is one, and an optimal

    algorithm always finds the best solution.

    DELIBERATIVE

    REACTIVE Time and space awareness

    Slower response

    High-level intelligence

    Representation free

    Fast response

    Low-level intelligence

  • 7/26/2019 Gullstrand Gunnar 05164

    8/42

    2

    As most worlds outside of a strictly controlled laboratory are highly dynamic, it may bedangerous to rely on information that is not updated frequently.

    Reactive controlThe idea of reactive control is that the robot system is not composed of functionalcomponents such as perception, learning, and planning, but behaviours such as obstacle

    avoidance, wall following, and exploration. In the simplest form a reactive behaviour isa stimulus/response pair for a given environmental situation. The behaviour is whatmaps a given situation to a specific reaction (Figure 1-2). A reactive behaviour does not

    represent time, space or objects internally, instead it works like a reflex. It would reactto a specific stimulus the same way no matter what time of day it is, where it is situatedand would not know the difference between a chair and a person. This is the view on

    cognition advocated by the branch of psychology called behaviourism, there is noconsciousness, and we have no choice but to react a certain way when we face a specificsituation.

    Figure 1-2: A simple stimulus-response diagram. A behaviour is the functionthat maps the stimulus to a response.

    Animal behaviour is often used as basis for the behaviours in a reactive robotic system.

    An example of this is the potential fields method described in chapter 4.1, where afrogs motion around obstacles and towards its goal (a box of worms) was used asinspiration for modelling a method for path planning. It is important to remember that

    animal behaviour is only used as an inspiration, not as a constraint. A reactive roboticsystem is built on several low-level behaviours that, when they interact with the

    environment, together can form a more complex and more intelligent system than thepieces by them selves. This effect is called emergent behaviour and may lead to

    unexpected results. An example of this is the Braitenberg Vehicles [15] that are verysimple in construction but still exhibit a seemingly complex behaviour. This is a majorreason why it is hard to simulate a robotic system, the world is simply to complex tomodel in a reliable fashion.

    1.2. Robot ArchitecturesA single behaviour by itself is not of much use to a robot. If the only thing it can do is

    avoiding obstacles it would do best by just standing still. To form a complex system welet several different behaviour modules interact. What modules we use and how theyinteract with each other are what defines the architecture of the robot. One can

    distinguish between three kinds of architectures, behaviour-based, hierarchical andhybrid [10]. Hierarchical architectures build on the principles of deliberative reasoningand with it comes all the poor flexibility and problems that arise outside of thelaboratory. On the other hand, behaviour-based architectures, which use reactive

    behaviours as building blocks, have speed and flexibility as advantages but suffer fromlack of structure and control. The currently adopted solution to the problems is to buildarchitectures that combine the two, getting the benefits of both while leaving their

    problems behind. A robot system of this type is called hybrid architecture, it usesreactive behaviours at the lowest levels and uses deliberative reasoning to control andswitch between behaviours so that it can achieve its goals. One system that uses the

    hybrid approach is the Intelligent Service Robot (ISR) project developed at CAS [1]. Itis successfully used on many different platforms for a wide range of tasks.

    Stimulus ResponseBehaviour

  • 7/26/2019 Gullstrand Gunnar 05164

    9/42

    3

    1.3. Avoiding obstaclesIn every mobile robotic system the skill to avoid obstacles is crucial. The robot must be

    trusted to complete its tasks without being a hazard to itself or other. The aim of thisthesis is to survey the field of obstacle avoidance, select a suitable algorithm andimplement it. The requirements that we have on the method is that it should be fast,robust and not dependent on prior information about the environment. Many methods to

    accomplish this have been put forth. They range from looking at a map and planningevery move in advance to wandering about randomly without any planning at all.

    Naturally none of these extremes are preferable in robotic systems that should bereliable and accomplish various different tasks in dynamic environments. Instead wewould like a method that would guide our robot the goal while still being able to

    quickly adapt to changes in its surroundings. One popular method for navigating therobot is to let the goal emit an attractive force and obstacles a repulsive force. By lettingthe robot get pulled along the gradient of the force field it will end up at the goal while

    avoiding obstacles. Problems with this approach include that there may be places wherethe force field cancel out, resulting in that the robot will stop, unable move in anydirection. Another important part of obstacle avoidance is to consider the dynamics of

    the robot. This may not be a problem for slow robots but even at the speed of a briskwalk we will have to take this into account. The robot cannot just stop; it has todecelerate until it has stopped. One method that considers the dynamics of the robot is

    the Dynamic Window Approach (DWA). It calculates the velocities that the robot canachieve and selects the one that will get the robot on the best path to the goal. Themethod is purely functional, i.e. it does not consider the world in any other way than

    what the sensors see at the moment. This has the drawback that it cannot plan far aheadand that the robot can get stuck in certain obstacle configurations. This can be avoidedby combining the DWA with a map over the environment, and using a local minima

    free search algorithm in it to find the path. This method is called the Global Dynamic

    Window Approach and was developed by Brock and Khatib [9].

  • 7/26/2019 Gullstrand Gunnar 05164

    10/42

    4

    2. SENSORS AND ACTUATORS

    2.1. SensorsIn order to act in an unknown environment, a robot needs to obtain information about

    the world. This information is given by different kinds of sensors, just like we humans

    use our five senses. The sensors can be divided into two groups; internal and external.The internal sensors measure the internal state of the robot. This can for example be

    wheel encoders, measuring the rotation of the wheel axes. Examples of external sensorsare cameras and radars. In the remainder of this section a brief presentation will be

    given of the most commonly used sensors for obstacle avoidance. In [12] a detaileddescription of sensors is given.

    Infrared sensorsThe infrared sensor works in the way that it sends out an IR-beam and measures theintensity of the reflected light. This makes the sensor highly material dependent. The

    reflected intensity can be several times bigger if the reflecting material is white plasticthan if it is black cloth. The infrared sensors are also typically characterised by a highly

    limited range, usually less then one metre. The latter drawback makes it impractical to

    use, but the first drawback makes it virtually useless in a dynamic environment since therobot can never know what type of material it is looking at. As a consequence of thematerial dependency, the information given by the infrared sensor cannot be used to tell

    the distance to an object, merely tell if there is one or not in a certain direction. Thereason for it being used at all is its low cost and very small size. For a small robot, suchas the Kephera robot, where size does matter, it often is the main sensor.

    Ultra-sonic sensorsThe ultrasonic sensor is the most used sensor type, and almost all mobile robots today

    are equipped with them. The ultrasonic sensor works like the sonar of a bat. A pulse ofsound is transmitted and the time until the reflection is received is measured. The

    distance to the reflecting object can then be calculated given the speed of sound. Themaximum range is typically less than ten metres in open air, in water the range of the

    sensor is greatly increased. Just like the infrared sensor, the sonar sensor highly materialdependent. Materials that are good sound absorbers limit the potential rangesignificantly. The sound beam of the sensor will propagate like a cone, see Figure 2-1,and any object located in this cone will reflect the beam. This makes telling the exactposition of the object hard. With a beam width of 25o, and a measured distance of two

    metres, the object can be anywhere on almost a metre wide arc. The wide beam is thusboth a pro and a con, it easily detects obstacles but it is hard to tell exactly where theyare.

    Figure 2-1:A highly simplified model of the sound beam of a sonar sensor.

    One great limitation of the sonar sensor is the effect called crosstalk. This happens whenone sensor receives the emitted beam from another sensor. This is due to that all of the

  • 7/26/2019 Gullstrand Gunnar 05164

    11/42

    5

    sensors use the same frequency for all transmitters/ receivers on the robot, which is thecase on most commercially available platforms. To be able to reliably measure thedistance to an object, it is necessary correctly associate the reflection with the correct

    transmission. A robot with many sonar sensors, see Figure 2-2, must therefore fire themsequentially, which limits the update frequency to around 3 Hz. Since most platformsuse the same frequency, the association problem also occurs when several robots act in

    the same environment.

    Figure 2-2: The sonar ring of a Nomad 200.

    Laser-range findersThe laser sensor works differently than the infrared sensor, it transmits a light beam andmeasures the time of flight instead of measuring intensity of the reflected ray. Thisremoves the problems of material dependency that exists in sonar and infrared sensors.The special characteristics of the laser and the intensity with which the beam istransmitted makes it possible for the sensor to measure long distances, typically 50 100 metres. Whereas the sonar sensor based system typically has an update frequency

    of 3 Hz, the laser sensor can provide data at 75 Hz. The angular resolution is also muchhigher resulting in a more accurately sampled environment.

    Figure 2-3: The LMS laser scanner from SICK.

    The main disadvantages of the laser scanner are the high cost (the sensor shown inFigure 2-3 costs around 40.000 SEK) and the fact that the information obtained from the

    sensor is limited to the plane where the sensor is situated, see Figure 2-4.

    Figure 2-4: The laser scanner gives information about the environment in aplane of 180

    o. This limits the object detection to objects within this plane.

    The laser also has a drawback that sometimes can lead to unexpected results. If the laserbeam hits the edge of an obstacle, cutting the beam in two, the returned distance can be

  • 7/26/2019 Gullstrand Gunnar 05164

    12/42

    6

    anywhere from the edge to the obstacle behind it. In Figure 2-5 this phenomenon isshown with a sketch and data from a real laser visualized in Matlab.

    Figure 2-5: The laser sensor can sometimes return false range-readings if thelaser beam hits the edge of an obstacle. The width of the laser beam in the figureis greatly exaggerated.

    In Test A, described in chapter 6, Experiments and Results, this effect influenced therobots behaviour each time the test was run, keeping it from choosing a direct pathtowards the goal.

    VisionVision is naturally one of the best methods of getting detailed information about theenvironment. It is however a nontrivial task to extract knowledge of obstacles and the

    connectivity of free space from an image. Nevertheless, since the late nineteenseventeens when the Stanfords Cart/CMU Rover used stereo cameras to navigateabout one meter every 15 minutes, computer vision made huge progress and is nowfully usable as an way of guiding mobile robots motion. Although vision is an important

    research field for obstacle avoidance, it is beyond the scope of this thesis to deal with it.

    2.2. ActuatorsMost robots have some kind of actuators that enable them to interact with theenvironment, it can be virtually anything that lets the Robot move itself or some object.Actuators that have the purpose of moving the robot (wheels, legs etc) are calledlocomotors and the ones that allow the robot to move something in the environment

    (arms, grippers, fork-lift etc) are called manipulators. This section will briefly mentionsome of the issues that have to be taken into account when dealing with wheeled robotssince steering capabilities are important to consider when selecting a motion command.

    Figure 2-6: The XR4000 from Nomadic Technologies is a platform that has

    holonomic steering.

    Holonomic steering

    If an object is non-holonomic it has limitations in the way it can move, the object canmove in some directions but not others. For example, a car that drives straight cannot at

  • 7/26/2019 Gullstrand Gunnar 05164

    13/42

    7

    once drive to the right, it has to turn for a while until it is headed in the new directionand then start driving straight ahead again. A holonomic system do not have thatrestriction, for example a human can instantly step to the right or left as well as go

    forwards or backwards. A system is holonomic if it has as many degrees of freedom ofmotion as the number of coordinates needed to specify its spatial. On a roboticplatform moving on a surface we need three coordinates to specify its location (x-

    position, y-position and orientation) thus it is said to be holonomic if it can drive in anydirection while simultaneously controlling rotational speed. A holonomic platform hasvery complicated design and they often suffer from other problems including vibrations,

    low ground clearance and poor odometry performance which can make them

    impractical to use [16]. An example of a holonomic robot is the popular XR4000 fromNomadic Technologies (Figure 2-6).

    Synchro DriveOn a synchro drive robot the wheels are configured so that they all rotate in the samedirection at the same speed. This results in reduced slippage since all wheels generate

    equal and parallel force vectors at all times [12]. Also, this configuration makes itpossible to steer and drive the wheel at the same time. The robot will then move alongan arch with a radius equal to the quotient of the rotational and translational velocity.

    An example of a robot platform that uses synchro-drive is the Nomad-200 (seeappendix).

    Differential steeringThe differential steering uses two independently controlled steer wheels, one on each

    side of the robot. The wheels cannot turn sideways, only rotate back and forth. Thisenables the robot to spin in place, rotating around its centre axis. The placement ofencoders on the wheel-axis gives very precise information on how far they have turned

    which gives information on velocity and distance travelled. Examples of platformsusing the differential drive include the Nomad SuperScout and the Pioneer 2 (Figure

    2-7).

    Figure 2-7: The Pioneer2 is a small synchro drive robot manufactured byActivMedia.

  • 7/26/2019 Gullstrand Gunnar 05164

    14/42

    8

    3. REPRESENTING THE ENVIRONMENTIn the case of the most common sensors for mobile robots, sonars, IR and laser, theinformation given to the robot is distance to the closest detectable obstacle in a given

    direction. This information, the raw sensory data, could be used to navigate the robotdirectly. We could build an algorithm saying, go towards the goal but not closer to any

    obstacle than one metre. There are some problems with this solution however. Firstly,the sensors are imperfect and will from time to time give inaccurate readings. By using

    raw sensor data the robot will be exposed to these errors and might make wrongdecisions. Secondly, if the robot does not remember the data, it will have no spatialinformation in the direction where it has no sensors. Turning the robot will result in

    loosing information of what the robot just saw. A probable result is that the robot sooneror later will get stuck alternating between two directions, unable to move. This is

    explained in Figure 3-1. A robot equipped with a 180-degree laser scanner has reachedthe end of a corridor. Unable to move further towards the goal the robot will turn left orright to detour the obstacle. At this position it will find the wall blocking its path and

    decides to turn directly towards the goal again.

    Figure 3-1: A robot can get stuck in a U-shaped obstacle configuration.

    To remedy this, the obvious solution is to let the robot remember the obstacles it hasencountered even if it does not look in that direction any longer. The robot needs to

    build a map over its surroundings. It is important to remember that this map cannot begiven the robot beforehand. It is not the blue print of the building that the robot needs,rather a newly updated scan of obstacles in its vicinity. Map building can be dividedinto two categories, grid-based and feature-based methods. Feature-based methods

    works by locating features in the environment and using them as known landmarks bywhich the robot can localize and continue to explore the world. A typical map could bea list of known features and their position. This is a compact way of describing the

    world and it is easy to search for features in it. The problem with this solution is thedifficulty of representing the world without the right features. If for example, the onlyfeature available is a line it will be very hard to represent a tree or a curved wall. We

    have to know beforehand what we are expecting to find in an environment. Grid basedmethods, on the other hand, does not try to extract features or identify anything in the

    world. Instead they work by putting a raster over the world and marking every cell inthe raster as either occupied or empty. This is a less complicated way of representingthe world but it has the drawback of being more memory demanding and it requires

    more computation time to keep it updated.

  • 7/26/2019 Gullstrand Gunnar 05164

    15/42

    9

    3.1. Occupancy gridProblems with trusting the sensory data right off is their inaccuracy, due to crosstalk and

    split beams, the sensors might report obstacles where there arent any. A method tominimize this problem is the method of occupancy- or certainty- grids, Moravec and

    Elfes [19] and Elfes [11]. It uses the technique described above to divide the world intoa discrete grid. Every cell is assigned a value that corresponds to the certainty that thereis an obstacle at the corresponding position in the environment. Initially all the cells are

    marked as unknown. Range readings are constantly taken from the sensors andoverlapping readings reinforce the probability that a cell is occupied. The areas betweenthe sensor and the occupied cells are considered empty with some probability. In thismethod many cells are affected by each reading through a complex distributionalgorithm. This results in long computation time. In fact, in the original proposal of this

    method the robot stands still while calculating the grid. When it is done it moves to a

    new location and re-computes the grid from this location. In [7] J. Borenstein and Y.Koren describe a method called the histogram grid. They show that a much simplermodel is sufficient if the grid is updated as the robot moves. Only one cell isincremented for each reading, and only the cells in line between the sensor and the

    incremented cell are decreased (marked as unoccupied). The movement of the robot

    result in that the grid will have a probability distribution that well corresponds to thereal world. These two methods and their difference are discussed in further detail in

    [22].

    Figure 3-2: In the histogram grid, only the cells on the centre axis are affected

    when a range reading is received. This approximation will only work when themap is updated as the robot moves.

    Using a histogram grid instead of occupancy grid greatly decrease the computation timeneeded. This and the simplicity of grid-based methods, it does not require understanding

    of the world, makes it widely used in obstacle avoidance algorithms. Also, as we willsee later, using a grid to represent the world facilitate the use of search algorithms thatcan be used to find a path to the goal even in cluttered environments.

    Returneddistance

  • 7/26/2019 Gullstrand Gunnar 05164

    16/42

    10

    4. OBSTACLE AVOIDANCEObstacle avoidance is a key component in any mobile robotic system. If we want oursystem to move about in the real world we have to consider that there are obstacles not

    represented in any a priori map. The obstacles can either be static as for example a tableor dynamic as a human or another robot. What we think of by obstacle avoidance is the

    ability to go from one place to another without running into things on the way. Thismeans that obstacle avoidance is tightly coupled with path planning, it is not exactly

    the same thing but they depend on each other so much that they often areindistinguishable. In general, there are two kinds of methods for obstacle avoidance/path planning, global and local. These build on the same ideas as the architectures

    mentioned earlier, a global obstacle avoidance algorithm requires a relative completeknowledge of the world and can compute the best path from start to goal offline. As this

    is practically impossible in a dynamic world (remember obstacles that are not in themap), the rest of this chapter will only concentrate on methods that relates to the localparadigm. These methods only consider what they see and act accordingly.

    4.1. Potential fieldsMany of the obstacle-avoidance methods are based on the idea of potential fields. The

    potential field is a way of representing a navigation space as the sum of stimuli thatsimultaneously affect the robot. In this method we treat goals as attractors and obstacles

    as repellors that exert an attractive or repulsive force upon the robot. For the goal, theforce is equal across the entire navigation space, no matter where the robot stands it canfeel the pull of the goal. For an obstacle, the force is only present in its immediately

    vicinity. The classic function used to calculate this force is the law of gravitation; theforce drops off with the square of distance between the robot and the object. For eachobject in the robots sensory range, a separate field is calculated using the potential

    function. These fields are then combined to yield a single global field. This is illustratedin Figure 4-1 to Figure 4-4; in Figure 4-2 only the goal is present, in Figure 4-3 anobstacle and in Figure 4-4 the goal and obstacle are combined. Path planning is simply

    carried out by letting the robot follow the gradient of the potential field.

    Figure 4-1: The potential function of a goal is here shown for the entire map.

    Usually it is only calculated for the position where the robot is located.

  • 7/26/2019 Gullstrand Gunnar 05164

    17/42

    11

    Figure 4-2: The same potential function as in Figure 4-1 is here shown in

    another way. Imagine a drop of water placed anywhere within the graph, itwould always find its way to the goal.

    Figure 4-3: Potential functions for obstacles are sometimes calculated using thelaw of gravitation, the repulsive force decline with the square of the distance.

    Figure 4-4:Potential function for the combined force fields of the goal and the

    obstacle. As can be seen in the figure, there is one saddle point where a robotcould get stuck.

  • 7/26/2019 Gullstrand Gunnar 05164

    18/42

    12

    A problem with the potential fields is the amount of time needed to compute the entirefield of forces. This is avoided by only computing the forces that act upon the position

    where the robot currently is located. This has the effect that no global path planning isconducted at all, the robot merely reacts to the objects in its vicinity, resulting in a veryfast method for obstacle avoidance.

    Unfortunately there are other problems with potential fields; Koren and Borenstein [17]identified some problems that are inherent to potential fields, i.e. they exist in allimplementations of the method. The problems are:

    Trap situations due to local minima.Trap situations can occur when the robot runs into a U-shaped obstacleconfiguration. The force towards the goal will at some point inside the obstacle beequal to the force pointing away from the obstacle. Since there are obstacles on the

    side of the robot as well, the robot cannot simply turn around the obstacle and willlikely be trapped. Trap-situations can be solved by global recovery, i.e. the robotneeds to recognise the situation and recover by backtracking its travelled path until

    it can find another way.

    No passage between closely spaced obstacles.This problem is similar to the previous one, if two obstacles are placed close toeach other, like a doorframe, the repulsive forces from each obstacle is combined

    into a single repulsive force that points away from the opening between theobstacles. The robot will then turn away from the opening even if the goal is on theother side.

    Oscillations in the presence of obstacles and in narrow passages.Borenstein and Koren also showed that the robot sometimes would oscillate in thepresence of obstacles. This could for instance show itself when the robot travels in

    narrow corridors. When the robot is travelling along the centreline between the twowalls, the motion is stable. If, however, the robot would drift closer to one of the

    walls it would be pushed back across the centreline by the repulsive force from theclosest wall. The robot would now experience a repulsive force from the other walland be pushed back across the centreline. This behaviour would then continue andthe robot would oscillate between the two walls.

    One implementation of the potential field approach is the Virtual Force Fieldmethod

    (J. Borenstein and Y. Koren [5]). Unfortunately it suffered from the problems listedabove and was soon replaced with the Vector Field Histogram method described in the

    next section.

    4.2. The Vector Field Histogram MethodAfter identifying the problems with potential field methods, Koren and Borensteincontinued their work by proposing a method that deals with the shortcomings of

    potential fields. In [6] they suggest a method for fast obstacle avoidance that they calltheVector Field Histogram (VFH). The method will only briefly be discussed heresince it is not immediately related to the algorithm studied in this thesis. It is, however,an important method for obstacle avoidance and therefore worth mentioning. It is also

    the method that is currently used at CAS.

    The VFH method uses the histogram grid described above to represent the environment

    in which the robot travels. This makes the map fairly accurate even when the robot isequipped with sonars. The contents of each cell in the histogram grid is treated as anobstacle vector, the direction of the vector is the direction from the current position of

    the robot to the obstacle. The magnitude of the vector is given by a formula thatconsiders both the certainty value of the cell and the distance to the cell (note that with a

    certainty value of zero the magnitude of the obstacle vector will also be zero).

  • 7/26/2019 Gullstrand Gunnar 05164

    19/42

    13

    Next, the area surrounding the robot is divided into a number of equal sectors. In eachsector the obstacle vectors of that sector are summed together to give thepolar obstacledensity (POD). In Figure 4-5 a typical robot environment and the resulting polar

    histogram is shown. As can be seen in the figure, a sector with a high POD, a peak,corresponds to obstacles nearby and low POD, a valley, corresponds to low obstacledensity. In the figure of the environment, the sectors with high POD are marked as

    black, these sectors are unsafe for travel. Any valley with a POD below a certainthreshold is considered safe and a candidate for travel. If there are more than onecandidate valleys, the algorithm selects the one that most closely matches the direction

    to the target. Within this valley the sector that is mostly aligned with the target headingwhile letting the robot keep a safe clearance from obstacles is selected for travel.

    Figure 4-5: The living room at CAS as the robot sees and the resulting polar

    histogram. The sectors marked as black around the robot corresponds to thepeaks in the polar histogram. These sectors are unsafe for travel and notconsidered when choosing motion direction. The x in the lower left corner of the

    map represents the goal. As can be seen the robot cannot head directly towardsit.

    Experimental results of this method showed that most of the time the robot travelled atits maximum speed (0.78 m/s) without having to stop in order to calculate a safe path.The speed was only reduced when an obstacle was approached head-on. During these

    experiments, a 20-Mhz 80386 computer ran the VFH algorithm [6].

    There are, however, some severe problems with this method.

    Dynamic constraintsA thing that all the previously described systems have in common is that they all

    fail to take into account the dynamic constraints imposed on anything with a mass.A robot moving in full speed simply cannot make a 90-degree turn. Even if it doesnot fall over, it certainly will not stay on the calculated curvature. Nor can it stop at

    once if an obstacle suddenly appears in front of it, the laws of dynamics will keep

    the robot moving even if the wheels stop turning. In [21] the VFH method isaugmented by taking the dynamics into account. The dynamic constraints imposedon the robot will block some of the sectors that were marked as free for travel in the

    original method.

  • 7/26/2019 Gullstrand Gunnar 05164

    20/42

    14

    Parameter settingsAnother severe problem is the parameter setting, this is a problem that most

    algorithms have to deal with. In the VFH method the threshold that determineswhen a sector is save for travel defines the behaviour of the robot. A too lowthreshold will make the robot unable to move in the presence of obstacles, whereas

    a too large threshold will make the robot bump into the obstacles. What makes

    setting this parameter difficult is its lack of an intuitive interpretation.

    As a response to the problems mentioned above, Bauer et al [4] introduce what they callthe Steer Angle Field approach. Later on two similar methods were suggested, the

    Curvature-Velocity Method [20]and the Dynamic Window Approach(DWA) [13].In this thesis, the DWA is presented in more detail.

    4.3. The Dynamic Window ApproachSince no platforms are truly holonomic (see chapter 3) there are limitations as to whichvelocities the robot can achieve. The dynamic window approach is specially designed todeal with the dynamics of the robot by only considering those velocities. In the

    description that follows we will use the tuple (, ) to represent the velocity of the

    robot. Here is the translational velocity and is the rotational velocity. Furthermore,only those trajectories that can be decomposed into circular arcs will be considered.

    When the robot is moving with a constant velocity, (, ), it describes a circular motion

    with the radius /, see Figure 4-6. When is zero the robot travels on a straight line,this is a special case that has to be dealt with.The task at hand is to determine the bestvelocity at each point in time given kinematic and dynamic constraints of the robot and

    information about the surrounding environment.

    Figure 4-6: The radius of a trajectory is given by the quota of the translationaland rotational velocities.

    Pruning the Search SpaceFinding the best velocity can be formulated as an optimisation problem of enormouscomplexity. To make the optimisation feasible, only a discrete set of velocities areconsidered. The outer bounds of this set are defined of the maximum velocity

    ( maxmax , ) of the robot. To further prune the search space, velocities that are unsafe,

    i.e., leading to a collision, are marked as non-admissible and discarded from furthercalculations.

    The Dynamic WindowTo take the dynamics into account and also reduce the search space, only thosevelocities that can be reached within the next iteration, given the current velocity, areconsidered. These velocities form the so-called Dynamic Window. The size of the

    dynamic window is determined by the maximum acceleration ( maxmax ,&&v ).

  • 7/26/2019 Gullstrand Gunnar 05164

    21/42

    15

    OptimisationIn essence, DWA combines three different behaviours (objectives) by a voting scheme.The different behaviours favour heading to goal, largedistance to obstaclesand high

    velocities. The behaviours grade each velocity in the dynamic window according to itspreferences. The best velocity is given by maximising the following function over theset of possible and admissible velocities.

    ),(),(),(),( vvelvdistvheadvG ++= Equation 4-1:The objective function of the DWA.

    The parameters a , and define each objectives influence on the overall behaviour.For example, choosing a large alpha make the robot more inclined to move directly

    towards the goal.

    Heading to goal

    The objective, heading (, ), grades a speed tuple by how well the robot will bealigned with the heading to the goal if choosing that speed. The value of the function is

    given by calculating where the robot will be in one time step if choosing a velocity andthen apply maximum decelerations, see Figure 4-7. The angle to the goal from the

    robots calculated position, represented by , is the measurement of how good the tupleis from the headingspoint of view, but since the value for conformitys sake should

    return a greater value the better it is, the heading(, ) is given by 180-||.

    Figure 4-7: is calculated as the difference between the robots heading in onetime step and the angle towards the goal.

    Distance to obstacles

    The function dist (, ) grades the tuples by calculating the distance to the closest

    obstacle on the curvature defined by /. This behaviour favours velocities that willkeep the robot far from obstacles. The distance is only measured on the trajectory therobot moves, side-clearance is notconsidered. If no obstacle is found, this value is set toa large constant.

    Velocity

    The objective velocity (, ) is proportional to the translational velocity, , and thusprefers higher translational velocities over slower. This objective will keep the robotmoving instead of just looking towards the goal, as would be the case if this were set to

    zero.

  • 7/26/2019 Gullstrand Gunnar 05164

    22/42

    16

    SmoothingAfter the objective functions have been calculated they are normalised to [0, 1] and

    weighted with the three constants a, and . When the objective function iscalculated for all the admissible velocities for the entire dynamic window, it issmoothed in order to keep the robot from choosing velocities close to none-admissible

    ones. This increases the side-clearance of the robot.

    The Holonomic Dynamic Window ApproachA motion planning algorithm for holonomic robots have to consider their special

    manoeuvrability (refer to chapter 3). In [9] and [8] the Dynamic Window Approach isextended to holonomic robots. The biggest difference between the original DWA andholonomic DWA is the search space since a holonomic robot has no limitations on the

    direction of instantaneous acceleration. As in the DWA the search space is the set of allpossible velocities. Using a dynamic window, which consists of the velocities that areachievable by the robot at a given time, further restricts the search space. Using a polardiagram (Figure 4-8) this results in a circular search space and a circular dynamicwindow.

    Figure 4-8: The Search space and the dynamic window for the holonomic

    dynamic window approach is circular due to that the motion capabilities of aholonomic robot. The light shaded areas in the figure are admissible velocitiesand the dark areas are velocities that lead to collision with an obstacle.

    The objective function of the holonomic DWA is similar to Equation 4-1, a motion

    command is parameterised into the velocity vector ),( xxvv =r

    and the acceleration

    vector ),( yx aaa=r

    . These are selected from the search space by maximising the

    objective function in Equation 4-2.

    ),,(),,()(),(),,( avsgoalavsdistvvelvsalignvs rrrrrrrrrrrr

    +++= Equation 4-2: Objective function of the Holonomic dynamic window approach.

    The main difference from Equation 4-1 is the function ),,( avsgoal rrr

    . It is defined as 1

    if the path crosses the goal otherwise it is 0.

    Dynamic window

    current velocity

    xv

    yv

  • 7/26/2019 Gullstrand Gunnar 05164

    23/42

    17

    4.4. The Global Dynamic Window ApproachAs the DWA has no information about the connectivity of the free space it is, just like

    the potential field methods, susceptible to local minima. Brock and Khatib [9] suggest amethod for obstacle avoidance, theGlobal Dynamic Window ApproachGDWA, whichextends the DWA and the Holonomic DWA with a simple motion-planning algorithm,

    i.e a function that finds a collision-free motion from the start configuration to the goalconfiguration. The motion-planning algorithm is fast enough to be computed in eachiteration of the control-loop, which allows the robot to react in real-time while still

    using a global planner.

    Free space connectivityIn order to plan a path in the environment, it has to be modelled in some way so that therobot can extract information about the connectivity of the free space from the model.The GDWA does not use a priori knowledge of the environment but samples it, using

    the robots sensors, and fuses the sensor information into a occupancy grid. Eachreading from the sensors is treated as a point in R

    2that contain an obstacle. The data is

    translated into configuration space by expanding the obstacles with the radius of the

    robot. This means that the robot can be represented as a point and this makes the path

    planning much simpler, if there is an unoccupied cell, then the robot will fit in it. Thisapproach assumes that the robot is circular, otherwise another method should be used.

    Navigation functionThe idea of a navigation function is to find the best path from the robot to the goal. The

    best path is here defined as the shortest path, which is not necessarily the same as thefastest path. The GDWA uses the global, local minima free navigation function NF1

    [18] to search the configuration space for the shortest path. This is done by calculatingthe Manhattan distance (moving like the tower in chess, not diagonally) from the goal

    cell to the robot. A formal description of the NF1 can be found in Algorithm 5-1, but inshort it works like this; Start by initiating all cells to a large value and give the goal cellthe value 0. Give every 1-neigbour of the goal that is in the free space the value 1.

    Continue by giving each cell in the free space their parents value plus one until there

    are no cells left. All the C-space obstacles will now have the value that all cells wereinitiated with while all cells in the free space will have their L1value to the goal. An

    example of this can be seen in Figure 4-9 and Figure 4-10. A problem with the NF1 isthat it grazes the C-obstacles. This is avoided in GDWA by only selecting motioncommands that give the robot a minimum clearance to the obstacles.

    As the occupancy grid is recomputed in every cycle of the control loop, new obstaclesadded and old removed, the NF1 needs to be recomputed as well. This would be very

    costly if the NF1 was computed for the entire occupancy grid but the GDWA uses adifferent approach. The NF1 is only computed in a rectangle aligned with the goalheading. If the algorithm finds that there is an obstacle blocking its path, the width of

    the rectangle is increased until the robot is reached by the search front.

  • 7/26/2019 Gullstrand Gunnar 05164

    24/42

    18

    Figure 4-9: The figure shows a small discrete grid-map of 10x10 cells. Theblack cells in the map are obstacles and the goal cell is marked with a G.

    Figure 4-10: This figure shows the Manhattan distance from the goal to everyother cells in the map. The goal obviously has zero distance to itself so it is

    labelled 0 and the obstacles are not calculated so they have a large value that is

    guaranteed not to be reached by any cell in the free space. A path from any cellto the goal is calculated by going to the cell with the smallest value that is

    adjacent to the current. When using the NF1 as a path-planning algorithm it isimportant to consider that the path will cut corners of obstacles.

    Objective functionAs in the dynamic window approach the GDWA uses an objective function (Equation4-3) to choose between all the possible moves it can make. It is in large parts the same

    as for the DWA but with an important difference, the addition of a global navigationfunction.

    ),,(1),,(),,()(),(1),,( avsnfavsgoalavsdistvvelvsnfavs rrrrrrrrrrrrrrr

    ++++=

    Equation 4-3: The objective function of the GDWA is slightly modified fromthe holonomic dynamic window approach.

  • 7/26/2019 Gullstrand Gunnar 05164

    25/42

    19

    The function ),(1 vsnf rr

    replaces the function ),( vsalign rr

    from the holonomic

    dynamic window approach. The function is used to align the robot with the heading tothe goal. Not the straight line to the goal but the path that nf1 found in the navigation

    function. The value of ),(1 vsnf rr

    is calculated by comparing the value of the nf1 at the

    cells that are adjacent to the robots position. Also the function ),,(1 avsnf rrr

    is added

    to the objective function. It indicates how much a motion command is expected toreduce the distance to the goal in the next iteration. Since the nf1 is not computed forthe entire grid, there is a possibility that a motion command would bring the robot out ofthe computed region. In this case the GDWA uses the smallest potential value along thattrajectory.

    4.5. ConclusionThe requirements we have on the obstacle avoidance algorithm are strict. In order of

    importance they are; no collisions, do not stand still, and high velocity. Naturally, noobstacle avoidance algorithm should collide. This puts high demands on accuracy andspeed of detecting new obstacles. Nor should the algorithm let the robot stand still ifthere is a path to travel. Only if every possible path is blocked should the robot stop.

    This also requires that the map is accurate and prevents many simplifications. If therobot is oval it should not be modeled as a circle, since these extra few centimeters

    could be what allow it to travel a narrow path. The robot should also be allowed totravel as fast as possible. The velocity might be restricted for several reasons, but whenit is possible to travel fast, it should not be the quality of the obstacle avoidance

    algorithm that restrains the velocity. This puts demands on the choice of algorithm aswell as requires that we trust the map to be accurate.

    From the discussions in this chapter it should be clear that the GDWA is the bestmethod of the ones described. It also satisfies the demands described above. By usingthe histogram grid for mapping it is fast and reliable in detecting dynamic obstacles.Rightly implemented it prevents collisions since these velocities should be marked asnon-admissible. It does not stand still if there is some path that is non-blocked since

    high velocity is one of the objectives of the function. Lastly, in tests done, both in thearticles referenced above and in this thesis, it has proven to be able to navigate obstaclecourses traveling as fast as the platform allow. Based on these conclusions, the GDWAis chosen to be implemented and further tested.

  • 7/26/2019 Gullstrand Gunnar 05164

    26/42

    20

    5. ALGORITHMThis chapter describes the GDWA in further detail. It does not cover the theoretical parsof the algorithm, rather it discusses on a high level how the algorithm was implemented.

    The solution that is presented here is, in the parts not described above, the authors ownsolution to how the GDWA should be implemented. The technique explained in this

    chapter does not necessarily match what is described in the original proposal of theGDWA.

    The algorithm consists of tree distinct parts that can be handled and described by themselves. The first is building the map. It is of necessity tightly coupled with obstacle

    avoidance so therefore it is included here. The second part is calculating the NF1. Itcould easily be included in the map algorithm but for modularitys sake it is an

    independent component. The last but most complex part is calculating the actual motioncommand, the GDWA algorithm.

    5.1. The MapThe map uses the technique histogram grid (chapter 3.1) to merge sensor data and

    represent the world. The map is always centred on the robot. Whenever the robotmoves, the map moves with it to centre on the robots new position. For simplicity the

    map is always aligned with the heading that the robot started in. The x-axis of the mapwill always be zero degrees in the odometry coordinate system. Moving the map has thedisadvantage that objects in the map disappear as the robot moves away from it. The

    robot looses information that could have been used for path planning. On the otherhand, it has the advantages that the map can be fairly small since the robot never willreach the end of it. A smaller map obviously saves computation time and memory

    usage. Nor is the loss of information a big problem, the map is not meant to be used forother things than obstacle avoidance. The data must be fresh and what the robot saw afew metres away might be out of date.

    After the map has been moved to its new position, new data is added to it. Since the

    data that arrives are on the form distance and heading, it has to be translated to themaps coordinate system. The parameters to consider when adding laser data are shownin Figure 5-1 and the necessary calculation are shown in Equation 5-1. For sonar datathe calculations are similar but the sensors are positioned in different ways. The cell

    found to be blocked gets its probability value updated. Depending on how big value isassigned it is considered more or less likely that it actually contain an obstacle. Thisvalue is different depending on what sensor that reports the obstacle. The laser is fairly

    accurate and has a narrow beam so it is trusted more than the sonar. When a cell isupdated it is quite safe to assume that there are no obstacles between the sensor and thenewly updated cell. These cells get their probability value slightly decreased. The

    sensors cannot remove each others obstacles, however. The sensors are usuallymounted on different heights and therefore see different things, so the obstacles canonly be removed by the sensor that added them.

    After the map is moved and obstacles are added, the map is aged. Every obstacle in themap has its probability value decreased. The obstacles that the robot constantly sees will

    not be affected since the ageing parameter is less than the adding parameter. It onlyaffects the obstacles that the robot cannot see anymore. It was added so that a robotconfined by obstacles should return to previously blocked places after a while to look

    for new openings.

  • 7/26/2019 Gullstrand Gunnar 05164

    27/42

    21

    Figure 5-1: The parameters that has to be considered when calculating the worldcoordinates of an obstacle from the distance and direction that is given by a laser

    scan.

    Rdy

    R

    d

    x

    ))2(sin()sin(

    ))2

    (cos()cos(

    +++=

    +++=

    Equation 5-1: Formula used to calculate the x and y coordinates of an obstaclefrom the distance measured by the laser and the current angle of the laser ray.

    Note that the robot coordinates are not used here since the map is always centredon the robot.

    5.2. The NF1The next step is to extract information about the connectivity of the free space from themap. This is done using the simple navigation function, NF1. It computes the L1

    distance from the goal to every other cell in the map. Computing the whole map is

    feasible since it is of comparatively small size. Algorithm 5-1 expresses the NF1formally. The algorithm is of linear time and space complexity with the number of cells

    in the occupancy grid.

  • 7/26/2019 Gullstrand Gunnar 05164

    28/42

    22

    Algorithm 5-1:Formal expression of the Simple Navigation Function, NF1, as

    found in [18].

    5.3. The GDWAAs described, the GDWA constitutes of five objective functions, heading, velocity,

    distance, nf1 and goal. These grade each velocity tuple achievable by the robotaccording to their idea of how the robot should move. The tuple that got the highestoverall grade is the one that is used for the robots next motion command.

    Distance to obstaclesSince the obstacles are transformed into configuration space it is possible to representthe robot as only a dot. This greatly simplifies the calculations in this objective, distance

    to obstacles. It grades each velocity tuple by how far it will take the robot before it hitan obstacle. Longer distance obviously results in better grade. Every velocity tupleforms a specific trajectory that the robot will follow. It is calculated as the absolute

    value of quota of the translational and rotational velocities, e.g. r = abs (, ), see

    Figure 4-6. The case where there is no rotation speed (= 0) results in an infinite radius(the robot is travelling straight ahead) and is treated as a special case. After the radiushas been calculated, it is easy just to step along the trajectory to see weather there is anobstacle in its path. The search is carried out until either an obstacle is found or themaximum length of search is reached which is the distance from the robot to the end of

    the map. The resulting value is normalized to the interval [0, 1] by dividing with themaximum length of search. The result is the grade that this objective gives this tuple.

    Heading to goal.

    Since it is not the currentvelocity that is to be evaluated, but one that might be chosen,the heading objective simulates forward one time step for each possible speed-tuple to

    see where the robot will be in one time step if choosing that speed. This new position [x,

    y, ] is then evaluated with respect of heading towards the goal. To evaluate, not theactual heading but the heading relative to the path that nf1 calculated, the value of the

    nf1 is checked at the neighbours of this cell. The robots current heading () iscompared to the angle from the robot to the cell that had the least nf1 -value. If thevalues where checked at the cells closest to the robots (possible) position, the anglewould be in steps of 45 degrees (360 degrees / 8 cells). This would result in an un-smooth behaviour where the robot would alternate between different steer-angles 45degrees apart. To get a more smooth behaviour the gradient of the nf1 is computed afew cells away, currently the distance is 3 cells and if the robot suddenly chooses a new

    steer angle, it is most often only 15 degrees away (360 degrees / 24 cells). The robots

    heading towards the nf1-path is normalized to the interval [0, 1] (by dividing with the

    Definitions

    C The configuration space

    GCfree The free cells in the occupancy grid

    Li List of configurations. Initially empty

    q A cell in the occupancy grid

    U(q) Value of the potential function for the cell q

    Algorithm

    for every qin GCfreedo U(q)M; [M is a large number]U(qgoal)0; insert qgoalin L0;for i= 0, 1, .. until Liis empty do

    for every qin Lidofor every 1-neigbour qof qin GCfreedo

    if U(q) = M thenU(q)i +1;insert qat the end of Li+1;

  • 7/26/2019 Gullstrand Gunnar 05164

    29/42

    23

    biggest possible angle towards the goal; 180 degrees) and subtracted from 1 (0 angle togoal is better that 180). The result is returned as this objectives value on the speeds.

    Delta nf1An important consideration when choosing speeds is, obviously, to choose a tuple thatbrings the robot closer to the goal. When computing the heading to goal objective, there

    might be velocities that bring the robot very aligned with the heading of the nf1 path,but at a position further away from the goal than another velocity might take it. This iscompensated for by calculating the difference of nf1 between the robots current

    position and the one it will reach in one time step if choosing a certain tuple. This valueis normalized [0, 1] by dividing it with the greatest value found in this iteration.

    VelocityThe last of the objectives is the velocity. This is simply the translational velocity (v)normalized to [0, 1] by dividing with the maximum allowed velocity. This seems to

    mean that the robot always favours high velocity over slower, which is true, but thehigher velocities are not always admissible. When the distance to obstacle objective hasbeen calculated, the distance is compared to the breaking capabilities of the robot. If the

    speed in question is so big that the robot will not be able to stop before reaching the

    obstacle on the corresponding trajectory, it will be set to non-admissible. It is importantto notice that, since the maximum length to search for obstacles is limited by the size of

    the map, the map size has influence on the maximum admissible velocity. The set ofvelocities are further pruned with respect to obstacle clearance. Once in each iterationthe distance to the closestobstacle (in all directions) is considered and the maximum

    allowable speed is set linearly so that if the obstacle is very close, the speed is highlyreduced, and at a distance of one metre, the obstacel is ignored (max speed allowed).This is not part of the original GDWA proposition made by Brooks, but was added

    partly to reduce the risk of hitting obstacles and partly to keep humans from gettingscared by a fast moving (seemingly out-of-control) robot.

    Objective functionAfter the different objectives have been calculated, the objective function of the

    dynamic window is calculated. It is simply computed by adding together the valuesfrom the objectives.

    ),(1),(),(),(),(1),( nfgoaldistvelnf ++++=

    Equation 5-2: The implemented objective function differs somewhat from theoriginally suggested method. This is mainly because the original is based on the

    Holonomic Dynamic Window Approach.

    Each of the objectives has a relative importance that is set by multiplying them with aconstant (see formula). By changing these values, the robot shows different behaviours,for further discussion on this subject, see the Experiments and Results chapter.

    Finally

    When the objective function has been calculated it is smoothed to keep the robot fromchoosing velocities close to non-admissible ones. The dynamic window is now fully

    computed for this iteration. It is searched and the cell that has the highest grade isselected and returned as the velocity command for the robot.

  • 7/26/2019 Gullstrand Gunnar 05164

    30/42

    24

    6. EXPERIMENTS AND RESULTSAlthough the program has been tested on several different machines, the tests in thischapter were made on the robot called Harry, a Pioneer2 DXE from ActivMedia. This

    robot is equipped with an 800MHz AMD-K6 processor, 128 MB of RAM and a SICKLMS laser scanner.

    Although the program is implemented as modules these are not easily tested by them

    selves. For example does a change in map size not influence the performance of themap object a lot but has a great influence on the computation time of the NF1 object.Because of this, the tests in this chapter will be to look at how the whole system reacts

    to certain changes. The system will be tested with regard to computation time, memoryusage, parameter settings and overall performance. The time requirement on the system

    is that it shall calculate a motion command well within the 200 ms that the SICK takesto send new laser data. The goalis that the computation time shall not exceed about 50ms. If this limit can be reached, it allows for several processes to run concurrently and

    they all can still be done before new data arrives. The performance requirement is thatthe velocities shall be computed so that the robot drives fast, smoothly and particularly,safe.

    6.1. The Map SizeThe size of the map obviously affects the speed of computation. Not only does a biggermap fit more of the robots surroundings so that more obstacles are added, but also theNF1 will take longer time to compute since that is done for the whole map. Increasing

    the map size also influence the GDWA since it allows for higher velocities when it canplan its path further, and longer trajectories results in more check for obstacle alongthem.

    The influence that the map size and resolution has on the system is measured by movingthe robot between two points in a corridor. The course does not include any obstacles in

    the robots path, but there are lots of objects on the side of the corridor that has to beinserted into the map. As mentioned above, computation time must be less than 200 ms

    but we would like it to be not greater than 50 ms. This test is carried out once for eachsetting of the map that we wish to examine. Every time that the map is recomputed thetotal computation time of the motion algorithm is saved onto a file. The result is showedin Table 6-1and figures Figure 6-1 to Figure 6-5.

    Dimensions Mean time of computation (std deviation) [ms]

    Size Res. Map NF1 GDWA Total

    50 50 0.25 (0.04) 0.88 (0.03) 0.77 (0.13) 1.65 (0.14)

    50 100 1.92 (0.63) 0.84 (0.25) 2.40 (0.66) 3.24 (0.76)

    100 50 3.94 (1.52) 4.13 (2.42) 5.59 (4.03) 9.71 (4.91)

    100 100 8.31 (4.71) 5.67 (6.56) 9.39 (5.78) 15.06 (8.86)

    150 100 14.96 (12.64) 17.65 (18.26) 15.97 (13.29) 33.61 (23.34)

    200 50 30.99 (29.96) 34.28 (30.00) 33.13 (31.11) 67.41 (44.43)

    200 100 21.47 (20.11) 32.23 (22.78) 22.60 (20.47) 54.83 (33.33)

    250 100 33.83 (27.87) 69.62 (36.51) 34.91 (27.96) 104.53 (45.43)

    Table 6-1: Computation time of the system with different map configurations.The size column is actually the square root of the map size, a size of 100 means

    that there are 100x100 cells in the map.

    Several things can be read from Table 6-1. Firstly, a larger map size obviously increases

    computation time. At first glance it does not seem to be a linear relationship but since amap size of 100 actually means that there are 100x100 cells in the map the computationtime increases linearly with the number of cells. The next observation to be made from

    the table is about the resolution of the map. The resolution is the square root of the area

  • 7/26/2019 Gullstrand Gunnar 05164

    31/42

    25

    (mm2) in each cell, a resolution of 100 means that the area of each cell is 10 000 mm

    2.

    This also seems to influence the computation time but not straight forward. The naturalway of arguing for how the computation time changes with the resolution is that a larger

    resolution results in a larger map which fit more obstacles which then takes longer timeto compute. This is true for most cases but in the example above the computation time isless with the map size [200, 100] than with [200, 50]. Since the test was carried out in a

    corridor it is likely that all the obstacles that could be seen fit in both maps and thedifference in computation time is normal variation. From the table we can also see thatthe standard deviation is quite large and that it increases fast with an increase in map

    size. This is due to two things, obstacle density and the scheduler of the operatingsystem. The obstacle density influence the deviation with that a large map takes longtime to compute when its full, when it is empty however, it does not take longer time to

    compute than a small. This means that the computation time for a large map variesgreatly with obstacle density. Because of the long computation time, a large map is alsomore likely to be interrupted by the operating system than a small. Since this test is

    measured against a clock from start of calculation to finish, this shows in the result evenif the CPU didnt spend the whole time calculating the next velocity command.

    Figure 6-1: Computation time of the motion algorithm with a map size of [50,100] (the number of cells is 50x50 and the cells are 100x100 mm

    2).

    Figure 6-2: Computation with a map size of [100, 100]. The mean computationtime is about 15 ms.

  • 7/26/2019 Gullstrand Gunnar 05164

    32/42

    26

    Figure 6-3: Computation time with a map size of [150, 100]. The meancomputation time is about 33 ms.

    Figure 6-4: Computation time with a map size of [200, 100]. The meancomputation time is about 54 ms.

    Figure 6-5: Computation time with a map size of [250, 100]. The mean

    computation time is about 104 ms.

    From the figures Figure 6-1 to Figure 6-5 it is plain that the biggest map that can beused and still have a computation time that mostly is below 50 ms is [100, 100]. Thedistance from the centre of the map to the edge is at least 5 metres and a resolution of

    0.1x0.1 square metres.

    The map size is also of importance when the robot needs to detour obstacles. Enlarging

    the width of the map can help the robot avoid trap situations. There is a problem intesting this however, every time the map is large enough for one course setting, it can beshown to be too small to single handily solve another configuration. Map dimensions of

    [100, 100] has shown to be sufficient to let the robot find its way in a normal indoorenvironment.

  • 7/26/2019 Gullstrand Gunnar 05164

    33/42

    27

    6.2. The NF1As described earlier, the robot represents the free-space connectivity of its environment

    by calculating the L1distance of every cell to the goal cell.

    Calculating the L1 distance is a very simple operation, despite this, to calculate theentire map of maybe 200x200 elements, a large portion of the CPU time is required. In

    the original proposition of the simple navigation function [18] which is the oneemployed in this work, NF1 is computed for the entire occupancy grid, but since theNF1 is recomputed each time new sensory data is available, this is not necessary. InBrocks solution the NF1 is only computed in a rectangular region aligned with the goalheading. If an obstacle blocks the path to the robot position the width of the region isincreased until the robots position is reached by the wave front. This approach can save

    a lot of computation if the map is sufficiently large so that the extra overhead ofchecking whether a cell is within the rectangular region or not can be ignored. Furthertests are needed to see for what sizes of the map it is justified to use this approach.

    6.3. The GDWA

    In this section the main questions are how the constants, a , , , and , should be set

    in order to maximize the robots performance. Recall from previous chapters that adetermines the importance of the heading objective, regulates the velocity, distance

    to obstacles, goal and the delta nf1 objective. By choosing different values of theparameters the robots overall behaviour changes drastically. Two tests were conductedin order to see how the parameters should be weighted for the robot to behave in anoptimal way. To minimise the number of tests only the values of the three constants a , and ? are tested. These are assumed to be hardest to find correct values for and they

    can be compared to values already suggested by Fox in [14] which are = 4.5, = 0.8,

    = 0.5. The values for the last two objectives are set to 0 in all of the tests so that theydo not disturb the other behaviours.

    Test AThe first test was to let the robot choose between a short and a long way to reach the

    goal. The course was set up as seen in Figure 6-6. If the robot chooses the short way(path 1), it must turn at once, go close to an obstacle and drive slowly. If on the other

    hand, the robot chooses the long way (path 2), it can drive faster and do not have todrive so close to the obstacle.

    Figure 6-6: Obstacle configuration for the first test of parameter settings.

    The test was carried out several times, each time with the behaviours weighted in

    different ways. The data from the run was saved and later visualised in Matlab. Thefigures from the runs (Figure 6-7 to Figure 6-11) show how the robot chose to go at

    each test, and as can be seen, the robot neverchose path 1. This was because of falserange reading of the laser (described in chapter 2) that led the robot to believe that path1 was blocked by obstacles. In the figures, the black dots are where the robot has

    registered an obstacle with the laser sensor, the big, thin circle is the robot at the finishand the thick line is the path it has taken.

  • 7/26/2019 Gullstrand Gunnar 05164

    34/42

    28

    Even though the robot never took path 1, the figures clearly show how the behaviourchanged with different parameter settings. When the behaviour heading to goal wasset to alone determine the speed (Figure 6-8) the robot took path 2 and went straight to

    the goal. The path had very straight edges since the wave-propagation NF1 functioncalculates the path in such a way. As could be suspected, when the distance toobstacles was in charge (Figure 6-9) the robot became very afraid of obstacles and

    took a longer way in order to avoid them. Figure 6-10 shows almost the sameperformance, the velocity behaviour preferred high speed to going for the goal andalso took a longer way. In Figure 6-11 all the behaviours are weighted equally and

    distance and velocity out rules heading, so again the robot chose the longer way.In Figure 6-7, the parameters are set as suggested by Brock, giving the headingbehaviour 9 times as much weight as distance and 5 times as much as velocity. Here the

    robot goes the fastest way in a smooth fashion.

    Figure 6-7: Parameter setting 1, : 4.5, : 0.8, : 0.5

    Figure 6-8: Parameter setting 2, : 1.0, : 0.0, : 0.0

    Figure 6-9: Parameter setting 3, : 1.0, : 0.0, : 2.0

  • 7/26/2019 Gullstrand Gunnar 05164

    35/42

    29

    Figure 6-10: Parameter setting 4, : 1.0, : 2.0, : 0.0

    Figure 6-11: Parameter setting 5, : 1.0, : 1.0, : 1.0

    Test BThe second test performed was to let the robot avoid an obstacle and go through a

    doorframe as soon as the obstacle was cleared.

    Figure 6-12: Settings for the second parameter test. The robot is to clear theobstacle, head through a door to reach the goal.

    The settings for this test was the same as in test A, the first with the values found in [14]and the rest with some of the other objectives turned off. As can be seen in Figure 6-13to Figure 6-17, with the parameters set as suggested, the robot travelled a smooth

    trajectory towards the goal. This was definitely the best of all the different runs. InFigure 6-14 all objectives except heading to goal are turned off, when the robot endsup in a dead end, this objective is satisfied with just looking in the goals direction rather

    than going a short path up to clear the obstacle. The same goes for the next test (Figure6-15), here the distance to obstacle objective sees to that the robot stops a bit furtheraway from the obstacle but since no objective complains about the velocity being zero,

    the robot just stands still. In test Figure 6-16 the robot clears the obstacle and finds thegoal, but since the distance to obstacle objective is turned off, it drives very close tothe obstacles resulting in a longer and slower path. Even in the last test the robot clears

  • 7/26/2019 Gullstrand Gunnar 05164

    36/42

    30

    the obstacle, here with all the objectives weighted the same. The trajectory travelledseems to be fine but what does not show in the graph is that the velocity was a lotslower than in the first test, with the result that the path took almost twice the time as in

    the first test.

    Figure 6-13: Parameter setting 1, : 4.5, : 0.8, : 0.5

    Figure 6-14: Parameter setting 2, : 1.0, : 0.0, : 0.0

    Figure 6-15: Parameter setting 3, : 1.0, : 2.0, : 0.0

  • 7/26/2019 Gullstrand Gunnar 05164

    37/42

    31

    Figure 6-16: Parameter setting 4, : 1.0, : 2.0, : 0.0

    Figure 6-17: Parameter setting 5, : 1.0, : 1.0, : 1.0

    6.4. OutdoorsIn the outdoor test the parameters were set to the values,

    a: 4.5, : 0.8, : 0.5, : 1.0, : 1.0The test was carried out to see how fast the robot could travel in a bit more open spacethan could be found indoors. An obstacle course was built and the robot was made to

    traverse it at different velocities. The result showed that, even though the robot almoststopped at some points, it could when possible travel at the maximum possible velocity,1.2 metres per second. Photographs from the run are displayed in Figure 6-18.

  • 7/26/2019 Gullstrand Gunnar 05164

    38/42

    32

    Figure 6-18: Images from test of the GDWA outdoors. In this test the robotcould travel at velocities up to 1.2 metres per second.

    6.5. ConclusionsIn the tests above the GDWA performed well and showed that it indeed is a suitablealgorithm for obstacle avoidance. The difficulty of setting the parameters is a flaw thatit shares with many other algorithms. This problem was, however, reduced by using theparameter values suggested by Fox and setting the last two parameters to 1.0. The final

    parameter settings are: a : 4 . 5, : 0 .8, : 0.5, : 1.0, : 1.0. On the other hand, theGDWA has trouble when there are no obstacles nearby. The problem is that no matter

    how many (or few) obstacles there are, the GDWA carries out a lot of calculations. Thisresults in that the robot can change directions very quickly. Under normal circumstances(there are obstacles) it does not really matter, the robot drives slowly and it has only afew headings to choose from. However, when there are no obstacles there are lots of

    headings admissible and since the robot drives faster, even a small change in direction is

    noticeable. The last problem with the GDWA caused by the NF1s desire to grazeobstacles, it is a known cause for heart attacks when the robot cuts a corner at high

    velocity.

  • 7/26/2019 Gullstrand Gunnar 05164

    39/42

    33

    7. SUMMARY AND CONCLUSIONSThe initial problem was to find an algorithm for controlling the movements of themobile robots at CAS that works better than the one employed before. This task was

    addressed by doing a literature study of the field. The amount of research done in thearea is quite massive since this was a popular field of research a few years ago.

    Following from the theory section of this thesis, the Global Dynamic WindowApproach, proposed by Oliver Brock, was chosen and implemented on a Pioneer 2 DXF

    from ActivMedia. The tests made on this platform established that it indeed is a goodmethod for controlling a mobile robot at high velocities in dynamic environments. Thecomputation time is low and on modern computers there is plenty of room for other

    processes, such as localizing and mapping, to run at the same time.

    The method had some drawbacks however. Setting the parameters of the behaviour can

    be difficult, but this is not unique for the GDWA and the parameter setting in [14]showed to yield smooth and reliable motion behaviour. The algorithm works best in acluttered environment. If the robot uses the GDWA when there are no obstacles nearbythe trajectories planned are not necessarily the most optimal. In these cases a higher-

    level behaviour, could decide not to use the GDWA but instead just set the velocity so

    that it goes straight to the goal. This higher-level behaviour would also come in handywhen deciding which path to take. Often there is some kind of beforehand information

    about the environment, not reliable enough to be used for obstacle avoidance butsufficient for a router to plan the robots path. The best or only path is not alwaysstraight to the goal, the robot might have to go back a few metres and go through a door

    before it can reach the goal. If this information is in the house plan and is available tothe localizing algorithm, then it also should be available to the motion algorithm.

    Concerning the goal of the thesis, to implement a system that works better than thesystem that is currently in use at CAS, the GDWA is well suited for the task. Theexisting system has serious problems to pass obstacles when they are too close, i.e. if

    someone jumps in front of the robot it may browse against that person or even driveover his foot. This is sometimes called obstacle avoidance by intimidation and it can

    be useful in extremely cluttered environments but it is not the proper behaviour for amobile robot. GDWA on the other hand will not collide with anything that the sensorsare aware of and it reacts fast to changes in the environment so that it will have time topass the obstacle at appropriate distance.

  • 7/26/2019 Gullstrand Gunnar 05164

    40/42

    34

    8. FUTUREWORKAs described in the previous section, the GDWA should not work alone. The best resultwill be obtained if the GDWA is merely one behaviour among other and the planning is

    done at a higher instance. This higher instance will never call the GDWA in situationswhere another behaviour would perform better, for example when there are no obstacles

    to avoid. This planner, or