Upgrading from Toolchain 2.x to Toolchain 2.8.x

This page should contain some tips to make easier common problems when trying to use Orocos 2.8 together with ROS Indigo and its building systems: catkin and rosbuild.

Installing

The quickest way to install a fresh copy is using the precompiled packages.
  sudo apt-get install ros-indigo-rtt-ros-integration

Wet vs Dry

Interrelation of packages using catkin (wet) and rosbuild (dry) are explained with a similitude to a tie rising.

Your package can be either a wet package if it uses catkin build system and depend on other wet packages exclusively. This package will be inside a catkin workspace that is sourced properly and will contain a package.xml with the new syntax.

On the other hand you can have a dry package that can depend in both, wet and dry package. The tide hasn't yet reach it. This package will be placed in a path included in the ROS_PACKAGE_PATH variable. It contains a manifest.xml file with the classic syntax.

CMakeLists and package/manifests

Dry

Wet

When changing from rosbuild to catkin (dry to wet), there are multiple ways to include files which you want to link against. The recommended and easiest way is to add them as REQUIRED COMPONENTS in your CMakeLists.txt:
find_package(catkin REQUIRED COMPONENTS
    rtt_ros
    tf_conversions
    orocos_kdl
        )
and
target_link_libraries(my_lib ${catkin_LIBRARIES} ${USE_OROCOS_LIBRARIES})

A common error when compiling:

/opt/ros/indigo/include/kdl/jacobian.hpp:26:22: fatal error: eigen/core: no such file or directory #include <eigen/core>
Solution: add the following lines to your package.xml
<build_depend>eigen</build_depend>
<build_depend>cmake_modules</build_depend>
end the following lines to your CMakeLists.txt
find_package(cmake_modules REQUIRED)
find_package(Eigen REQUIRED)
include_directories( include ${catkin_INCLUDE_DIRS} ${USE_OROCOS_INCLUDE_DIRS} ${Eigen_INCLUDE_DIRS})
See https://github.com/ros/cmake_modules

Building RTT typekits

Assuming that you autogenerate your typekits based on ROS messages, the quickest way to obtain typekits, you will still be able to compile the messages from the original packages using rosbuild system. The difference comes with the generation of typekits.

Dry

Build your ROS messages normally using rosbuild.
  rosmake your_msgs

For the typekits a few modifications on the CMakeLists.txt are required. Add the following lines to your build file.

  rosbuild_init()
  set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
  set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
  find_package(rtt_roscomm REQUIRED)
  ros_generate_rtt_typekit(motion_control_msgs)
  orocos_generate_package(
    DEPENDS motion_control_msgs
    DEPENDS_TARGETS rtt_roscomm
  )
You can find an example of this on rtt_ros_examples.

Wet

Having a regular ROS messages package, you can always generate your typekit using the tool included in rtt_roscomm by:
  rosrun rtt_roscomm create_rtt_msgs your_msgs

Finding package paths

To make your scripts more robust by eliminating absolute paths or the need to be executed only from a specific folder, you may want to obtain the paths of other packages where to find some configuration files or others. This is a way to do that with the toolchain 2.8.

Deployer scripting

To find paths of packages with Orocos 2.8 (Deployer scripting)
no longer use

  rtt_rospack.find()
instead import

  import("rtt_rospack")
  ros.find("your_package")

rttlua

To find paths of packages with Orocos 2.8 (rttlua)
use

  require("rttros")
  dep = rttlib.findpeer("deployer") or rttlib.findpeer("Deployer")
  dep:import("rtt_rospack") -- Loads Subservice `ros` for the GlobalService (return rtt.provides())
  rtt.provides("ros"):find("<your_pkg>")

Instead, if you want to find them with Orocos 2.6 (rttlua) the find option is in service "rospack", so:

use

  require("rttros")
  dep = rttlib.findpeer("deployer") or rttlib.findpeer("Deployer")
  dep:import("rtt_rospack") -- Loads Subservice `ros` for the GlobalService (return rtt.provides())
  rtt.provides("rospack"):find("<your_pkg>")

Quick tricks

Import catkin or rosbuild packages with Orocos 2.8

use

  import("rtt_ros")
then

  ros.import("your_package")

Using messages and typekits

import

  rtt_rosnode