Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Catkin: Use ROS message from another package

Hi guys

I'm trying to use a ROS message defined in another package, lets say message_package in my own package which I will call myPackage. The problem I have is that catkin first tries to build myPackage before message_package. Hence I get a compilation error:

fatal error: message_package/msg.h: No such file or directory #include "message_package/msg.h"

I don't understand why catkin does that. In the package.xml of myPackage I added

<build_depend> message_package </build_depend>

and in the CMakeLists.txt I added

find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
genmsg
message_package )

What else can I do to tell catkin to compile message_package BEFORE myPackage, so that the necessary headers are there?