ros integration into another project fails with rosbuild_init
Hi there.
I am trying to integrate a few Rosnodes (packages) into another project that is not part of ros / does not contain further ros-nodes. In the project CMakeLists.txt (folder: /home/f/project/CMakeLists.txt) I simply included my ros CMakeLists files for the stacks.
The folder structure would be
/home/f/project/ # here is the main CMakeLists.txt
/home/f/project/myStack # here is the stack.xml
/home/f/project/myStack/myNode # here is the manifest.xml
The include looks like this:
ADD_SUBDIRECTORY(myStack/myNode)
When i now try to run
cmake /home/f/project/CMakeLists.txt
I get the following error:
CMake Error at /opt/ros/electric/ros/core/rosbuild/private.cmake:109 (message):
[rosbuild] rospack found package "project" at "", but
the current directory is
"/home/f/project/myStack/myNode".
You should double-check your ROS_PACKAGE_PATH to ensure that packages are
found in the correct precedence order.
in the mentioned private.cmake at line 106 (or so..) rosbuild tries to verify that the projectsource folder and the current source folder are the same -- this fails obviously. And i managed to find out, that the project name is set to 'project' and not 'myStack' which it should be, since rosbuild_init() is only called from the myStack/CMakeLists.txt
Does anyone know a solution to this problem? I tried to find an answer in this wiki already but that did not help me at all. Neither did the rosbuild documentation help me :/
EDIT: when set the following variables:
SET(ROSBUILD_DONT_REDEFINE_PROJECT 1)
SET(PROJECT_NAME "myNode")
Then the first thing just works find: e.g. finding the correct project and the rosbuild_init() routine passes the first few checks but breaks a few lines later when it tries to verify the manifest.xml - it seems to try to read the file '/manifest.xml' -- the complete path is missing... any ideas? has someone ever done this?! (im quite sure there must have been people who sucessfully integrated ros into other projects)