Ask Your Question
0

no auto generated config with dynamic_reconfigure

asked 2011-12-04 20:28:19 -0500

momus gravatar image

Hello,

i am failing to use the dynamic_reconfigure package to configure my program. Although i have a working config file ( its working in another project ), during the make process, no header file is created. It seems like the dynamic_reconfigure part of the make process is skipped.

I have created a simple test project following the dynamic reconfigure tutorial

CMakeList.txt

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_executable( blaa main.cpp )

rosbuild_find_ros_package(dynamic_reconfigure)
include(${dynamic_reconfigure_PACKAGE_PATH}/cmake/cfgbuild.cmake)
gencfg()

main.cpp

 #include "ros/ros.h"
 #include "blaa/defaultConfig.h"

 int main(int argc, char *argv[])
 {
    ros::init(argc, argv, "blaa");

    return 0;
 }

manifest.xml

 <package>
   <description brief="blaa">
      blaa
   </description>
   <author>agv</author>
   <license>BSD</license>
   <review status="unreviewed" notes=""/>
   <url>http://ros.org/wiki/blaa</url>
   <depend package="rospy"/>
   <depend package="roscpp"/>
   <depend package="dynamic_reconfigure"/>

 </package>

Output of make ( with a bit of configure )

 ~/ros/stacks/magv/blaa$ make
 [rosbuild] Building package blaa
 [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
 MSG: gencfg_cpp on:default.cfg
 Finding dependencies for /home/agv/blaa/cfg/default.cfg
 -- Configuring done
 -- Generating done
 -- Build files have been written to: /home/agv/blaa
 [ 50%] Building CXX object CMakeFiles/blaa.dir/main.o
 /home/agv/blaa/main.cpp:2:32: fatal error: blaa/defaultConfig.h: No such      file or directory
 compilation terminated.
 make[2]: *** [CMakeFiles/blaa.dir/main.o] Error 1
 make[1]: *** [CMakeFiles/blaa.dir/all] Error 2
 make: *** [all] Error 2

Ignoring the obvious compilation error at the end. It seems like the build process just skipps the config generation ( it starts at 50%). Any idea why?

Thank you for your time! Manuel

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2011-12-09 00:03:56 -0500

momus gravatar image

updated 2011-12-09 00:05:42 -0500

Hello,

i finally found the mistake. In the CMakeList.txt i was using the wrong statement to define the target executable.

Instead of

 add_executable( blaa main.cpp )

It must read

 rosbuild_add_executable( blaa main.cpp )

Only if so, ros libraries are linked against the target executable and the pre compilation steps like message and config generation is done.

Thank you or your time.

edit flag offensive delete link more
0

answered 2011-12-05 00:44:04 -0500

Thomas gravatar image

Did you write the cfg/default.cfg file? Try to run it like this: cd cfg; python default.cfg. You should obtain the following output: Generating reconfiguration files for default in blaa.

It is likely to be caused by a Python error in this file that prevents the files from being generated.

edit flag offensive delete link more

Your Answer

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

Add Answer

[hide preview]

Stats

Asked: 2011-12-04 20:28:19 -0500

Seen: 518 times

Last updated: Dec 09 '11