Book Image

Mastering Beaglebone Robotics

By : Richard Grimmett
Book Image

Mastering Beaglebone Robotics

By: Richard Grimmett

Overview of this book

Table of Contents (18 chapters)
Mastering BeagleBone Robotics
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Issuing voice commands to your quadruped


You should now have a mobile platform that you can program to move in any number of ways. Unfortunately, you still have your LAN cable connected, so the platform isn't completely mobile. And once you have begun the program, you can't alter the behavior of your program. In this section, you will use the principles from Chapter 1, Preparing the BeagleBone Black, to issue voice commands to initiate movement.

You'll need to modify your voice recognition program so that it can run your Python program when it gets a voice command. You have to make a simple modification to the continuous.c program in /home/ubuntu/pocketsphinx-0.8/src/programs. To do this, type cd /home/ubuntu/ pocketsphinx-0.8/src/programs, and then type emacs continuous.c. The changes will occur in the same section as your other voice commands and will look like this:

The additions are pretty straightforward. Let's walk through them:

  • else if (strcmp(word, "FORWARD") == 0): This checks the...