Ask Your Question
3

Create two nodes in the same package

asked 2014-07-29 07:27:02 -0500

ROSkinect gravatar image

I'm using catkin package with one node (cpp file).

I want to add one more node (cpp file) in the same package but I get this error during the compilation:

-- +++ processing catkin package: 'kinectueye'
-- ==> add_subdirectory(kinectueye) CMake Error at kinectueye/CMakeLists.txt:180 (add_executable):   add_executable cannot create target "kinectueye" because another target   with the same name already exists.  The existing target is an executable   created in source directory "/home/jros/catkin_ws/src/kinectueye". See   documentation for policy CMP0002 for more details.

the package is called kinectueye and the kinectueye (the same name) is the executable of the first node.

How can I make one package with two nodes ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-07-29 07:35:48 -0500

Your second executable has to have a different name. Once you made sure that your two executables have different names, everything should work. For example:

add_executable(kinectueye_node src/main.cpp src/some_file.cpp src/another_file.cpp)
add_executable(kinectueye_configurator src/configurator.cpp)
edit flag offensive delete link more

Comments

Yes that's it. I forget to change kinectueye_node name.

ROSkinect gravatar image ROSkinect  ( 2014-07-29 07:46:43 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-07-29 07:27:02 -0500

Seen: 5,071 times

Last updated: Jul 29 '14