Creating a general control structure so capabilities can communicate
Now that you have a mobile robot, you want to coordinate all of its different abilities. Let's start with the simplest approach: using a single control program that can call other programs and enable all the capabilities.
Prepare for lift off
You've already done this once. In Chapter 3, Providing Speech Input and Output, you edited the continuous.c
code to allow it to call other programs to execute functionality. Here is the code that we used, found in the /home/ubuntu/pocketsphinx-0.8/programs/src/
directory.
The functionality that is important to us is the system("espeak \"good bye"\"");"\"");
line of code. When you use the system
function call, the program actually calls a different program, in this case the espeak
program, and passes it to the good bye
parameter so that the words good
and bye
come out of the speaker.
Here is another example, this time from Chapter 5, Making the Unit Mobile – Controlling Wheeled Movement...