Robotics StackExchange | Archived questions

CMakeLists.txt calls CMakeLists.txt -> ROS FAIL

Hello, i want include ROS into an lager project, so there calls a single CMakeLists.txt n CMakeLists.txt's. Structure: workspace/source/Apps/fieldviewer/CMakeLists.txt (with rosbuild_init()) workspace/source/Apps/fieldviewer/manifest.xml workspace/source/Apps/... worksapce/source/CmakeLists.txt workspace/build/

if i call: $ cmake ../source/Apps/fieldviewer everything is fine, but if i call: $ cmake ../source there is an error: [rosbuild] Building package source CMake Error at /opt/ros/electric/ros/core/rosbuild/private.cmake:110 (message): [rosbuild] rospack found package "source" at "", but the current directory is "/home/---/workspace/source/Apps/fieldviewer". You should double-check your ROSPACKAGEPATH to ensure that packages are found in the correct precedence order. Call Stack (most recent call first): /opt/ros/electric/ros/core/rosbuild/public.cmake:180 (rosbuildcheckpackagelocation) Apps/fieldviewer/CMakeLists.txt:17 (rosbuild_init)

Is there anything to configure in worksapce/source/CmakeLists.txt file?

Path config: #!/bin/sh source /opt/ros/electric/setup.bash export ROSROOT=/opt/ros/electric/ros export PATH=$ROSROOT/bin:$PATH export PYTHONPATH=$ROSROOT/core/roslib/src:$PYTHONPATH export ROSPACKAGEPATH=~/workspace/source:/opt/ros/electric/stacks:$ROSPACKAGE_PATH

thanks!

Asked by harald on 2012-05-06 11:47:48 UTC

Comments

so the error is ${PROJECT_SOURCE_DIR} != ${${PROJECT_NAME} _PACKAGE_PATH}, but why ... i set before rosbuild_init() the PROJECT_NAME var. with project(fieldviewer). If i set ${${PROJECT_NAME} _PACKAGE_PATH} manuel(before rosbuild_init), the same error happens.

Asked by harald on 2012-05-07 00:13:52 UTC

Please be a lot clearer about what you're trying to do and exactly how you're doing it. Otherwise there's no way for us to reproduce, and as your doing something very different than standard it's not something many of us have experience with.

Asked by tfoote on 2012-05-17 07:49:26 UTC

Answers

If I understand correctly, you want to write a CMakeLists for some other project that includes ROS' CMakeLists directly.

That's not the usual way of using ROS in other projects; the usual way (for a library) is to write a little ROS wrapper package for it or (for a more-general system) implement a ROS node that bridges the two.

Can you explain what problem you're trying to solve in a little more detail?

Asked by Mac on 2012-05-14 07:00:57 UTC

Comments