ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Need help converting a package to catkin

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

Pi Robot gravatar image

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

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:

manifest.xml:

<package>
  <description brief="skeleton_markers">
    Skeleton Markers: Publish a list of joint markers for viewing in RViz
  </description>
  <author>Patrick Goebel</author>
  <license>BSD</license>
  <review status="unreviewed" notes=""/>
  <url>http://ros.org/wiki/skeleton_markers</url>
  <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"/>

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

</package>

CMakeLists.txt:

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# 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)

rosbuild_init()

#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

#uncomment if you have defined messages
rosbuild_genmsg()

#uncomment if you have defined services
#rosbuild_gensrv()

#common commands for building c++ executables and libraries
#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
#rosbuild_add_boost_directories()
#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.

package.xml

<package>
  <name>skeleton_markers</name>
  <version>0.4.0</version>
  <description>
   Skeleton Markers: Publish a list of joint markers 
   for viewing in RViz.
  </description>

  <maintainer <a href="mailto:email="patrick@pirobot.org">Patrick">email="patrick@pirobot.org">Patrick</a> Goebel</maintainer>
  <license>BSD</license>
  <url type="website">http://ros.org/wiki/skeleton_markers</url>
  <url type="https://github.com/pirobot/skeleton_markers/issues"></url>
  <author <a href="mailto:email="patrick@pirobot.org">Patrick">email="patrick@pirobot.org">Patrick</a> Goebel</author>

  <buildtool_depend>catkin</buildtool_depend>

  <build_depend>libopenni-dev</build_depend>
  <build_depend>libopenni-nite-dev</build_depend>
  <build_depend>libopenni-sensor-primesense-dev</build_depend>
  <build_depend>geometry_msgs</build_depend>
  <build_depend>orocos_kdl</build_depend>
  <build_depend>message_generation</build_depend>
  <build_depend>visualization_msgs</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_depend>geometry_msgs</build_depend>
  <build_depend>openni_camera</build_depend>
  <build_depend>openni_tracker</build_depend>
  <build_depend>rospy</build_depend>
  <build_depend>roscpp</build_depend>

  <run_depend>libopenni-dev</run_depend>
  <run_depend>libopenni-nite-dev</run_depend>
  <run_depend>libopenni-sensor-primesense-dev</run_depend>
  <run_depend>geometry_msgs</run_depend ...
(more)
edit retag flag offensive close merge delete

Comments

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 -0500 )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 -0500 )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 -0500 )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 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

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

mardo gravatar image

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

Try changing the following line in your CMakeLists.txt

find_package(catkin REQUIRED COMPONENTS geometry_msgs message_generation)

to

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

Comments

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 -0500 )edit
1

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

Dirk Thomas gravatar image

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

${catkin_INCLUDE_DIRS}

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

Comments

Thanks for the tip!

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

Question Tools

2 followers

Stats

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

Seen: 740 times

Last updated: Dec 29 '13