5 Installing the ros-by-example Code - Google Groups

9 downloads 222 Views 143KB Size Report
the robot together with a second computer on your desktop, be sure to clone and build the Hydro branch of the rbx1 repos
5 Installing the ros-by-example Code 5.1 Installing the Prerequisites Before installing the ROS By Example code itself, it will save some time if we install most of the additional ROS packages we will need later. (Instructions will also be provided for installing individual packages as needed throughout the book.) Simply copy and paste the following command (without the $ sign) into a terminal window to install the Debian packages we will need. The \ character at the end of each line makes the entire block appear like a single line to Linux when doing a copy-and-paste: $ sudo apt-get install ros-hydro-turtlebot-* \ ros-hydro-openni-camera ros-hydro-openni-launch \ ros-hydro-openni-tracker ros-hydro-laser-* \ ros-hydro-audio-common ros-hydro-joystick-drivers \ ros-hydro-orocos-kdl ros-hydro-python-orocos-kdl \ ros-hydro-dynamixel-motor-* ros-hydro-pocketsphinx \ gstreamer0.10-pocketsphinx python-setuptools python-rosinstall \ ros-hydro-opencv2 ros-hydro-vision-opencv \ ros-hydro-depthimage-to-laserscan ros-hydro-arbotix-* \ git subversion mercurial

5.2 Cloning the Hydro ros-by-example Repository IMPORTANT: If you have installed previous versions of the ros-by-example repository for ROS Electric, Fuerte or Groovy, follow the instructions below to replace or override your installation with the catkin Hydro version. Note that all three previous versions of the ros-by-example code used the rosbuild system whereas the Hydro version now uses catkin. 5.2.1

Upgrading from Electric or Fuerte

The ros-by-example stack for ROS Electric and Fuerte is distributed as an SVN repository called rbx_vol_1 on Google Code. Either remove the this old stack from your ~/ros_workspace directory or, if you've made modifications you don't want to lose, move the old rbx_vol_1 directory out of your ROS_PACKAGE_PATH before installing the new repository. 5.2.2

Upgrading from Groovy

The ros-by-example packages for ROS Groovy and Hydro are distributed as a Git repository called rbx1 on GitHub. The default branch is called groovy-devel and is the rosbuild version of the repository used with the Groovy version of the book. For ROS Hydro, we need to use the hydrodevel branch of the repository which as been converted to the newer catkin build system. This means we also need to install the code in our personal ~/catkin_ws/src directory rather than ~/ros_workspace. If you have been using the Groovy version of the rbx1 code, either delete the old repository from your ~/ros_workspace directory or, if you've made modifications you don't want to lose, move the old rbx1 directory out of your ROS_PACKAGE_PATH before installing the new repository.

5.2.3

Cloning the rbx1 repository for Hydro

To clone the rbx1 repository for Hydro, follow these steps: $ $ $ $ $ $ $

cd ~/catkin_ws/src git clone https://github.com/pirobot/rbx1.git cd rbx1 git checkout hydro-devel cd ~/catkin_ws catkin_make source ~/catkin_ws/devel/setup.bash

NOTE 1: The fourth command above (git checkout hydro-devel) is critical—this is where you select the Hydro branch of the repository. (By default, the clone operation checks out the Groovy branch for the benefit of those still using Groovy.) NOTE 2: The last line above should be added to the end of your ~/.bashrc file if you haven't done so already. This will ensure that your catkin packages are added to your ROS_PACKAGE_PATH whenever you open a new terminal. If you will be running a mix of rosbuild and catkin packages, refer back to section 4.7 on how to set up your ~/.bashrc file so that both types of packages can be found.

If the ROS By Example code is updated at a later time, you can merge the updates with your local copy of the repository by using the following commands: $ $ $ $ $

roscd rbx1 git pull cd ~/catkin_ws catkin_make source devel/setup.bash

Staying Up-To-Date: If you'd like to receive notifications of updates to both the book and the accompanying code, please join the ros-by-example Google Group. All of the ROS By Example packages begin with the letters rbx1. To list the packages, move into the parent of the rbx1 meta-package and use the Linux ls command: $ roscd rbx1 $ cd .. $ ls -F

which should result in the following listing: rbx1/ rbx1_apps/

rbx1_bringup/ rbx1_description/

rbx1_dynamixels/ rbx1_experimental/

rbx1_nav/ rbx1_speech/

rbx1_vision/ README.md

Throughout the book we will be using the roscd command to move from one package to another. For example, to move into the rbx1_speech package, you would use the command: $ roscd rbx1_speech

Note that you can run this command from any directory and ROS will find the package. IMPORTANT: If you are using two computers to control or monitor your robot, such as a laptop on the robot together with a second computer on your desktop, be sure to clone and build the Hydro branch of the rbx1 repository on both machines.