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

Dynamic Reconfigure in Hydro- gencfg()

asked 2013-11-06 15:18:14 -0600

sotirios gravatar image

updated 2013-11-14 11:01:05 -0600

tfoote gravatar image

Hey everybody!

While trying to create a dynamic reconfigure node in ROS Hydro, I followed this tutorial: wiki.ros.org/dynamic_reconfigure/Tutorials/SettingUpDynamicReconfigureForANode

I tried to catkin_make my package and I get various errors, mainly because it seems to be an outdated version and the packages of dynamic_reconfigure still have commands like rosbuild which I cannot compile (e.g. I include the following lines in the CMakeLists.txt:

# add dynamic reconfigure api
include(/opt/ros/hydro/share/dynamic_reconfigure/cmake/cfgbuild.cmake)
gencfg()

and catkin_make gives me the following errors:

CMake Error at /opt/ros/hydro/share/dynamic_reconfigure/cmake/cfgbuild.cmake:23 

(add_dependencies):
  add_dependencies Adding dependency to non-existent target:
  rospack_genmsg_libexe
Call Stack (most recent call first):
  imagepub/CMakeLists.txt:195 (include)


CMake Error at /opt/ros/hydro/share/dynamic_reconfigure/cmake/cfgbuild.cmake:31 (rosbuild_find_ros_package):
  Unknown CMake command "rosbuild_find_ros_package".
Call Stack (most recent call first):
  imagepub/CMakeLists.txt:195 (include)

Is there a newer tutorial I can look at? Or if not, are there new packages/cmake files I should use?

Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-11-12 11:38:10 -0600

mts gravatar image

Dont use that code, you have to migrate it to catkin. It has a few steps, from

http://wiki.ros.org/catkin/migrating_from_rosbuild

dynamic_reconfigure

For each .cfg file:

Remove "import roslib;roslib.load_manifest(PACKAGE)". Change "from dynamic_reconfigure.parameter_generator import *" to "from dynamic_reconfigure.parameter_generator_catkin import *" In CMakeLists.txt, add the following before the call to catkin_package():

generate_dynamic_reconfigure_options(cfg/DynFile1.cfg cfg/DynFile2.cfg ...)

make sure configure headers are built before any node using them

add_dependencies(example_node ${${PROJECT_NAME}_EXPORTED_TARGETS}) For more details see: the catkin dynamic reconfigure how-to and dynamic_reconfigure >tutorial

edit flag offensive delete link more

Comments

Hello, I am also having a problem. I get an error such that: add_dependencies Adding dependency to non-existent target: fruit_detection for the line in CMakeList ---> add_dependencies(fruit_detection ${${PROJECT_NAME}_EXPORTED_TARGETS}) Do you have any idea what problem is here ?

CHz gravatar image CHz  ( 2013-11-20 03:29:11 -0600 )edit

I solved my problem, but never got a problem with the dependencies. Did you remember to have a definition like this in CMakeList before adding dependencies (the add_dependencies must follow the addition)? add_executable(fruit_detection src/fruit_detection.cpp)

sotirios gravatar image sotirios  ( 2013-11-20 13:50:48 -0600 )edit

Thanks very much ! That helped !

CHz gravatar image CHz  ( 2013-11-22 01:18:39 -0600 )edit

The instructions provided by the migration guide are patently wrong because they say I have to add add_dependencies **before** calling catkin_package(), which is much before adding the executable. If I put add_dependecies just after add_executable It complains that the *.h file generated from the cfg is missing, if I put add_dependencies just before catkin_package() it complains that the target is non-existent. What should I do???

mark_vision gravatar image mark_vision  ( 2014-06-27 09:09:23 -0600 )edit

I updated the migration guide (http://wiki.ros.org/action/diff/catkin/migrating_from_rosbuild?action=diff&rev1=101&rev2=102). Only the "generate_dynamic_reconfigure_options()" line must be invoked before "catkin_package()" - the "add_dependencies()" line must be places after you defined the corresponding target.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-06-28 19:13:27 -0600 )edit

OK for me now it works (there was a missing include). Check also the link after "For more details see:" because for me it's broken.

mark_vision gravatar image mark_vision  ( 2014-06-30 04:20:49 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2013-11-06 15:18:14 -0600

Seen: 2,222 times

Last updated: Nov 12 '13