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

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



                 54     CHAPTER 3  ■  MOTION



                            Before we actually start programming our controllers, I’d like to make a note about timing.
                        When you move a servo to a position between 0 and 180 degrees, there is a minimum time that
                        it takes to move the servo to that position. For your standard servo, it takes 480 milliseconds to
                        move 180 degrees. Also, since you will be sending this request via a serial port, the time it takes
                        to send a 3-byte command at a 9600-baud rate takes about 3 milliseconds per byte, for a total
                        of 12 milliseconds.
                            To help out with the discussion, I’ve included a class diagram (see Figure 3-3) of the three
                        main classes as well as their Chapter 2 counterparts: JSerialPort for serial communications,
                        JController for controller standardization, and Controller, which the SSC extends.

















































                        Figure 3-3. A class diagram of classes in section 3.1

                            Figure 3-4 offers a close-up photo of the MiniSSC-II. I started working with this SSC a few
                        years ago and I love it. Currently, there are more powerful controllers out there, but this was the
                        original and I own three, one for Feynman5, one for a robot arm, and one for a spare.
   68   69   70   71   72   73   74   75   76   77   78