Page 194 - Introduction to AI Robotics
P. 194

177
                                      5.5 Assemblages of Behaviors
                                        Recall also in the serial program implementations of IRMs in Ch. 3 that the
                                      agent “noticed” releasers every second. At one iteration through the loop,
                                      it might be hungry and “enter” the state of feeding. In the next iteration, it
                                      might still be hungry and re-enter the state of feeding. This can be repre-
                                      sented by having arrows starting at the feeding state and pointing back to
                                      the feeding state.
                                        For the example in Fig. 5.8, the robot starts in the state of following a line.
                                      This means that the robot is not prepared to handle a visual distraction (range
                                      near) until it has started following a line. If it does, the program may fail be-
                                      cause the FSA clearly shows it won’t respond to the distraction for at least
                                      one update cycle. By that time, the robot may be heading in the wrong direc-
                                      tion. Starting in the following-line state fine for the UGR competition, where
                                      it was known in advance that there were no bales of hay near the starting
                                      line. A more general case is shown in Fig. 5.9, where the robot can start ei-
                                      ther on a clear path or in the presence of a bale. The FSA doesn’t make it
                                      clear that if the robot starts by a bale, it better be pointed straight down the
                                      path!
                                        The fourth piece of information that a designer needs to know is when the
                                      robot has completed the task. Each state that the robot can reach that termi-
                          FINAL STATE  nates the task is a member of the set of final state, F. In the UGR example,
                                      the robot is never done and there is no final state—the robot runs until it is
                                      turned off manually or runs out of power. Thus, both states are final states.
                                      If the robot could recognize the finish line, then it could have a finish state.
                                      The finish state could just be stopped or it could be another behavior, such
                                      as a victory wag of the camera. Notice that this adds more rows to the FSA
                                      table, since there must be one row for each unique state.
                                        In many regards, the FSA table is an extension of the behavioral table.
                                      The resulting table is known as a finite state machine and abbreviated M for
                                      machine. The notation:


                                      M = fK;  ; ;    g    s          ;       F

                                      is used as reminder that in order to use a FSA, the designer must know all
                                      the q states (K), the inputs   the transitions between the states  ,the special
                                      starting state q 0 , and the terminating state(s) (F). There must be one arrow
                                      in the state diagram for every row in the table. The table below summarizes
                                      the relationship of FSA to behaviors:
   189   190   191   192   193   194   195   196   197   198   199