2014-02-03

Installing Full Desktop ROS Hydro from source on Ubuntu 13.10

Since there aren't any ROS packages for 13.10, I'm did a full catkin source install as specified in http://wiki.ros.org/hydro/Installation/Source. I'm also going to do a full gazebo 2.0 install from source in order to debug http://answers.gazebosim.org/question/5223/setting-projector-pose-vs-enclosing-link-pose/ .

As I understand it the proper use of catkin is to create a catkin workspace for all the standard ROS stuff, build and install it ( ./src/catkin/bin/catkin_make_isolated --install ) and then source the install setup.sh from that install ( source ~/ros_catkin_ws/install_isolated/setup.bash ) and then go on and create a new catkin workspace to actually do development in. Otherwise the build times will be ridiculous if catkin has to traverse 250 packages.


Gazebo


Since the core gazebo isn't a ros package (yet?) it ought to be built separately following the instructions on http://gazebosim.org/wiki/2.0/install .

I ran into this error near the end of the build:


[ 99%] Building CXX object interfaces/player/CMakeFiles/gazebo_player.dir/GazeboDriver.cc.o
In file included from /home/lwalter/other/gazebo_source/gazebo/interfaces/player/GazeboInterface.hh:26:0,
from /home/lwalter/other/gazebo_source/gazebo/interfaces/player/GazeboDriver.cc:25:
/home/lwalter/other/gazebo_source/gazebo/interfaces/player/player.h:22:38: fatal error: libplayercore/playercore.h: No such file or directory
#include <libplayercore/playercore.h>



So install libplayer-dev? No, that is a different player. I had libplayerc3.0-dev and libplayerc++3.0-dev installed already, and the file in question was located in /usr/include/player-3.0/libplayercore/playercore.h but gazebo wasn't seeing it.

I'm sure I could have done this cleaner, but I just hand-edited interfaces/player/CMakeLists.txt:


include_directories( /usr/include/player-3.0 ${SDF_INCLUDE_DIRS} ${PLAYER_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} ${OGRE_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})


I got a lot of these warnings but built 100% (haven't fully tested yet so they may yet cause problems):


/usr/bin/ld: warning: libboost_system.so.1.49.0, needed by /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libsdformat.so, may conflict with libboost_system.so.1.53.0

The post install bashrc instructions are not quite what is on the gazebo install page, I had to do this:


export DEST_DIR=/home/lwalter/other/install
export LD_LIBRARY_PATH=$DEST_DIR/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH


export PATH=$DEST_DIR/bin:$PATH
export PKG_CONFIG_PATH=PKG_CONFIG_PATH=$DEST_DIR/lib/x86_64-linux-gnu/pkgconfig:$DEST_DIR/lib/pkgconfig:$PKG_CONFIG_PATH

ROS


Something went wrong in the ros libstage package, it never generated a config.h from ros_catkin_ws/src/stage/config.h.in ( https://github.com/rtv/Stage/blob/master/config.h.in ) - possibly this was due to not having the environmental variables pointing at gazebo correctly.


[ 10%] Building CXX object libstage/CMakeFiles/stage.dir/gl.o[ 12%] Building CXX object libstage/CMakeFiles/stage.dir/logentry.o/home/lwalter/other/ros_catkin_ws/src/stage/libstage/file_manager.cc:5:45: fatal error: config.h: No such file or directory #include "config.h" // to get INSTALL_PREFIX ^compilation terminated.[ 14%] make[2]: *** [libstage/CMakeFiles/stage.dir/file_manager.o] Error 1make[2]: *** Waiting for unfinished jobs....Building CXX object libstage/CMakeFiles/stage.dir/model.o/home/lwalter/other/ros_catkin_ws/src/stage/libstage/model.cc:141:45: fatal error: config.h: No such file or directory #include "config.h" // for build-time config ^compilation terminated.make[2]: *** [libstage/CMakeFiles/stage.dir/model.o] Error 1make[1]: *** [libstage/CMakeFiles/stage.dir/all] Error 2make: *** [all] Error 2<== Failed to process package 'stage':
Command '/home/lwalter/other/ros_catkin_ws/install_isolated/env.sh make -j4 -l4' returned non-zero exit status 2
Reproduce this error by running:==> cd /home/lwalter/other/ros_catkin_ws/build_isolated/stage && /home/lwalter/other/ros_catkin_ws/install_isolated/env.sh make -j4 -l4

The really ugly hack solution is to create config.h by hand:


vi /home/lwalter/other/ros_catkin_ws/src/stage/libstage/config.h

#define INSTALL_PREFIX "/home/lwalter/other/install/"
#define PLUGIN_PATH "/home/lwalter/other/install/usr/local/lib"
#define VERSION "3.0.2"
#define PROJECT "Stage"


That much worked, though those values may cause problems later if not correct.


Telling ROS about Gazebo


(I didn't discover the gazebo bashrc instructions were wrong until after going through these steps, they probably aren't necessary)
==> cmake /home/lwalter/other/ros_catkin_ws/src/gazebo_plugins -...
CMake Error at CMakeLists.txt:40 (find_package):
By not providing "Findgazebo.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "gazebo", but CMake did not find one.
Could not find a package configuration file provided by "gazebo" with any of the following names:
gazeboConfig.cmake
gazebo-config.cmake
Add the installation prefix of "gazebo" to CMAKE_PREFIX_PATH or set "gazebo_DIR" to a directory containing one of the above files. If "gazebo" provides a separate development package or SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred!
<== Failed to process package 'gazebo_plugins':

Command '/home/lwalter/other/ros_catkin_ws/install_isolated/env.sh cmake /home/lwalter/other/ros_catkin_ws/src/gazebo_plugins -DCATKIN_DEVEL_PREFIX=/home/lwalter/other/ros_catkin_ws/devel_isolated/gazebo_plugins -DCMAKE_INSTALL_PREFIX=/home/lwalter/other/ros_catkin_ws/install_isolated' returned non-zero exit status 1
Reproduce this error by running:
==> cd /home/lwalter/other/ros_catkin_ws/build_isolated/gazebo_plugins && /home/lwalter/other/ros_catkin_ws/install_isolated/env.sh cmake /home/lwalter/other/ros_catkin_ws/src/gazebo_plugins -DCATKIN_DEVEL_PREFIX=/home/lwalter/other/ros_catkin_ws/devel_isolated/gazebo_plugins -DCMAKE_INSTALL_PREFIX=/home/lwalter/other/ros_catkin_ws/install_isolated



Command failed, exiting.


It can't find gazebo, so run cmake-gui . in ros_catkin_ws/build_isolated/gazebo_plugins and set gazebo_DIR to

/home/lwalter/other/install/share/gazebo/cmake

SDFormat


Now it looks like the debian supplied sdfformat is conflicting with the one gazebo built, uninstall and rebuild the ros_caktin_ws



cd /home/lwalter/other/ros_catkin_ws/build_isolated/gazebo_plugins
cmake-gui .

SDFormat_DIR needs to be set to
/home/lwalter/other/install//lib/x86_64-linux-gnu/cmake/sdformat

Have to set the above for several packages.

RVIZ build problems with libshiboken



Linking CXX shared library /home/lwalter/other/ros_catkin_ws/devel_isolated/rviz/lib/libdefault_plugin.so
[ 95%] Built target default_plugin
make: *** [all] Error 2
<== Failed to process package 'rviz':
Command '/home/lwalter/other/ros_catkin_ws/install_isolated/env.sh make -j4 -l4' returned non-zero exit status 2
Reproduce this error by running:
==> cd /home/lwalter/other/ros_catkin_ws/build_isolated/rviz && /home/lwalter/other/ros_catkin_ws/install_isolated/env.sh make -j4 -l4



Investigate this with make VERBOSE=1


...
type 'QX11EmbedWidget' is specified in typesystem, but not defined. This could potentially lead to compilation errors.
Segmentation fault (core dumped)
make[2]: *** [src/python_bindings/shiboken/librviz_shiboken/librviz_shiboken_module_wrapper.cpp] Error 139
make[2]: Leaving directory `/home/lwalter/other/ros_catkin_ws/build_isolated/rviz'
make[1]: *** [src/python_bindings/shiboken/CMakeFiles/rviz_shiboken.dir/all] Error 2
make[1]: Leaving directory `/home/lwalter/other/ros_catkin_ws/build_isolated/rviz'
make: *** [all] Error 2
There is some discussion of probably the same issue at
https://aur.archlinux.org/packages/ros-hydro-rviz/

The solution seems to be to remove shiboken:

sudo apt-get remove libshiboken-dev

Cmake generates this new warning output:


Add the installation prefix of "GeneratorRunner" to CMAKE_PREFIX_PATH or
set "GeneratorRunner_DIR" to a directory containing one of the above files.
If "GeneratorRunner" provides a separate development package or SDK, be
sure it has been installed.
Call Stack (most recent call first):
src/python_bindings/shiboken/CMakeLists.txt:9 (include)
CMake Warning at /home/lwalter/other/ros_catkin_ws/install_isolated/share/python_qt_binding/cmake/shiboken_helper.cmake:41 (message):
Shiboken binding generator NOT available.
Call Stack (most recent call first):
src/python_bindings/shiboken/CMakeLists.txt:9 (include)
SIP binding generator available.
Python binding generators: sip
Configuring done


But the pacckages all build and install now.

Misc


Next try out building the catkin workspace with the projects I'm working on, the first thing missing appears to be the joy package, so clone it and rerun the catkin make install in the main ros catkin ws:

git clone https://github.com/ros-drivers/joystick_drivers.git
sudo apt-get install libusb-dev libspnav-dev


What I don't understand about re-running ./src/catkin/bin/catkin_make_isolated --install is how much stuff has to be re-done even when nothing or very little has changed.  Object files are correctly recognized as already compiled, but something high level gets dirtied and many shared libraries and scripts have to be rerun to presumably generate the exact same output files that were already generated.


No comments: