Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Raspberry Pi Robotics Essentials

You're reading from  Raspberry Pi Robotics Essentials

Product type Book
Published in Jun 2015
Publisher
ISBN-13 9781785284847
Pages 158 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Richard Grimmett Richard Grimmett
Profile icon Richard Grimmett

A basic stable pose


Now that your biped is built and you know how to program the servos using Python, you can experiment with some basic poses. You'll first create a program that allows you to set individual servos so that you can experiment. Here is the program:

This code includes the Python setAngle function from Chapter 2, Building the Biped. The specifics were taken from the www.pololu.com website, but it simply allows you to set a specific servo to a specific angle.

The next part of the code sets all of the servos to their center location. The final piece of the code, the while 1: code set, simply asks the user for a servo and an angle, and then sends the command to the servo controller.

Once the program is run, you should see your biped standing straight up. If not, you may need to center your servos by adjusting the position of the horns. This is a useful pose, but there are others that are more stable. As an excellent first example, you can change the pose to be more like a Tyrannosaurus...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}