As you can see, communicating between different aspects of our project can be challenging. In this section, I'm going to introduce you to a special operating system that is designed specifically for use with robotic projects, the Robot Operating System (ROS). This operating system works on top of Linux and provides some interesting functionality.
The operating system is available at www.ros.org. However, the most useful link to the Wiki for the ROS is wiki.ros.org. If you visit this link, you will find a complete set of documentation and downloads. There are also a number of resources that can be useful if you'd like to learn more about the ROS in depth. One of the better resources is the book Learning ROS for Robotics Programming, Martinez and Fernandez, Packt Publishing.
This section will not cover the ROS in detail but will introduce you to some of the basics. Start by going to the www.ros.org website. If you select Install, you'll note that there is a wide range of Linux operating systems and hardware support. You'll also note that there are several different versions or releases of the ROS. Some of the later releases are Hydro, Fuerte, and Groovy. One of the challenges of using an operating system like this is to decide which release to use. The most recent release will have the largest number of features. It may also have a significant number of issues that may cause problems.
I often prefer using a past release that has been used by a larger number of people; that way, I run into fewer problems. I also don't like to build large packages like this myself. It can take a great deal of time, and often, you'll run into cryptic error messages that can take days to resolve. So, for this tutorial, I am going to use an older version that I have been successful with in the past. It is called Groovy, and while it is not the latest version, it is very stable and easy to use.
I normally follow the installation instructions at http://wiki.ros.org/groovy/Installation/Raspbian. The following are the instructions in a step-by-step form:
apt
sources. This is the place where your apt-get
appears when it is trying to find packages to install. The following is the command:sudo sh -c 'echo "deb http://64.91.227.57/repos/rospbian wheezy main" > /etc/apt/sources.list.d/rospbian.list'
apt
key:wget http://64.91.227.57/repos/rospbian.key -O - | sudo apt-key add -
apt
sources so that your Raspberry Pi will know where the files are by typing sudo apt-get update
.ros_comm
will install all the significant packages you'll need by typing sudo apt-get install ros-groovy-ros-comm
. The package is quite large and will take some time.rosdep
to let you track dependencies and run some core features. Type sudo rosdep init
and then rosdep update
.echo "source /opt/ros/groovy/setup.bash" >> ~/.bashrc
and then source ~/.bashrc
.python-rosinstall
, which can help in installing the ROS packages, type sudo apt-get install python-rosinstall
.export | grep ROS
. You should see the following screenshot:One of the really powerful features of the ROS is its ability to show you how your information is flowing between applications. As you follow the tutorial, you will end up with two applications running, teleop_turtle
and turtlesim
. In this example, you can use an application called rqt_graph
to record the flow of information between the two applications, as shown in the output in the following screenshot:
It will be very difficult to illustrate all of the functionalities of the ROS here. It may take a bit of time, but you can learn to use the ROS to give your robot more functionality.
3.22.249.158