Monday, March 31, 2014

ROS Hydro in Linux Mint: installation tutorial

First of all make sure your system is up-to-date by
$ sudo apt-get update
$ sudo apt-get upgrade
Download Hydro version of ROS: (full version includes: rviz simulator, 2D/3D simulators and other useful things)
$ sudo apt-get install ros-hydro-desktop-full
Set up your keys:
$ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
Before using ROS, we need to initialize rosdep, which enables easy system dependencies installation required by ROS.
$ sudo rosdep init 
$ rosdep update
Then we set up environment for ROS and for that we need hydro setup.bash variables and better to add it to your ~/.bashrc file so it will be loaded each time you open bash
$ echo source /opt/ros/hydro/setup.bash >> ~/.bashrc 
and restart it
$ source ~/.bashrc 
Then install ROS command-line tool rosinstall - an easy way of downloading and installing useful ROS components
$ sudo apt-get install python-rosinstall
Here, you should be done with ROS itself, but to use ROS with NAO robot you need NAO stacks installed. For that you need your Naoqi Python SDK in PYTHONPATH variable, good way to add it to your .bashrc file:
export PYTHONPATH=~/NAO/pynaoqi-python-2.7-naoqi-1.14-linux64:$PYTHONPATH
Then you can install recompiled binaries by:
$ sudo apt-get install ros-hydro-nao-robot
But better way to keep your stacks up-to-date is to install it from repositories. Add next lines to your rosinstall.txt located in your local workspace (I use rosbuild workspace) and I use all the stacks so I listed them all:
- git:
    uri: https://github.com/ahornung/humanoid_msgs
    local-name: stacks/humanoid_msgs
- git:
    uri: https://github.com/ros-nao/nao_robot
    local-name: stacks/nao_robot
- git:
    uri: https://github.com/ahornung/nao_common
    local-name: stacks/nao_common
- git:
    uri: https://github.com/ros-nao/nao_extras
    local-name: stacks/nao_extras
- git:
     uri: https://github.com/ros-nao/nao_camera
     local-name: stacks/nao_camera
- git:
    uri: https://github.com/ahornung/humanoid_navigation
    local-name: stacks/humanoid_navigation

Run command that will download stacks from git:
$ rosinstall . /opt/ros/hydro rosinstall.txt
Then using rosdep install the stacks (you can list some of the stacks or all of them at the same time):
$ rosdep install humanoid_msgs nao_robot nao_common --os ubuntu:raring
!IMPORTANT here: stacks will not get install complaning on the Linux Mint system, so you should add
-- os ubuntu:raring
parameter whenever you want to install particular stack in Linux Mint system. And to get stacks working we need to compile them:
$ rosmake humanoid_msgs nao_robot nao_common
Congrats! If everything went well - it's pretty all what you have to do. To completely update stack you should first delete it from you local workspace and install it once again.

No comments:

Post a Comment