Intelligent Robotics

Installing ROS and ROS java at home

The best way to get ROS working on your own laptop is to download the disk image and run it in VirtualBox (the root password for the image is 'root'). However, if you want to install ROS from scratch on your own machine, read on...

This information is provided for your information only. ROS java, in particular, is currently under heavy development by Willow Garage and may contain bugs, so therefore we can't offer support if these instructions don't work on your machine.

If in doubt, Google any error messages you receive!

These instructions have only been tested on Ubuntu 10.04 (Maverick Meerkat) -- if you manage to get them working on any other Linux distribution, please contact me (address at the bottom of this page) and let me know!

Initial information

  • Ubuntu uses bash as its default shell, but ROS does not work with tcsh and some other shells. To use bash as your default shell if it isn't already, run chsh and change default shell to /bin/bash
  • Also, your user must be a member of group dialout to be able to control USB port (use Ubuntu's 'user admin' tool)

Set up repositories and sources.list

  • sudo sh -c 'echo "deb maverick main" > /etc/apt/sources.list.d/ros-latest.list'

Add keys

  • wget -O - | sudo apt-key add -

Install ROS and tools

  • sudo apt-get update
  • sudo apt-get install ros-diamondback-desktop-full python-setuptools subversion mercurial nautilus-open-terminal netbeans
  • (Installing netbeans (or Eclipse) also pulls in the JavaVM, so if you don't install netbeans you may have to install a JVM separately).

Install ROSjava

  • mkdir ~/workspace
  • mkdir ~/ROS
  • sudo easy_install -U rosinstall
  • rosinstall ~/ROS /opt/ros/diamondback
  • rosinstall ~/ROS

Set up .bashrc

  • Open the file .bashrc in a text editor and add the following lines at the bottom:
  • source ~/ROS/setup.bash
  • export ROS_PACKAGE_PATH=~/ROS:~/workspace:$ROS_PACKAGE_PATH
  • export JAVA_HOME=/usr/lib/jvm/default-java/
  • export GSCAM_CONFIG="v4l2src device=/dev/video1 ! video/x-raw-rgb ! ffmpegcolorspace"

Build rosjava

  • source .bashrc
  • rospack profile && rosstack profile
  • rosmake rosjava --rosdep-install

Package info

Download package source

  • cd ~/ROS
  • svn co joystick_drivers
  • svn co p2os
  • svn co hokuyo_node
  • svn co visualization_msgs
  • svn co interactive_marker_tutorials
  • svn co interactive_markers
  • svn co ogre_tools
  • svn co rviz
  • svn co socspioneer
  • svn co camera_drivers
  • svn co gscam
  • hg clone navigation
  • hg clone turtlebot_apps

Build source

  • rospack profile && rosstack profile
  • rosmake joystick_drivers --rosdep-install
  • rosmake p2os --rosdep-install
  • rosmake hokuyo_node --rosdep-install
  • rosmake rviz --rosdep-install
  • rosmake stage --rosdep-install
  • rosmake camera_drivers --rosdep-install
  • rosmake gscam --rosdep-install
  • rosmake navigation --rosdep-install
  • rosmake turtlebot_apps --rosdep-install

Set up a project folder

  • roscreate-pkg ~/workspace/robotics rosjava std_msgs sensor_msgs geometry_msgs nav_msgs tf
  • Unpack these files into ~/workspace/robotics
  • Bootstrap the project:
  • cd ~/workspace/robotics
  • mkdir src
  • rosmake
  • rm -rf src
  • (Netbeans can import Eclipse projects, but this only works if Eclipse has first been used to create a 'src' folder in the project. For this reason, it is easiest just to provide this 'bootstrapped, Eclipse-initialised' project folder which can be imported into Netbeans).


  • Assuming all the packages have built without failure:
  • roscore (should run. Leave active in terminal)
  • rosrun rviz rviz (should open rviz window. Can be closed now.)
  • rosrun stage stageros /opt/ros/diamondback/stacks/simulator_stage/stage/world/ (should open world)
  • rostopic pub /cmd_vel geometry_msgs/Twist '[1.0, 0.0, 0.0]' '[0.0, 0.0, 0.0]' (run repeatedly to check robot (blue square) moves).