0
$\begingroup$

Rosanswers logo

I use groovy distribution & catkin first , I wrote the simple publisher & subscriber example that in beginner tutorials

then I tried to examine it following the following steps

  • typing command roscore in catkin

  • I made sure I have sourced my workspace's setup.sh file after calling catkin_make but before

trying to my applications:

>  In your catkin workspace
>      cd ~/catkin_ws    
>      source ./devel/setup.bash
  • run the node talker using command

rosrun beginner_tutorials talker

but, when I typed command rosrun beginner_tutorials talker I recevied in output:

[rosrun] Couldn't find executable named talker below /home/eman/catkin_ws/src/beginner_tutorials

even though the node talker exists in the src of begibnner_turorials package & my CMakeLists.txt file looks like that:-

cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

## Find catkin macros and libraries
find_package(catkin REQUIRED COMPONENTS roscpp rospy  std_msgs)

## Declare ROS messages and services ##

## Generate messages in the 'msg' folder
# add_message_files(  FILES  Message1.msg Message2.msg )

## Generate services in the 'srv' folder
# add_service_files(FILES Service1.srv Service2.srv )

## Generate added messages and services with any dependencies listed here
# generate_messages( DEPENDENCIES std_msgs )

## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES beginner_tutorials
#  CATKIN_DEPENDS roscpp rospy std_msgs
#  DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
  ${catkin_INCLUDE_DIRS}
)

## Declare a cpp library
# add_library(beginner_tutorials
#   src/${PROJECT_NAME}/beginner_tutorials.cpp
# )

## Declare a cpp executable
# add_executable(beginner_tutorials_node src/beginner_tutorials_node.cpp)

## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes
# add_dependencies(beginner_tutorials_node beginner_tutorials_generate_messages_cpp)

## Specify libraries to link a library or executable target against
# target_link_libraries(beginner_tutorials_node
#   ${catkin_LIBRARIES}
# ries(include ${catkin_INCLUDE_DIRS})

add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})

add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})

    

include_directories(include ${catkin_INCLUDE_DIRS})
add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})

any help,please

I wonder what is the reason for having that error??

  • I made sure that Ros can find my
    package ( beginner_tutorials ) using command rospack find beginner_tutorials & it returns its path
/home/eman/catkin_ws/src/beginner_tutorials

so, that mean ros can see & find my package .


  • I also made sure that the code of 2 nodes talker & listener exits in the src folder of my package

  • , but when I tried to build the code using command catkin_make

  1. typing 1st command cd ~/catkin_ws/src

  2. then typing 2nd command catkin_make

I had that error :-

> The specified base path
> "/home/eman/catkin_ws/src" contains a
> CMakeLists.txt but "catkin_make" must
> be invoked in the root of workspace

I tried also

  • 1-typing 1st command cd ~/catkin_ws

  • 2- then typing 2nd command catkin_make

but, I had error

  CMake Error at /opt/ros/groovy/share/roscpp/cmake/roscppConfig.cmake:130 (message):
  Project 'beginner_tutorials' tried to find library 'pthread'.  The library
  is neither a target nor built/installed properly.  Did you compile project
  'roscpp'? Did you find_package() it before the subdirectory containing its
  code is included?
Call Stack (most recent call first):
  /opt/ros/groovy/share/catkin/cmake/catkinConfig.cmake:72 (find_package)
  beginner_tutorials/CMakeLists.txt:7 (find_package)


-- Configuring incomplete, errors occurred!
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

what should I do ?? should I rebuild the catkin_ws & the package???


Originally posted by Eman on ROS Answers with karma: 164 on 2013-11-30

Post score: 1


Original comments

Comment by BennyRe on 2013-11-30:
Do you see build output from your node when executing catkin_make? In your src folder there only should be the source code of your node, because catkin does out-of-source-builds.

Comment by Eman on 2013-11-30:
@BennyRe firstly, thank you very much for your help & your note.God bless you amen After I had executed catkin_make , I had the following output eman@eman-K52F:~$ catkin_make Base path: /home/eman Source space: /home/eman/src Build space: /home/eman/build Devel space: /home/eman/devel Install space: /home/eman/install #### #### Running command: "make cmake_check_build_system" in "/home/eman/build" #### #### #### Running command: "make -j4 -l4" in "/home/eman/build" #### eman@eman-K52F:~$ you mean by src folder ( the src folder of the package beginner_tutorials ) ??? am I right ?

Comment by Eman on 2013-11-30:
@BennyRe

I made sure that the code of 2 nodes ( talker & listener ) are found in the src folder of the package beginner_tutorials ,but I still having the same error [rosrun] Couldn't find executable named talker below /home/eman/catkin_ws/src/beginner_tutorials I am really sorry for disturbance , but I have the same error & I don't know what to do

Comment by BennyRe on 2013-12-01:
The output of catkin_make looks strange. There should be some output of your package. Did you create the package and your workspace correctly. Did you follow the catkin workspace tutorial? I mean, because your src/build/devel folders are located directly in your home folder.

Comment by lindzey on 2013-12-02:
It'll probably help if you can edit your question to include your CMakeLists.txt file.

Comment by Eman on 2013-12-02:
@BennyRe Thank you very much for your response . God bless you amen. I am sorry for being late to reply , but I had a problem with my internet connection .

I suppose I created the package and my workspace correctly . &yes, I followed the catkin workspace tutorial and every thing was going well similar to the outputs of the tutorial at that time .

Comment by Eman on 2013-12-02:
@BennyRe The output may look strange because I didn't type the command " cd ~/catkin_ws/ before typing command " catkin_make " I am not sure about that ,but may be that was the reason. That output after 1-typing command " cd ~/catkin_ws/ " 2- then typing command " catkin_make " eman@eman-K52F:~/catkin_ws/src$ cd ~/catkin_ws/ eman@eman-K52F:~/catkin_ws$ catkin_make Base path: /home/eman/catkin_ws Source space: /home/eman/catkin_ws/src Build space: /home/eman/catkin_ws/build Devel space: /home/eman/catkin_ws/devel Install space: /home/eman/catkin_ws/install #### #### Running command: "make cmake_check_build_system" in "/home/eman/catkin_ws/build" #### -- Using CATKIN_DEVEL_PREFIX: /home/eman/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /home/eman/catkin_ws/devel;/opt/ros/groovy -- This workspace overlays: /home/eman/catkin_ws/devel;/opt/ros/groovy -- Using Debian Python package layout -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing()

Comment by Eman on 2013-12-02:
@BennyRe but there is error at the end of the output -- +++ processing catkin package: 'beginner_tutorials' -- ==> add_subdirectory(beginner_tutorials) CMake Error at /opt/ros/groovy/share/roscpp/cmake/roscppConfig.cmake:130 (message): Project 'beginner_tutorials' tried to find library 'pthread'. The library is neither a target nor built/installed properly. Did you compile project 'roscpp'? Did you find_package() it before the subdirectory containing its code is included? Call Stack (most recent call first): /opt/ros/groovy/share/catkin/cmake/catkinConfig.cmake:72 (find_package) beginner_tutorials/CMakeLists.txt:7 (find_package) -- Configuring incomplete, errors occurred! make: *** [cmake_check_build_system] Error 1 Invoking "make cmake_check_build_system" failed

Comment by Eman on 2013-12-02:
@lindzey Thank you for your response & your note . God bless you amen . Ok , I will edit my question to include my CMakeLists.txt file

Comment by BennyRe on 2013-12-02:
Please put the content of your CMakeLists.txt into a code environment. It's very hard to read at the moment.

Comment by BennyRe on 2013-12-03:
Thanks joq. Don't have enough karma to edit.

Comment by joq on 2013-12-03:
You should always be able to edit your own question. If that does not work, send an admin message.

Comment by Eman on 2013-12-03:
@BennyRe Sorry I tried to edit it ,but it didn't work & Thanks alot for your response . I really appreciate that . God bless you amen.

Comment by Eman on 2013-12-03:
@joq Thanks alot for your edit , I really appreciate that . God bless you amen & Thanks for your note , I will take care about that

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Based on your most recent update:

typing 1st command cd ~/catkin_ws/src

then typing 2nd command catkin_make

Your problem is that you need to invoke catkin_make in catkin_ws not catkin_ws/src.

However, this is a different mistake than some of the other error messages you've posted would indicate.


Originally posted by lindzey with karma: 1780 on 2013-12-03

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Eman on 2013-12-04:
Thanks alot .God bless you amen but when I tried 1-typing 1st command cd ~/catkin_ws 2- then typing 2nd command catkin_make I had error
CMake Error at /opt/ros/groovy/share/roscpp/cmake/roscppConfig.cmake:130 (message): Project 'beginner_tutorials' tried to find library 'pthread'. The library is neither a target nor built/installed properly. Did you compile project 'roscpp'? Did you find_package() it before the subdirectory containing its code is included? Call Stack (most recent call first): /opt/ros/groovy/share/catkin/cmake/catkinConfig.cmake:72 (find_package) beginner_tutorials/CMakeLists.txt:7 (find_package)

-- Configuring incomplete, errors occurred! Invoking "cmake" failed

Comment by lindzey on 2013-12-04:
please edit your original question to include this information, formatted nicely.

Comment by Eman on 2013-12-05:
Thanks for your help . God bless you amen Ok , I will edit my original question to include this information, formatted nicely.

$\endgroup$

Your Answer

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