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

Revision history [back]

click to hide/show revision 1
initial version

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 https://github.com/ros/ros_comm/blob/groovy-devel/clients/roscpp/CMakeLists.txt#L118 for an example

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 https://github.com/ros/ros_comm/blob/groovy-devel/clients/roscpp/CMakeLists.txt#L118 for an example