Orocos HelloWorld example with Xenomai

Hello!

We are working with the KUKA LWR4 robot and we want to control it in realtime using OROCOS on Xenomai.

We managed to install ROS and Orocos and after a lot of tinkering we also managed to drive the robot using LWR-component (http://www.orocos.org/wiki/orocos/kuka-lbr-user-group). Th eir example uses the nAxesGenerator.

Our target now is to write a component that controls the robot on its own. That means we want to read robot measurements and command the robot from inside a c++ callback function.

In order to do so, we first tried to create a HelloWorld component as described in the component builders manual. However, there is not much documentation where we got stuck:

- - - - - - - - - - - - - 8< - - - - - - - - - - - - -

$ rosrun ocl orocreate-pkg HelloWorld # ... for ROS users

In a properly configured installation, you'll be able to enter this directory and build your package right away:

$ cd HelloWorld $ make

            
- - - - - - - - - - - - - 8< - - - - - - - - - - - - -

Well, maybe our installation isn't configured properly, but it doesn't build:

- - - - - - - - - - - - - 8< - - - - - - - - - - - - -

lab@lab-lwr-control:~/ros_workspace/orocos$ rosrun ocl orocreate-pkg HelloSaturn Using templates at /home/lab/ros_workspace/orocos/orocos_toolchain/ocl/scripts/pkg/templates... Package HelloSaturn created in directory /home/lab/ros_workspace/orocos/HelloSaturn

lab@lab-lwr-control:~/ros_workspace/orocos$ cd HelloSaturn

lab@lab-lwr-control:~/ros_workspace/orocos/HelloSaturn$ make mkdir -p bin cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake .. -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Found PythonInterp: /usr/bin/python2.7 [rosbuild] Building package HelloSaturn [rosbuild] Cached build flags older than manifests; calling rospack to get flags [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/roslisp/cmake/roslisp.cmake [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/rospy/cmake/rospy.cmake [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/cmake/roscpp.cmake CMake Error at /home/lab/ros_workspace/orocos/orocos_toolchain/rtt/install/lib/cmake/orocos-rtt/orocos-rtt-config.cmake:95 (include):

  include could not find load file:

    /home/lab/ros_workspace/orocos/orocos_toolchain/rtt/install/lib/cmake/orocos-rtt/orocos-rtt-config-gnulinux.cmake
Call Stack (most recent call first):
  CMakeLists.txt:27 (find_package)
CMake Error at /home/lab/ros_workspace/orocos/orocos_toolchain/rtt/install/lib/cmake/orocos-rtt/orocos-rtt-config.cmake:111 (message):
  Could not find an OROCOS-RTT installation for the gnulinux target.  Missing
  file:
  /home/lab/ros_workspace/orocos/orocos_toolchain/rtt/install/lib/cmake/orocos-rtt/orocos-rtt-gnulinux-libraries.cmake
Call Stack (most recent call first):
  CMakeLists.txt:27 (find_package)
-- Configuring incomplete, errors occurred! make: *** [all] Error 1 lab@lab-lwr-control:~/ros_workspace/orocos/HelloSaturn$

- - - - - - - - - - - - - 8< - - - - - - - - - - - - -

The problem is that we do not use gnulinux but xenomai. So what do we have to change to make it work? Or maybe is there a better way to start than this HelloWorld?

We also found that the OROCOS_TARGET in the cmake is correctly set to xenomai...

Thanks in advance!

Best regards,

Mirko

SOLVED

Hi all,

We solved the problem by adding

export LD_LIBRARY_PATH=/usr/xenomai/lib/:$LD_LIBRARY_PATH

to the .bashrc file.

Regards

M