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

ROS inside part of a c++ project

asked 2013-06-24 04:36:38 -0500

Verane gravatar image

updated 2014-04-20 14:09:49 -0500

ngrennan gravatar image

Hi. I've a c++ project where I'm using CMakeList with the structure similar to:

Project (inside my ros sandbox)
|
|_Folder1
|___some code
|___CMakeLists.txt
|
|_Folder2
|___some code
|___CMakeLists.txt
|
|_ROS package folder
|___some code
|___CMakeLists.txt
|
|_CMakeLists.txt

Inside de main CMakeLists.txt I've something similar to:

add_subdirectory(recruiter)

add_library(something_static STATIC ${RECRUITER_SOURCES})

Where inside "recruiter" directory is the ROS package, created using "roscreate-pkg".

And I'm getting the following error:

[rosbuild] Error from directory check: /opt/ros/groovy/share/ros/core/rosbuild/bin/check_same_directories.py /opt/ros/groovy/stacks/test/noderecruiter 1 Traceback (most recent call last): File "/opt/ros/groovy/share/ros/core/rosbuild/bin/check_same_directories.py", line 46, in <module> raise Exception Exception CMake Error at /opt/ros/groovy/share/ros/core/rosbuild/private.cmake:102 (message): [rosbuild] rospack found package "test" at "", but the current directory is "/opt/ros/groovy/stacks/test/noderecruiter". You should double-check your ROS_PACKAGE_PATH to ensure that packages are found in the correct precedence order. Call Stack (most recent call first): /opt/ros/groovy/share/ros/core/rosbuild/public.cmake:177 (_rosbuild_check_package_location) server/noderecruiter/CMakeLists.txt:12 (rosbuild_init)

-- Configuring incomplete, errors occurred!

What's happening? THanks.

edit retag flag offensive close merge delete

Comments

1

Are you building with catkin? I think ROS/catkin needs the toplevel.cmake to work.

dornhege gravatar image dornhege  ( 2013-06-24 04:54:50 -0500 )edit

No, I would like to build like a normal project.

Verane gravatar image Verane  ( 2013-06-24 05:54:10 -0500 )edit

Could you please post your CMakeLists.txt file in full? It would be good to see the context of your build output.

allenh1 gravatar image allenh1  ( 2013-06-24 17:55:25 -0500 )edit

What CMakeLists do you want? The file inside the main project or the ros one?

Verane gravatar image Verane  ( 2013-06-25 00:14:29 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-08-12 12:06:56 -0500

tfoote gravatar image

ROS packages are not designed to simply be included inside CMake packages. This is not a supported use case.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-06-24 04:36:38 -0500

Seen: 633 times

Last updated: Aug 12 '13