Home > Blog > Build Logs > Hexapod Robot > And now it walks

And now it walks

Posted by qwindelzorf on February 12, 2006

I now have it translating in all directions. It can translate nicely and evenly. The only catch is that it seems to slowly rotate to the left (counter-clockwise) whenever moving. It's kind of odd, and I'm not sure what causes it yet.

Now, I really need to create a better GUI for it. so far, it's just been buttons and sliders to test functionality.

I suppose I ought to talk a bit about the software. It's all written in C#. It's all highly object oriented. Here's a quick breakdown:

  • Servo Class - Represents the servo motor. Keeps track of pulse widths, the max and min of the axis, etc...
  • Joint Class - Uses one servo object. Similar operations to the servo class, but all in degrees.
  • Leg Class - Uses three joint objects; one for the hip horizontal, one for the hip vertical, and one for the knee. Sets up the joints with the apropriate limits so the servos don't run up against their mechanical limitations. It also does some higher-level stuff to allow the leg to be commanded to an (x,y,z) point. Each leg has it's own axes, with the origin at the horizontal hip's center of rotation. When a leg is given a point, it automatically does the inverse-kinematic (IK) calculations to determine what angles to give the joints. All seems to work pretty well.
  • Body Class - Uses six leg objects. This object provides all of the high-level operations. It's public methods include such operations as body rotation and translation. The body class handles gait generation for walking. It also takes care of communicating with the actual robot. I'm thinking I will refactor the communications stuff out into it's own object. We shall see.