Page 201 - Introduction to AI Robotics
P. 201

184
                              5.5.4  Abstract behaviors                   5 Designing a Reactive Implementation
                                     Finite state automata are a useful tool for expressing the coordinated control
                                     program of an abstract behavior. They fall short as a programming tool for
                                     abstract behaviors in a number of ways. First, in many cases, the assemblage
                                     of behaviors represents a prototypical sequence of events that should be
                           TEMPLATE  slightly adapted to different situations, in essence, a template or abstract behav-
                   ABSTRACT BEHAVIOR  ior. In the Pick Up the Trash event, recycling Coke cans was only part of the
                                     task; the robots were also supposed to find white Styrofoam cups and deposit
                                     them in yellow trash cans. The behaviors represented by the FSA could be
                                     collected into an abstract behavior: pick-up-the-trash(trash-color,
                                     trash can-color, size-trash can).
                                       Second, templates need to handle different initialization conditions. Ini-
                                     tialization wasn’t a big problem for the Pick Up the Trash task, but it could
                                     be one for other applications. For example, the emergent behavior of the
                                     robot described in the Unmanned Ground Vehicle competition in Sec. 5.4
                                     could be described as an abstract “follow-path” behavior. Recall that the
                                     robot’s program assumed that it started facing the line. A more general pur-
                                     pose, reusable follow-path behavior would need to handle a broader range
                                     of starting conditions, such as starting facing a bale or not perfectly lined up
                         IMPRINTING  with the line. Another common initialization behavior is imprinting, where
                                     the robot is presented with an object and then records the perceived color (or
                                     other attribute) of the object for use with the nominal behavior. In the Pick
                                     Up the Trash competitions, several teams literally showed the robot the Coke
                                     can and let it determine the best values of “red” for the current lighting con-
                                     ditions. Likewise, some abstract behaviors would need special termination
                                     behavior. In the case of the UGR competition, the termination behaviors was
                                     NULL, but it could have been the victory dance.
                                       Third, some times robots fail in their task; these events are often called
                         EXCEPTIONS  exceptions. An exception might be when the robot does not pick up a soda
                                     can in over 10 minutes. Another behavior can be substituted (do a raster scan
                                     rather than a random wander) or alternative set of parameters (use different
                                     values for red).


                              5.5.5  Scripts


                             SCRIPTS  Abstract behaviors often use scripts, 49;50;87;100  or a related construct called
                             SKILLS  skills, 53;54  to create generic templates of assemblages of behaviors. Scripts
                                     provide a different way of generating the logic for an assemblage of behav-
   196   197   198   199   200   201   202   203   204   205   206