Making robots walk with Python
- Audience level:
- Embedded Systems
Programming a four-legged robot to walk around can be a challenge. I will show the robots that I have build using Raspberry Pi and Arduino, and I will talk about how I programmed them using Python and PyGame (and a little bit of C for the Arduino, of course).
From all the robots with statically stable gaits, quadrupeds are the hardest to program. They don't have huge feet to keep them stable, like the bipeds, and they don't have as many legs as hexapods. As a result, they have to move one leg at a time, and balance with their body to keep their center of gravity between the remaining three legs. If you add the fact that the order of moving their legs matters, and that they have to be able to react to stimulus and change their movemnts accordingly, you get an interesting programming problem. In addition to that, a robot is an animated interactive system, not very different from a computer game. The only difference is that instead of moving pixels on the screen, you are moving servomotors -- but all the problems of running and synchronising multiple animations, while processing user input, remain. That is why many of the techniques used in computer games work well and can be used in robotics. Finally, there is the challenge (and fun) of designing and building a physical artifact, and having it move according to our programs. There are many challenges and a lot of experience to be gained, both in mechanical and electronic design.