Ask Your Question

Need help converting a package to catkin

asked 2013-12-28 05:36:31 -0600

Pi Robot gravatar image

updated 2013-12-28 15:15:46 -0600

I'm hoping some kind hearted catkin expert can help me convert my rosbuild package to catkin. The package is skeleton_markers and unfortunately the catkinize script seems to be currently broken for simple packages (though it works OK for stacks).

While I can piece together some of the parts, I can't get the whole thing to work, especially the dependencies on NITE and OpenNI for my cpp executable. Here are the current manifest.xml and CMakeLists.txt files:


  <description brief="skeleton_markers">
    Skeleton Markers: Publish a list of joint markers for viewing in RViz
  <author>Patrick Goebel</author>
  <review status="unreviewed" notes=""/>
  <depend package="rospy"/>
  <depend package="roscpp"/>
  <depend package="visualization_msgs"/>
  <depend package="std_msgs"/>
  <depend package="geometry_msgs"/>
  <depend package="openni_camera"/>
  <depend package="openni_tracker"/>

    <cpp cflags="-I/usr/include/openni -I/usr/include/nite -I/usr/include/ni"/>



cmake_minimum_required(VERSION 2.4.6)

# Set the build type.  Options are:
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage
#  Debug          : w/ debug symbols, w/o optimization
#  Release        : w/o debug symbols, w/ optimization
#  RelWithDebInfo : w/ debug symbols, w/ optimization
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)


#set the default path for built executables to the "bin" directory
#set the default path for built libraries to the "lib" directory

#uncomment if you have defined messages

#uncomment if you have defined services

#common commands for building c++ executables and libraries
#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
#rosbuild_link_boost(${PROJECT_NAME} thread)
#rosbuild_add_executable(example examples/example.cpp)
#target_link_libraries(example ${PROJECT_NAME})
include_directories(/usr/include/openni /usr/include/nite /usr/include/ni)
rosbuild_add_executable(skeleton_tracker src/skeleton_tracker.cpp src/KinectController.cpp src/KinectDisplay.cpp)
target_link_libraries(skeleton_tracker glut OpenNI orocos-kdl tf)

Can anyone convert these to the corresponding package.xml and CMakeLists.txt files for catkin?

UPDATE: Here are the package.xml and CMakeLists.txt files I came up with after looking at these files for the openni_tracker package. Below the two files I list the error messages I get when compiling.


   Skeleton Markers: Publish a list of joint markers 
   for viewing in RViz.

  <maintainer <a href="mailto:email="">Patrick">email="">Patrick</a> Goebel</maintainer>
  <url type="website"></url>
  <url type=""></url>
  <author <a href="mailto:email="">Patrick">email="">Patrick</a> Goebel</author>



  <run_depend>geometry_msgs</run_depend ...
edit retag flag offensive close merge delete


Patrick: it would help for you to update your question, adding your package.xml and updated CMakelists.txt, with the error messages you get from CMake.

joq gravatar image joq  ( 2013-12-28 05:53:19 -0600 )edit

@joq - As requested, I have updated my question with my catkin package.xml and CMakeLists.txt files as well as the errors I get when I run catkin_make.

Pi Robot gravatar image Pi Robot  ( 2013-12-28 16:01:51 -0600 )edit

Hv u solved your problem? I hv kind of same problem but i changed openni_tracker or openni_camera to libfreenect. I dunno is it a real different or not.. yet, i hv problem with their library to my code.cpp/.h

adelleodel gravatar image adelleodel  ( 2015-10-29 17:30:56 -0600 )edit

The answer from @mardo is marked "accepted". If you have a different issue, please open a new question, which can link to this one, if appropriate.

joq gravatar image joq  ( 2015-10-29 18:35:28 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2013-12-28 20:21:29 -0600

mardo gravatar image

updated 2013-12-29 11:05:07 -0600

Try changing the following line in your CMakeLists.txt

find_package(catkin REQUIRED COMPONENTS geometry_msgs message_generation)


find_package(catkin REQUIRED COMPONENTS roscpp tf geometry_msgs message_generation)
edit flag offensive delete link more


Thanks Sam! That did the trick (almost). I also had to add tf to the list of components. If you edit your answer and add tf, I'll mark it as accepted.

Pi Robot gravatar image Pi Robot  ( 2013-12-29 02:46:12 -0600 )edit

answered 2013-12-29 08:07:10 -0600

Dirk Thomas gravatar image

Your include_directories() also include wrong variables. It should be


It might work for you since orocos_kdl_INCLUDE_DIRS might point to the same path.

Generally if you are unsure about some variables names it help to just output them in order to verify that you named them correctly and that they contain the right information:

message("DEBUG variable catkin_INCLUDEDIR: ${catkin_INCLUDEDIR}")
edit flag offensive delete link more


Thanks for the tip!

Pi Robot gravatar image Pi Robot  ( 2013-12-29 12:29:47 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2013-12-28 05:36:31 -0600

Seen: 504 times

Last updated: Dec 29 '13