We've spent lot of time on individual functionality, and your robotic projects now have lots of functionality that we can add to our projects. This chapter will bring all of these parts together into a framework that allows the different parts to work together.
You don't want the robot to just walk, talk, or see. You want it to do all of these in a coordinated package. In this chapter, you'll learn how to programmatically connect all of these individual capabilities and make your projects seem intelligent.
In this chapter, we will:
Create a general control structure so that different capabilities can work together through system calls
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.
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...
As you can see, communicating between different aspects of our project can be challenging. You are probably used to using an operating system that provides you with much of the basic functionality that you need for your computer use. In this section I'm going to introduce you to a special operating system that is designed specifically for use with robotics projects, the Robot Operating System (ROS). This operating system sits on top of Linux and provides some interesting functionality.
ROS is fortunately free and open source. It is a very complex set of functionalities, but if you spend some time learning it, you can start using some of the most comprehensive functionality being developed in robotics research today.
To install ROS for the BeagleBone Black, go to http://wiki.ros.org/groovy/Installation/UbuntuARM. This gives you a step-by-step set of instructions to download and install the ROS onto your BeagleBone Black. Then also select Ubuntu on ARM, which is the architecture...