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 http://packages.ros.org/ros/ubuntu maverick main" > /etc/apt/sources.list.d/ros-latest.list'

Add keys

  • wget http://packages.ros.org/ros.key -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 http://rosjava.googlecode.com/hg/rosjava.rosinstall

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 https://code.ros.org/svn/ros-pkg/stacks/joystick_drivers/tags/diamondback joystick_drivers
  • svn co https://usc-ros-pkg.svn.sourceforge.net/svnroot/usc-ros-pkg/trunk/p2os p2os
  • svn co https://code.ros.org/svn/ros-pkg/stacks/laser_drivers/tags/diamondback/hokuyo_node hokuyo_node
  • svn co https://code.ros.org/svn/ros-pkg/stacks/common_msgs/tags/diamondback/visualization_msgs visualization_msgs
  • svn co https://code.ros.org/svn/ros-pkg/stacks/visualization_tutorials/trunk/interactive_marker_tutorials interactive_marker_tutorials
  • svn co https://code.ros.org/svn/ros-pkg/stacks/visualization/trunk/interactive_markers interactive_markers
  • svn co https://code.ros.org/svn/ros-pkg/stacks/visualization_common/tags/diamondback/ogre_tools ogre_tools
  • svn co https://code.ros.org/svn/ros-pkg/stacks/visualization/tags/diamondback/rviz rviz
  • svn co https://codex.cs.bham.ac.uk/svn/int-robot/code/socspioneer/socspioneer socspioneer
  • svn co https://code.ros.org/svn/ros-pkg/stacks/camera_drivers/tags/diamondback camera_drivers
  • svn co http://brown-ros-pkg.googlecode.com/svn/tags/distros/diamondback/stacks/brown_perception/gscam gscam
  • hg clone https://kforge.ros.org/navigation/navigation#diamondback navigation
  • hg clone https://kforge.ros.org/turtlebot/turtlebot_apps#diamondback 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).

Testing

  • 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/willow-erratic.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).