0
$\begingroup$

Rosanswers logo

After making with catkin_make, when I start my node with rosrun, I get the following message:

You have chosen a non-unique executable, please pick one of the following:

  1. /home/name/ros/devel/lib/gero_move/servo_driver
  2. /home/name/ros/src/gero_move/servo_driver

CMakeLists.txt is as follows:

cmake_minimum_required(VERSION 2.8.3)
project(gero_move)
find_package(catkin REQUIRED COMPONENTS roscpp std_msgs gero_msgs message_generation)
catkin_package( CATKIN_DEPENDS gero_msgs)
add_executable(servo_driver servo_driver.cpp)

I use Ubuntu and ROS Indigo. Even if I delete build and devel directory and make catkin_make again, it creates both files new. What could be root cause for this?

Thanks for any help :-)


Originally posted by Johannes Jaegers on ROS Answers with karma: 70 on 2014-09-01

Post score: 0


Original comments

Comment by ahendrix on 2014-09-01:
Can you edit your question to add your CMakeLists.txt?

Comment by Johannes Jaegers on 2014-09-01:
Thanks for your kind request, I added it.

Comment by Andromeda on 2014-09-01:
not sure, but please try to rename your .cpp file with another name and try again: for istance: add_executable(servo_driver main_servo.cpp)

Comment by Johannes Jaegers on 2014-09-02:
Thanks a lot for your help, when I delete it in the src directory, it does not get recreated again by catkin_make. So I assume it is right, that the executable is only in the devel directory?What do I do with data files I have to read in, do I have to make catkin copy this file to the devel directo?

Comment by Johannes Jaegers on 2014-09-02:
Ok, I found out that working directory is the workspace, for me home/jonny/ros. So if I place data files there, I can access them with a relative pathname. Thanks a lot for all your answeres, it helped me a lot!! :-) Ahendirx, can you convert your comment to an answer, so I can mark as solved?

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Your CMakeLists.txt looks reasonable. Have you tried removing the executable in the src directory and confirming that it gets recreated when you do a build?


Originally posted by ahendrix with karma: 47576 on 2014-09-01

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Johannes Jaegers on 2014-09-02:
after removing in the src directory "src/gero_move/servo_driver" the problem was gone.

$\endgroup$
0
$\begingroup$

Rosanswers logo

Sometime you will find more executables in the same package. Of course they are compiled with different name_file.cpp files. Look into you CMakeLists.txt and be sure you don t have 2 times the same add_executable. For istance:

add_executable( my_robot src/main_a.cpp )
add_executable( my_robot src/main_b.cpp )   <= this is redundant with the line above

Hope it helps


Originally posted by Andromeda with karma: 893 on 2014-09-01

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Johannes Jaegers on 2014-09-01:
Thanks for your kind reply. Unfortunately I only use the "add_executable" once... I added cmakelists.txt above.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.