rosinstall
The compiled code is installed into /opt/ros/groovy. While it is possible to install elsewhere (e.g. /usr), this is not well tested and you will encounter various problems along the way (e.g. having to change rosinstall files, having to manually install system dependencies, etc...). Please see REP 122: Filesystem Hiearchy Layout for more detailed documentation on how the installed files are placed.
First install rosinstall, rospkg and rosdep as described in their instructions. For Ubuntu:
$ sudo apt-get install python-rosinstall python-rosdep python-rospkg
If you have trouble using rosws/rosinstall, you can manually download the projects by investigating the respective rosinstall file.
Install a variant
The following instructions will create a system install of the core ROS libraries and tools. The installation is done using standard CMake/make tools, so experts can adjust to their liking.
Robot: ROS package, build, communication, tutorials and graphical tools.
$ mkdir ~/groovy_underlay $ rosinstall --catkin ~/groovy_underlay/src "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=groovy&variant=robot&overlay=no"
Desktop-full: ROS package, build, and communication libraries.
$ mkdir ~/groovy_underlay $ rosinstall --catkin ~/groovy_underlay/src "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=groovy&variant=desktop-full&overlay=no"
For people having trouble with rosinstall or catkin on their particular OS: If you have downloaded the source files in a different way, you need to run catkin_init_workspace ~/groovy_underlay/src. This script is part of catkin, which should by now also at least be in your workspace, you can use the script without installing catkin. It should create a suitable global CMakeLists.txt to use in the next step.
If you do not want to use catkin, follow standard cmake procedure for building cmake packages, and install the packages in the dependency order by manually checking the package.xml declarations.
Build and install the underlay into /opt/ros/groovy:
$ cd ~/groovy_underlay $ mkdir build $ cd build
Now, check your CMAKE_PREFIX_PATH. Make sure no other catkin workspaces or other things you do not want to use are in there:
$ echo $CMAKE_PREFIX_PATH
If the CMAKE_PREFIX_PATH contains things it should not, change the variable using:
$ export CMAKE_PREFIX_PATH=
If you have dependencies installed in special locations, use CMAKE_PREFIX_PATH=x:y" or use -DCMAKE_PREFIX_PATH="x;y" (note the semicolon) option in the following.
The invocation depends on the platform you are on:
- Debian-based platforms (e.g. Ubuntu, Mint) use:
cmake ../src -DCMAKE_INSTALL_PREFIX=/opt/ros/groovy
Other platforms use:cmake ../src -DCMAKE_INSTALL_PREFIX=/opt/ros/groovy -DSETUPTOOLS_DEB_LAYOUT=OFF
Finally, build + install the code:
make -j8 sudo make install
Useful TIP: If you encounter problems with the make command due to "Unable to find 'swig.swg'" and "Unable to find 'python.swg'" errors then it probably due to the installation script having placed /swig at the toplevel/root directory.
To get around this problem do the following (and then restart make process as above)
cd / sudo cp -r /swig /usr/local/share cd ~/ros-underlay/build
Useful TIP: If you are having trouble with the make install command due to lib64 and lib problems, a work around is
cd /opt/ros/groovy/ sudo mv lib/* lib64/ sudo rmdir lib sudo ln -s lib64 lib
This makes the lib and the lib64 directory linked together and the make install command should work now.
Verify the installed environment:
. /opt/ros/groovy/setup.sh which roscore
You should see:
/opt/ros/groovy/bin/roscore