Ask Your Question
0

generate_dynamic_reconfigure_options stopped generating .h files

asked 2014-10-21 14:07:20 -0600

peci1 gravatar image

So far I had no problems building our project. I'm sure I built it successfully containing several _gencfg targets. Now, suddenly, with no obvious reason, catkin_make fails on all _gencfg targets. The only thing that's changed is I did apt-get upgrade, but I don't think it touched any ROS-related packages.

We're using Indigo on 14.04. The .cfg files have the executable bit set.

After running catkin_make and receiving the error, I look into /home/peckama2/tradr-git/tradr-ws/devel/include/optris_camera/, and the .h file has not been generated.

Here is the compile log (shortened):

$ catkin_make
Base path: /home/peckama2/tradr-git/tradr-ws
Source space: /home/peckama2/tradr-git/tradr-ws/src
Build space: /home/peckama2/tradr-git/tradr-ws/build
Devel space: /home/peckama2/tradr-git/tradr-ws/devel
Install space: /home/peckama2/tradr-git/tradr-ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/peckama2/tradr-git/tradr-ws/build"
####
####
#### Running command: "make -j4 -l4" in "/home/peckama2/tradr-git/tradr-ws/build"
####
... shortened ...
[  1%] [  1%] Built target std_srvs_generate_messages_py
Generating dynamic reconfigure files from cfg/camera_nodelet_params.cfg: /home/peckama2/tradr-git/tradr-ws/devel/include/optris_camera/camera_nodelet_paramsConfig.h /home/peckama2/tradr-git/tradr-ws/devel/lib/python2.7/dist-packages/optris_camera/cfg/camera_nodelet_paramsConfig.py
: Directory or file does not exist
make[2]: *** [/home/peckama2/tradr-git/tradr-ws/devel/include/optris_camera/camera_nodelet_paramsConfig.h] Error 127
make[1]: *** [tradr-payload/optris_camera/CMakeFiles/optris_camera_gencfg.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Built target std_srvs_generate_messages_lisp
[  1%] [  1%] Built target std_srvs_generate_messages_cpp
Built target _optris_camera_generate_messages_check_deps_AutoFlag
make: *** [all] Error 2
Invoking "make" failed

The .cfg file:

#!/usr/bin/env python

PACKAGE='optris_camera'
#import roslib
#roslib.load_manifest(PACKAGE)

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()
# Name Type Level Description Default Min Max
gen.add("frame_id", str_t, 0, "Camera frame ID.", "thermo_camera")
gen.add("framerate", int_t, 0, "Camera frame rate. [Hz]", 10, 1, 120)
gen.add("recali_time", int_t, 0, "Time for recalibration of camera. [s]", 0, 0, 120)
gen.add("timestamp_offset", double_t, 0, "Camera timestamp offset. [s]", 0, -2, 2)
gen.add("use_ros_time", bool_t, 0, "Switch between ros time and time monotonic.", False)
exit(gen.generate(PACKAGE, "optris_camera", "camera_nodelet_params"))

And an excerpt from CMakeLists.txt (comments and some unnecessary code removed):

cmake_minimum_required(VERSION 2.8.3)
project(optris_camera)

find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
std_srvs
sensor_msgs
image_transport
message_generation
camera_info_manager
nodelet
dynamic_reconfigure
)

generate_dynamic_reconfigure_options(
cfg/camera_nodelet_params.cfg)

catkin_package(
INCLUDE_DIRS
include
LIBRARIES
optris_camera_nodelets
CATKIN_DEPENDS
roscpp
std_msgs
std_srvs
sensor_msgs
image_transport
message_runtime
camera_info_manager
nodelet
DEPENDS
libudev-dev
Boost
)

include_directories(include)

add_executable(thermo_node src/thermo_node.cpp src/camera.cpp src/error.cpp)
add_executable(thermo_colorconvert_node src/thermo_colorconvert_node.cpp)
add_library(optris_camera_nodelets src/thermo_processing_nodelet.cpp src/error.cpp)

## Specify libraries to link a library or executable target against
target_link_libraries(
thermo_node
Imager
ImageProcessing
udev
${catkin_LIBRARIES}
)

add_dependencies(thermo_node ${PROJECT_NAME}_gencfg ${PROJECT_NAME}_generate_messages_cpp)

target_link_libraries(
thermo_colorconvert_node
PIImager
PIImageProcessing
${catkin_LIBRARIES}
)

target_link_libraries(
optris_camera_nodelets
${catkin_LIBRARIES}
)

Thanks for any help.

edit retag flag offensive close merge delete

Comments

Is it possible that it's complaining about python itself being missing for some reason? What do you get if you run /usb/bin/env python ?

ahendrix gravatar image ahendrix  ( 2014-10-21 14:12:38 -0600 )edit

That was also my try, but when I run the command after shebang, I get a normal python console.

peci1 gravatar image peci1  ( 2014-10-21 15:20:28 -0600 )edit
1

Please try it with a minimal CMakeLists.txt file:

project(optris_camera)
find_package(catkin REQUIRED COMPONENTS dynamic_reconfigure)
generate_dynamic_reconfigure_options(cfg/camera_nodelet_params.cfg)
catkin_package()

This works fine for me.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-10-21 16:06:37 -0600 )edit

Same result :( What could go wrong?

peci1 gravatar image peci1  ( 2014-10-21 16:49:29 -0600 )edit
1

Please post your version number of dynamic_reconfigure. Also consider putting your minimal package in a GitHub repo to share - may be something is wrong which is not obvious from your posted code.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-10-21 17:23:28 -0600 )edit

ros-inidigo-dynamic-reconfigure 1.5.37-0trusty-20140905-0110-+0000

peci1 gravatar image peci1  ( 2014-10-22 04:11:48 -0600 )edit

I've created a whole new catkin workspace to test this thing. I've properly sourced its setup.bash, and the problem is the same. Here is the minimal workspace with the buildfiles included: https://app.box.com/s/af4foufx341jfk6...

peci1 gravatar image peci1  ( 2014-10-22 04:33:08 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-10-23 08:21:14 -0600

peci1 gravatar image

Got it! The problem was in CRLF (Windows) line-ending that somehow propagated to my cfg files.

I use ROS virtualized under Windows and the sources dir is a shared folder, so maybe Windows did something odd to the files.

And the message about file or dir not existing was really about the interpreter - the system tried to launch /usr/bin/env python<CR>, which obviously does not exist.

Thanks to all for your help.

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

Question Tools

1 follower

Stats

Asked: 2014-10-21 14:07:20 -0600

Seen: 1,244 times

Last updated: Oct 23 '14