ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Just generate your headers to
<catkin_ws>/devel/include/<package_name>/
and forget about catkin_package( INCLUDE_DIRS ...
Message headers are also generated there, so each package sees files in this include folder. By adding the package name in your include like
#include "package_name/header_file.h"
you have the header files properly separated by packages in this folder and your depending package will find them when being compiled.
This worked for me. I have not yet used any install options, though. If you have to install your package, I am not sure whether this would work. (Good luck in this case and tell me what you have dome;) )
One more hint: The headers have to be generated before a file that includes them can be compiled. You can assure this using the add_dependency() command of cmake where you add your custom target as depenceny of e. g. an exec target that is compiled of files which include your generated header.