This tutorial assumes that you already have Ubuntu on your Beaglebone. If not, you can get it done this way: https://fleshandmachines.wordpress.com/2012/05/03/beaglebone-on-ubuntu-11-04/
Although Fuerte is out I don’t recommend it yet.
Connect to your BeagleBone using ssh.
A nice guide can be found to install ROS Electric here:
Be prepared that this process might take a while since you are gonna compile the whole ROS system (Full) from sources. Use this line:
me@beaglebone$ rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=electric&variant=desktop-full&overlay=no"
You can expect a compilation time of 8 hours or more 🙂
Since ROS itself was installed from sources, don’t expect to find binaries for arm architecture anywhere. You will have to install every additional packages you’d like to use from source.
An easy and straightforward way to get images from a v4l supported webcam is to use the usb_cam package. It’s fast, written in C++, uses libusb.
An alternative choice is gscam. It was also written in C++, but uses gstreamer to get the image feed.
gscam has dependency errors, feel free to play with the yaml-cpp library. If you manage to compile it, send me a note and I’ll update the post.
me@beaglebone$ roscore & me@beaglebone$ rosrun usb_cam usb_cam_node
In order to check what you’ve done you’ll have to set up the ROS_MASTER_URI to point to the BeagleBone.
Setting the environment variable is one thing, we’ll have to adjust a bit of network administration to make sure everything’s gonna be ok. You should know the name and the network ip of both the BeagleBone and your PC. Use ifconfig to get the network ip.
Edit /etc/hosts to set up the address of both computers by name.
me@beaglebone$ sudo vim /etc/hosts
add something like this to the file:
Now the same thing on the other side:
me@pc$ sudo vim /etc/hosts
and set the master uri accordingly. In this case it’s:
me@pc$ export ROS_MASTER_URI=http://beaglebone:11311/
After this in the terminal where you did the export you should be able to see the roscore running on the BeagleBone. Try it with “rostopic list”.
To see the image you can bring up rviz or use the image_view node, pick one 🙂
me@pc$ rosrun rviz rviz rosrun image_view image_view image:=/usb_cam/image_raw
After you have all this running you can get down to write your own image processing node using OpenCV 2.3.1 (the OpenCV version in ROS Electric). Have fun!
If you have problems or you feel that the post is incomplete, feel free to ask.