Page 26 - Designing Autonomous Mobile Robots : Inside the Mindo f an Intellegent Machine
P. 26

Measure Twice, Cut Once

               little chance that we will maneuver between the two obstacles in Figure 1.4, even if
               the distance between them is ample.

                                                  Timer Interrupt


                                                      Get Sonar
                                                       Ranges


                                        Mode = OFF      Mode
                                                        Test




                                              Yes     L >Dmax    No
                                                        and
                                                      R >Dmax

                                                     Last State < 5  Last  Last State = 6
                                                                 State?
                                                                Last   State = 5

                                                  L < R  Range      R < L
                                                          Test


                                                  Last    Yes           Last   Yes
                                                 State=4?             State=3?

                                                 No                    No
                            State= 1   State= 2  State=3    State=5   State= 4   State= 6
                           Decelerate  Accelerate  Decelerate  Decelerate  Decelerate  Decelerate
                             to Halt   Straight  and Turn  and Turn   and Turn  and Turn
                                       Ahead      Right     Right       Left      Left

                                                    Run Motors
                                                  & Housekeeping
                                              Return from Interrupt

                            Figure 1.5. State driven program flow with escape logic

               When one begins to think of adding rules to help the robot achieve an objective,
               and to maximize its circumnavigation performance, it becomes obvious that the
               purely state-driven model will be very messy indeed. What is more, it will become
               very difficult to maintain and modify the structure.




                                                        9
   21   22   23   24   25   26   27   28   29   30   31