Ask Your Question
0

Unable to find the executable

asked 2017-02-08 09:10:20 -0500

fundamentals gravatar image

updated 2017-02-08 09:57:46 -0500

gvdhoorn gravatar image

I am trying a run a node on the terminal using the command rosrun skeleton_listener skelCord.cpp (I got the code skelCord.cpp from this link http://answers.ros.org/question/23032... , "skeleton_listener" is the name of the package). But when I try and run it I get the error

[rosrun] Couldn't find executable named skelCord.cpp below /home/eric/catkin_ws/src/skeleton_listener
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun]   /home/eric/catkin_ws/src/skeleton_listener/src/skelCord.cpp

If anyone knows why this error occurs their help would be greatly appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-02-08 09:58:35 -0500

gvdhoorn gravatar image

You can't directly run .cpp files, you'll have to compile them first. Probably as part of a package, in a catkin workspace.

edit flag offensive delete link more

Comments

@gvdhoorn thank you for the answer, isn't compiling done using catkin_make, because I have already done catkin_make in the workspace.

fundamentals gravatar imagefundamentals ( 2017-02-08 10:33:13 -0500 )edit

Ok. So what did you add to CMakeLists.txt and package.xml in order to get the node to compile properly?

gvdhoorn gravatar imagegvdhoorn ( 2017-02-08 11:04:04 -0500 )edit

@gvdhoorn I added this to the end of the Cmakelists.txt 1. find_package(catkin REQUIRED COMPONENTS std_msgs tf ) 2. add_executable(skelCord src/skelCord.cpp) 3. target_link_libraries(skelCord ${catkin_LIBRARIES})

I didn't add to the package.xml but its dependecies are std_msgs rospy roscpp

fundamentals gravatar imagefundamentals ( 2017-02-08 13:44:38 -0500 )edit

Ok. Then after sourceing the setup.bash, you should be able to run:

rosrun skeleton_listener skelCord

Note that I didn't include the .cpp extension, as that is not included in the binary name in your CMakeLists.txt either.

gvdhoorn gravatar imagegvdhoorn ( 2017-02-08 14:04:47 -0500 )edit

thank you that worked @gvdhoorn

fundamentals gravatar imagefundamentals ( 2017-02-14 05:26:05 -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: 2017-02-08 09:10:20 -0500

Seen: 320 times

Last updated: Feb 08 '17