Given a fresh install of Ubuntu 14.04 (update and upgrade), perform the following steps.
Install ROS Indigo
Follow this tutorial (make sure to complete the steps for ros-indigo-desktop-full).
Install Additional ROS Packages
These packages are needed for the Neato simulator (which is based on the Turtlebot simulator)
$ sudo apt-get install ros-indigo-turtlebot ros-indigo-turtlebot-interactions ros-indigo-turtlebot-simulator ros-indigo-kobuki-ftdi ros-indigo-rocon-remocon ros-indigo-rocon-qt-library ros-indigo-ar-track-alvar-msgs
Build and Install OpenCV
ROS Indigo comes with OpenCV installed by default, however, there are some additional modules that are not included that we will be using later in the class. To remedy this we will be building our own version of OpenCV from source and using it instead of the one that comes with Indigo.
$ cd /tmp
$ wget https://github.com/Itseez/opencv/archive/2.4.11.zip
$ unzip 2.4.11.zip
$ cd opencv-2.4.11
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=RELEASE \
-DBUILD_PYTHON_SUPPORT=ON \
-DWITH_XINE=ON \
-DWITH_OPENGL=ON \
-DWITH_TBB=ON \
-DBUILD_EXAMPLES=ON \
-DBUILD_NEW_PYTHON_SUPPORT=ON \
-DWITH_V4L=ON \
-DOPENCV_EXTRA_MODULES_PATH=./modules
$ make -j2
$ sudo make install
Install gstreamer
We are using the gstreamer package for low-latency video streaming.
$ sudo apt-get install gstreamer1.0*
Due to some issues with Olin's firewall, we will need to go through some contortions to allow video streaming from the robot to a computer connected to the ethernet.
$ sudo apt-get install hping3
$ sudo setcap cap_net_raw+ep /usr/sbin/hping3
Setup your Catkin Workspace
For more context on what is going on here, see this ROS tutorial.
$ source /opt/ros/indigo/setup.bash
$ mkdir -p ~/catkin_ws/src $ cd ~/catkin_ws/src $ catkin_init_workspace
$ cd ..
$ catkin_make
Edit your ~/.bashrc file so that the following line appears last in that file:
$ source ~/catkin_ws/devel/setup.bash
You must perform the rest of the setup in a new terminal window. To make sure you have done the previous steps correct, type roscd
. You should be in the directory ~/catkin_ws/devel
if you did the previous steps correctly.
Setup Your CompRobo GitHub Repository
First create a fork of the base CompRobo repository. If you don't know how to create a fork of a repository, check out the relevant GitHub documentation here.
Next, clone your forked repository inside your catkin workspace. You will also be performing the step of adding my CompRobo repository as a remote. Finally, you will clone another ROS package (teleop_twist_keyboard
) that we will use to control the Neato.
$ cd ~/catkin_ws/src
$ sudo apt-get install git subversion libv4l-dev
$ git clone https://github.com/your-user-name-here/comprobo17.git
$ cd comprobo17
$ git remote add upstream https://github.com/paulruvolo/comprobo17.git
$ cd ..
$ git clone https://github.com/ros-teleop/teleop_twist_keyboard.git
$ cd ..
$ catkin_make
If catkin_make
exits with no error messages, then your laptop is ready to use with the Neatos!
Additional Instructions for Virtual Machines
In order to use the video streaming, you should change the network settings on your virtual machine to "Bridged". When setting up bridged mode you have to indicate what host interface (Wifi, Ethernet, Thunderbolt Ethernet, etc.) you want to bridge. Pick the appropriate interface, and everything should work.