## For instruction on writing tutorials ## http://www.ros.org/wiki/WritingTutorials #################################### ##FILL ME IN #################################### ## for a custom note with links: ## note = This page needed proofreading and review ## for the canned note of "This tutorial assumes that you have completed the previous tutorials:" just add the links ## note.0=[[ROS/Tutorials|ROS tutorials]] ## note.1=[[Documentation| ros.org]] ## descriptive title for the tutorial ## title = Stack Installation ## multi-line description to be displayed in search ## description = This tutorial describes how to install 3rd party stacks ## the next tutorial description (optional) ## next = ## links to next tutorial (optional) ## next.0.link= ## next.1.link= ## what level user is this tutorial for ## level= BeginnerCategory ## keywords = stack, package, installation, install #################################### <> /!\ This tutorial is out-of-date and applies only to rosbuild packages; not to catkin. <> = What to install = ROS has a growing number of 3rd party software packages that can provide drivers or algorithms you can use on your robot. You can find this software by selecting [[http://www.ros.org/browse/|Browse Software]] at the top of the page. Once you have found a package you are interested in you will want to install it. This tutorial will assume that that you are interested in installing the [[http://www.ros.org/browse/details.php?name=usb_cam|usb_cam]] package or the [[http://www.ros.org/browse/details.php?name=laser_ortho_projector|laser_ortho_projector]] package. The instructions for other packages should be roughly the same. First, you need to locate where your stacks are located by ROS, and depends on your type of installation. Then, two different ways of installing the repository will be explained: Using SVN to pull down an entire repository Using GIT to pull down a repository = Where are your stacks located = ROS stores groups of packages in stacks, and it stores the stacks wherever you want. ROS will search for packages and stacks that are listed in the `ROS_PACKAGE_PATH` environmental variable. The location of `setup.sh` and the default for ROS_PACKAGE_PATH depends on how you installed ROS. If you installed using [[http://www.ros.org/wiki/ROS/Installation/Ubuntu/SVN|SVN]] then you should get the following, with username replaced by your username. == ROS installed via SVN == {{{#!shell $ echo $ROS_PACKAGE_PATH /home/username/ros/stacks $ more /home/username/ros/setup.sh export ROS_ROOT=/home/username/ros/ros export PATH=$ROS_ROOT/bin:$PATH export PYTHONPATH=$ROS_ROOT/core/roslib/src:$PYTHONPATH if [ ! "$ROS_MASTER_URI" ] ; then export ROS_MASTER_URI=http://localhost:11311 ; fi export ROS_PACKAGE_PATH=/home/username/ros/stacks source $ROS_ROOT/tools/rosbash/rosbash }}} If you installed from pre-compiled binaries of debian packages you should get something similar to this. == ROS installed via Pre-compiled binaries (boxturtle) == {{{#!shell $ echo $ROS_PACKAGE_PATH /opt/ros/boxturtle/stacks $ more /opt/ros/boxturtle/setup.sh export ROS_ROOT=/opt/ros/boxturtle/ros export PATH=$ROS_ROOT/bin:$PATH export PYTHONPATH=$ROS_ROOT/core/roslib/src:$PYTHONPATH if [ ! "$ROS_MASTER_URI" ] ; then export ROS_MASTER_URI=http://localhost:11311 ; fi export ROS_PACKAGE_PATH=/opt/ros/boxturtle/stacks source $ROS_ROOT/tools/rosbash/rosbash }}} You can also edit setup.sh if you would like to install your stacks somewhere specific. {{{ export ROS_PACKAGE_PATH=/home/username/ros/stacks:/home/username/project:/home/username/ros_tutorials }}} = Downloading from Source = Most of the packages and stacks you may be interested are available as source code. ROS makes building from source code easy. == Using SVN to pull down an entire repository == So for example lets say you wanted to use the [[usb_cam]] driver, and you decided to download the entire [[http://www.ros.org/wiki/bosch-ros-pkg|Bosch ROS Repository]] in case there was anything else you needed. First, make sure you have SVN installed. {{{#!shell $ sudo aptitude install subversion }}} If you installed the pre-compiled binary version of ROS then you may want to create a directory to build stacks from source. First edit your ROS_PACKAGE_PATH in /opt/ros/boxturtle/setup.sh or in your .bashrc {{{ export ROS_PACKAGE_PATH=~/ros/stacks:/opt/ros/boxturtle/stacks }}} Next, in a terminal switch to the directory that is now in your ROS_PACKAGE_PATH. {{{#!shell $ mkdir ~/ros && mkdir ~/ros/stacks $ cd ~/ros/stacks }}} Then you can checkout the trunk from the svn repository listed in the wiki. The trunk if you are curious is the default branch of code in a svn repository, as opposed to the experimental branch. {{{#!shell $ svn co https://bosch-ros-pkg.svn.sourceforge.net/svnroot/bosch-ros-pkg/trunk/ bosch-ros-pkg }}} After it is downloaded you can change to the [[usb_cam]] directory and compile the source code. {{{#!shell $ cd bosch-ros-pkg/bosch_drivers/usb_cam $ rosmake --rosdep-install }}} `--rosdep-install` will install system dependencies such as `libswscale` that the code will need to compile. If `rosmake` produces an error the first time you run it, try running it again as it may have needed to automatically add the subdirectory to its index. == Using GIT to pull down a repository == The other common software configuration management tool you will see used is [[http://git-scm.com/|Git]], so in this part we will use git to pull down the CCNY Robotics Lab ROS Repository and we will build the [[laser_ortho_projector]] from source. First, make sure you have Git installed. {{{#!shell $ sudo aptitude install git-core }}} Next, in a terminal switch to a directory that is in your ROS_PACKAGE_PATH. In this case we will assume that you installed ROS from SVN {{{#!shell cd ~/ros/stacks }}} Then you can clone the git repository {{{#!shell git clone http://robotics.ccny.cuny.edu/git/ccny-ros-pkg.git/ }}} Once it has finished downloading switch to the directory and run rosmake {{{#!shell cd ccny-ros-pkg/scan_tools/laser_ortho_projector rosmake --rosdep-install }}} rosmake may need to be run twice to add the new directory, and compile. = Installing from source archive = The developer may have released a version of the software as a source code archive. This might be a file such as scan_tools-0.1.0.tar.bz2, which we will assume is in your ~/Downloads directory. {{{#!shell cd ~/ros/stacks mv ~/Downloads/scan_tools-0.1.0.tar.bz2 . bunzip2 scan_tools-0.1.0.tar.bz2 tar -vpxf scan_tools-0.1.0.tar rm scan_tools-0.1.0.tar }}} ## AUTOGENERATED DO NOT DELETE ## TutorialCategory ## FILL IN THE STACK TUTORIAL CATEGORY HERE