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

Preston_5564C03.fm  Page 71  Wednesday, October 5, 2005  7:21 AM



                                                                                  CHAPTER 3  ■  MOTION    71



                           • JMotion.java: The interface that defines the basic movements of all types of motion (for
                             wheeled and legged robots)
                           • SpeedDiffDrive.java: The extended version of TimedDiffDrive that gives speed control to
                             any motion
                            The next type of motion is still going to be done with servos, but this time it will move
                        something on your robot rather than the robot itself. It will rely on the same principles
                        discussed here but instead of creating methods like forward() or pivotRight(), it will create
                        methods like lookUp() or lookRight() to move a camera.


                        3.3 Pan and Tilt Mechanisms

                        Sometimes you just want to move part of your robot. If you have a camera and are doing some
                        things with machine vision (see Chapter 6), then you definitely want a pan and tilt camera
                        system. The one I use is shown in Figure 3-7 and comprises a few brackets and two servos,
                        which can be purchased from Lynxmotion for less than $35. I will take the same concepts used
                        in our differential drive systems like grouping servos together in a class, and then we will use
                        our MiniSSC class to control the servos.























                        Figure 3-7. The Lynxmotion Pan and Tilt Kit

                            Figure 3-8 shows a diagram that summarizes the classes.
   85   86   87   88   89   90   91   92   93   94   95