Page 137 - Introduction to AI Robotics
P. 137

120
                                                                                     4 The Reactive Paradigm
                                       The use of layers and subsumption allows new layers to be built on top
                                     of less competent layers, without modifying the lower layers. This is good
                                     software engineering, facilitating modularity and simplifying testing. It also
                                     adds some robustness in that if something should disable the Level 1 behav-
                                     iors, Level 0 might remain intact. The robot would at least be able to preserve
                                     its self-defense mechanism of fleeing from approaching obstacles.
                                       Fig. 4.10 shows Level 1 recast as behaviors. Note that FEELFORCE was
                                     used by both RUNAWAY and AVOID. FEELFORCE is the perceptual component
                                     (or schema) of both behaviors, with the AVOID and RUNAWAY modules being
                                     the motor component (or schema). As is often the case, behaviors are usu-
                                     ally named after the observable action. This means that the behavior (which
                                     consists of perception and action) and the action component have the same
                                     name. The figure does not show that the AVOID and RUNAWAY behaviors
                                     share the same FEELFORCE perceptual schema. As will be seen in the next
                                     chapter, the object-oriented properties of schema theory facilitate the reuse
                                     and sharing of perceptual and motor components.
                     LEVEL 2: FOLLOW   Now consider adding a third layer to permit the robot to move down cor-
                          CORRIDORS  ridors, as shown in Fig. 4.11. (The third layer in Brooks’ original paper is
                                     “explore,” because he was considering a mapping task.) The LOOK mod-
                                     ule examines the sonar polar plot and identifies a corridor. (Note that this
                                     is another example of behaviors sharing the same sensor data but using it
                                     locally for different purposes.) Because identifying a corridor is more com-
                                     putationally expensive than just extracting range data, LOOK may take longer
                                     to run than behaviors at lower levels. LOOK passes the vector representing
                                     the direction to the middle of the corridor to the STAYINMIDDLE module.
                                     STAYINMIDDLE subsumes the WANDER module and delivers its output to
                                     the AVOID module which can then swerve around obstacles.
                                       But how does the robot get back on course if the LOOK module has not
                                     computed a new direction? In this case, the INTEGRATE module has been
                                     observing the robots actual motions from shaft encoders in the actuators.
                                     This gives an estimate of how far off course the robot has traveled since the
                                     last update by LOOK. STAYINMIDDLE can use the dead reckoning data with
                                     the intended course to compute the new course vector. It serves to fill in
                                     the gaps in mismatches between updates rates of the different modules. No-
                                     tice that LOOK and STAYINMIDDLE are quite sophisticated from a software
                                     perspective.
                                       INTEGRATE is an example of a module which is supplying a dangerous
                                     internal state: it is actually substituting for feedback from the real world. If
                                     for some reason, the LOOK module never updates, then the robot could op-
   132   133   134   135   136   137   138   139   140   141   142