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

cpp message generation failure?

asked 2013-02-27 08:02:20 -0500

Dereck gravatar image

updated 2014-01-28 17:15:27 -0500

ngrennan gravatar image

I'm trying to finish setting up my p2os_driver package that I've converted to groovy & catkin and have hit another speedbump.

cd catkin_ws/src
wstool set p2os_driver --git
wstool update
cd catkin_ws

This process works fine on my ubuntu 12.04 machine but not on my raspberry pi. On my rpi I get:

In file included from /home/dereck/cws/src/p2os_driver/src/
/home/dereck/cws/src/p2os_driver/include/p2os.h:40:26: fatal error: BatteryState.h: No such file or directory

and there are no messages in the catkin_ws/devel/include/p2os_driver directory on the rasPi, but they are there on the ubuntu machine.

In other words, What could cause CPP message headers not to be generated?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-03-01 15:01:53 -0500

Dirk Thomas gravatar image

updated 2013-03-01 15:02:14 -0500

catkin_make will automatically build all your CMake target in parallel. In your case you have to tell CMake that it must generate C++ code for the messages (BatteryState.h) before compiling p2osnode.cpp.

You do that by adding a dependency form the executable you are building to the gencpp target which generates the messages headers. Adding something like the following line to your CMakeLists.txt:

add_dependencies(<target_name_of_your_executable_or_library> <msg_pkg_name_containing_the_battery_state>_genpp)

See for an example

edit flag offensive delete link more

Question Tools


Asked: 2013-02-27 08:02:20 -0500

Seen: 444 times

Last updated: Mar 01 '13