Book Image

BeagleBone Robotic Projects

By : Richard Grimmett
Book Image

BeagleBone Robotic Projects

By: Richard Grimmett

Overview of this book

Thanks to new, inexpensive microcontrollers, robotics has become far more accessible than it was in the past. These microcontrollers provide a whole new set of capabilities to allow even the most inexperienced users to make amazingly complicated projects. Beaglebone is effectively a small, light, cheap computer in a similar vein to Raspberry Pi and Arduino. It has all of the extensibility of today's desktop machines, but without the bulk, expense, or noise. This project guide provides step-by-step instructions to allow anyone to use this new, low cost platform in some fascinating robotics projects. By the time you are finished, your projects will be able to see, speak, listen, detect their surroundings, and move in a variety of amazing ways. The book begins with unpacking and powering up the components.This will include guidance on what to purchase and how to connect it all successfully–and a primer on programming the BeagleBone Black. Chapter by chapter, we will add additional software functionality available from the open source community, including how to make the system see using a webcam, how to hear using a microphone, and how to speak using a speaker. We then add hardware to make your robots move–including wheeled and legged examples–as well as covering how to add sonar sensors to avoid or find objects, plus wireless control to make your robot truly autonomous. Adding GPS allows the robot to find itself. Finally the book covers how to integrate all of this functionality so that it can all work together, before developing the most impressive robotics projects: those that can sail, fly, and explore underwater.
Table of Contents (18 chapters)
BeagleBone Robotic Projects
About the Author
About the Reviewers

Adding a graphical user interface

You now have your Ubuntu system up and working, and you can type in commands and see their result in the terminal window. However, you need to add some additional basic functionality before adding all the cool capabilities that will make your robots walk, talk, and interact. First, you need to connect to the Internet so that you can update your system and add additional functionality. Second, in many of your projects, you will be working with graphical programs, most notably when you connect webcams or other image sensors.

Prepare for lift off

You're going to need a graphical user interface (GUI), so let's tackle that problem.

Simply run a LAN cable from a router or switch to the BeagleBone board, plug it in the LAN connector, and restart the BeagleBone.

Now type ifconfig at the prompt. You should get a display like the following:

This tells you that you are connected to the Internet and have a valid Internet address. In this case the valid address is This address has been assigned by your Internet router.


Generally there are two types of IP addresses that your board can be assigned: one is called static and the other dynamic. In the static case you will always be assigned the same address. In the dynamic case, the address may change each time the system boots, as it asks the system for an address, which it then uses for that session. Most systems are configured for the dynamic case; however, if your system isn't changing, you will most likely get the same address each time you power on and log in to the system. To learn more about DHCP, try

Once you get here, you'll want to update your operating system. Type in sudo apt-get update. The system will prompt you for the [sudo] password, which is the same as the password you have already been using. Once you enter this, the system will automatically go out and find all the updates associated with the system and applications that you have installed. This may take a very long time, depending on how out-of-date your system has become.

Engage thrusters

Now that you are connected to the Internet and have updated your Ubuntu system, you need to install a graphical user interface. Ubuntu generally comes with a very full-featured windowing system. However, it uses a good deal of memory and can interfere with the performance you may need later. So you are going to install a "light" Windows system on top of your Ubuntu distribution. There are several choices; I like to use Xfce. It is stable, seems to work well, and offers a fairly complete set of capabilities while not overwhelming your system resources. To install this, type sudo apt-get install xfce4 in the command prompt. Again, the system will prompt you for your password and then start the install. This install will take a significant amount of time as it is installing not only the windowing system, but a number of packages the windowing system depends on.

Just a brief note about installing SW. You will be using apt-get to install SW throughout this book. This is the command that Ubuntu uses to go out and find SW and then install it on your machine. The nice thing about this is that it will also normally search and find dependencies and download them as well. Thus not only the package you want, but the packages that are needed for that package are installed as well. However, a bit of caution: this is not fool-proof! You will find times when the SW you have installed will not function because of a dependency that the system does not know about.

Objective complete – mini debriefing

Once the Xfce Windows system is installed, reboot your system by typing sudo reboot. The system will go down and then should come back to the log-in screen. Log in, then type startx at the prompt. After some time the Windows system will come alive. The first time you run the system you will get Welcome to the first start of the panel and a prompt, which will ask you which setup you want for the first setup. Choose the User default config selection.

Then you will see the following screen:

If you see the mouse, then you are successful!

Classified intel

You're probably asking yourself why you didn't copy your image to the internal eMMC memory card instead of just leaving your card in the system. There are two reasons, really. The first is space. The 2 GB that are available in the eMMC is not sufficient to build many, if not most, of the projects you're going to be working on, so you'll need a card anyway. Second, you will find occasions where you want to start over from scratch. Using a card makes this very easy; the eMMC process is a bit more permanent. There are several sites that can show you how to create your Ubuntu system on the eMMC internal memory space, but I'm not going to cover that here. Unfortunately, there are some downsides to not using the eMMC internal memory space, the system will boot slower and you have the additional cost of the external card, but in the long run it will be worth it.