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

Preston_5564C04.fm  Page 136  Wednesday, October 5, 2005  7:22 AM



                 136    CHAPTER 4  ■  SENSORS



                            Once the connections to your sensors and microcontrollers are made, use the sensors
                        listed in the following bullets to give your robot some understanding of its environment.
                            • Dinsmore 1490 Compass: Four I/O; 45-degree accuracy compass.

                            • Devantech CMPS03 Compass: Single I/O; 2-degree accuracy compass.
                            • PNI Corporation Vector 2x Compass: Four I/O; 2-degree accuracy compass.
                            • Lynxmotion Single Line Detector: Good for line following or reading encoders.

                            • Bump Switches: Emergency stop sensors.
                            • Sharp GP2D15 infrared proximity sensors: Good for short-range proximity detection.

                            • Sharp GP2D02 distance infrared sensor: Short-range infrared distance sensor.
                            • Devantech SRF04 sonar: Good medium-range sonar.
                            • Polaroid 6500 Ranging Module and Instrument Grade Transducer: Long-range high-
                              power sonar.
                            The three Stamp programs created were

                            • compass.bs2: Showed how to connect to the three compasses.
                            • switch.bs2: Showed how to get readings from one or more logical switches.

                            • distance.bs2: Showed how to get distance readings from three types of distance sensors.
                            The four Java classes created were
                            • CompassStamp.java: This class is designed to work with the compass.bs2 program.

                            • Compass.java: This class showed how you could model a specific sensor rather than
                              create a CompassStamp for accessing it.

                            • SwitchStamp.java: This class is designed to work with the switch.bs2 program.
                            • DistanceStamp.java: This class is designed to work with the distance.bs2 program.

                            Now that I have discussed the basics of how to get your robot to move and gather basic
                        sensor data it's time to work exclusively with the PC. In the next chapter I will talk about text to
                        speech and voice recognition, but of which are done best with a PC.




















                   97022d2480fe4a63cfdfa123a6e70098
   150   151   152   153   154   155   156   157   158   159   160