Page 119 - The Definitive Guide to Building Java Robots
P. 119
Preston_5564C03.fm Page 100 Wednesday, October 5, 2005 7:21 AM
100 CHAPTER 3 ■ MOTION
Since we created one limb in this section, two, four, or six should not be that much more
difficult. In the next section, I’ll show you how to create legs in the same manner that we created
arms and then I’ll move them all together smoothly using the LM32.
3.6 Legged Robots
Moving a legged robot is very similar to modeling the ComplexArm in section 3.5. It has multiple
servos and multiple positions that the legs need. The only thing not included is a gait.
A gait in legged robots is the order and direction of the leg movements. For example, a
human has the following gait:
1. Lift left leg up.
2. Move left leg forward.
3. Put left leg down.
4. Shift weight to left leg.
5. Lift right leg up.
6. Move right leg forward.
7. Put right leg down.
8. Shift weight to right leg.
9. Repeat.
That’s nine commands for two legs in one direction, which is more complicated than the
differential drive classes created in section 3.1. But because the Hexapod implements the
JMotion interface if our robot has legs or wheels, navigation will be the same.
A class diagram for this is shown in Figure 3-13.
To get a better idea of what we’re going to be moving, look at the photo in Figure 3-14. It
has a total of 12 servos, with four degrees of freedom per leg for a total of 48 possible moves.