ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
1

Change CMakeLists.txt from rosbuild to catkin [closed]

asked 2014-07-24 16:13:21 -0500

anamcarvalho gravatar image

updated 2014-07-25 08:05:34 -0500

Hi everyone!

I would appreciate if someone could help me correct this CMakeLists.txt from rosbuild to catkin!

Thank you for your time!

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

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)

# add dynamic reconfigure api
rosbuild_find_ros_package(dynamic_reconfigure)
include(${dynamic_reconfigure_PACKAGE_PATH}/cmake/cfgbuild.cmake)
gencfg()

rosbuild_add_executable(pcl_decimator src/pcl_decimator.cpp)

*UPDATE*

In the node of the package, there is an include which says it cannot be found:

#include <pcl_decimator/PCLDecimatorConfig.h>

The package only has one .cpp file in src folder, and has a .cfg file in the cfg folder... Why can't he found this? Is this a migration problem?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by anamcarvalho
close date 2014-08-28 15:23:24.094138

1 Answer

Sort by ยป oldest newest most voted
5

answered 2014-07-24 16:24:46 -0500

ahendrix gravatar image

updated 2014-07-25 16:33:35 -0500

The migration guide does a fairly good job of documenting the migration process from rosbuild to catkin. There's even a dynamic_reconfigure migration section.

For more details about how to use catkin and cmake, see the catkin common tasks guide

EDIT

Your missing header is the generated dynamic_reconfigure header. You probably need to add an explicit dependency between your executable and the header generation, so that they get run in the appropriate order, as described in the dynamic_reconfigure migration:

add_dependencies(example_node ${${PROJECT_NAME}_EXPORTED_TARGETS})
edit flag offensive delete link more

Comments

Hi! Thank you! When following the guide you sent me, I had to add in CMakeLists.txt the following line: find_package(catkin REQUIRED COMPONENTS roscpp dynamic_reconfigure driver_base pcl_ros pcl) I have now this error: Could not find a configuration file for package pcl. What should I do?

anamcarvalho gravatar imageanamcarvalho ( 2014-07-24 17:02:30 -0500 )edit

PCL changed quite a bit between Groovy and Hydro; the Hydro migration page describes most of the changes you'll need to make: http://wiki.ros.org/hydro/Migration . You didn't mention changing distributions in your question, so I didn't think it was relevant.

ahendrix gravatar imageahendrix ( 2014-07-24 17:38:43 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2014-07-24 16:13:21 -0500

Seen: 448 times

Last updated: Jul 25 '14