Page 362 - Introduction to AI Robotics
P. 362

345
                                                                                 Hybrid Architecture
                                      9.5 Case Study of Topological Navigation with a
                                      are used to specify and carry out the implied details of the plan in a modular
                                      and reusable way.
                                        The implementation consisted of three scripts for navigating doors, halls,
                                      and foyers. The pseudocode for navigate-door is shown below in C ++
                                      style and takes advantage of the indexing properties of the switch statement:



                                                 switch(door)
                                                 case door-not-found:
                                                      //initialization phase
                                                      //follow wall until find door
                                                      if wall is found
                                                           wallfollow to door
                                                      else
                                                           move-ahead to find a wall
                                                 case door-found:
                                                      //nominal activity phase
                                                      move-thru-door(door-location)



                                        The nominal behavior, move-thru-door, is self-terminating, so there is
                                      no separate termination condition. The perception of the door is the key
                                      determinant in what the robot does.
                                        The navigate-hall is used for traveling between corridors, foyers and
                                      corridors, and from corridors to corridor/door nodes. It has two different
                                      starting conditions. One condition is that the robot is in a foyer and detects a
                                      hall. Since the hall may be somewhat ahead and the hallfollow behavior
                                      assumes the robot is in the hall, the script has the robot employ wallfollow
                                      to find the hall, then begin following the hall. The task manager uses the
                                      directional information stored in the database to determine which wall of
                                      the foyer to follow. In the other condition the robot is already in a hall. Since
                                      the robot is not guaranteed to be facing the centerline of the hall (ANBs have
                                      no knowledge of what was done prior to their instantiation except via global
                                      variables), the sub-script turns it to line itself up with the desired hall.


                                               switch(hall)
                                               case not-facing-hall:
                                                    //initialization phase
                                                    if starting in a FOYER
   357   358   359   360   361   362   363   364   365   366   367