Reader small image

You're reading from  Raspberry Pi Robotics Essentials

Product typeBook
Published inJun 2015
Publisher
ISBN-139781785284847
Edition1st Edition
Concepts
Right arrow
Author (1)
Richard Grimmett
Richard Grimmett
author image
Richard Grimmett

Dr. Richard Grimmett has been fascinated by computers and electronics from his very first programming project, which used Fortran on punch cards. He has bachelor's and master's degrees in electrical engineering and a PhD in leadership studies. He also has 26 years of experience in the radar and telecommunications industries, and even has one of the original brick phones. He now teaches computer science and electrical engineering at Brigham Young University, Idaho, where his office is filled with his many robotics projects.
Read more about Richard Grimmett

Right arrow

A basic turn for the robot


Your robot can walk forward, but you'll also want your robot to be able to turn. Your turning is limited to the amount you can turn the hip of your robot, which is around 20 degrees for this robot. So, to perform a full 90 degree turn, you'll need to take the turn in several steps. The big difference here is that when you return to the standing state, you do not want to reset your hip rotation servos to 90 degrees. Here are the diagrams, including several that are rear view, for a turn:

Here is the Python code for a basic turning operation:

And here is the Python code to chain these basic states together to step a turn:

Now your robot can walk and turn! Obviously, your robot could walk backward by reversing the order of servo control statements in each of the functions. There are many more types of motions you can program with your robot, following the planning method outlined in this chapter.

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Raspberry Pi Robotics Essentials
Published in: Jun 2015Publisher: ISBN-13: 9781785284847

Author (1)

author image
Richard Grimmett

Dr. Richard Grimmett has been fascinated by computers and electronics from his very first programming project, which used Fortran on punch cards. He has bachelor's and master's degrees in electrical engineering and a PhD in leadership studies. He also has 26 years of experience in the radar and telecommunications industries, and even has one of the original brick phones. He now teaches computer science and electrical engineering at Brigham Young University, Idaho, where his office is filled with his many robotics projects.
Read more about Richard Grimmett