Page 245 - The Definitive Guide to Building Java Robots
P. 245

Preston_5564C07.fm  Page 226  Monday, September 26, 2005  5:38 AM



                 226    CHAPTER 7  ■  NAVIGATION



                            For sensing, I use a Devantech CMPS03 digital compass, two GP2D02 Sharp Infrared
                        sensors, three SRF04 sonar devices, and two Pyro 1394 webcams. To move the webcams, I used
                        the Pan & Tilt Kit from Lynxmotion. To connect the sensors, I used a Preston Research Sonar
                        Distribution Module and a CMPS03 carrier board.
                            Table 7-1 shows what all 16 I/O pins of the Stamp are connected to.


                        Table 7-1. The BASIC Stamp Pin Out
                        Stamp Pin      Function
                        0              Reserved for Bluetooth
                        1              Reserved for Bluetooth
                        2              Sharp IR #1 out
                        3              Sharp IR #1 in
                        4              Sharp IR #2 out
                        5              Sharp IR #2 in
                        6              Spare
                        7              Spare
                        8              Sonar  1  –  Init
                        9              Sonar  1  –  Echo
                        10             Sonar 2 – Init
                        11             Sonar 2 – Echo
                        12             Sonar 3 – Init
                        13             Sonar 3 – Echo
                        14             CMPS03 compass

                        15             GPS serial in



                            Now that you know what my robot looks like, let’s see what makes it navigate, starting with
                        the microcontroller. Figure 7-5 shows a class diagram of the data structures and the NavStamp
                        class using those structures.
   240   241   242   243   244   245   246   247   248   249   250