Unexpected behavior with actionlib_tutorials
I followed the first actionlib tutorial exactly, first creating a new workspace. I added all dependencies as in the tutorial and building the workspace worked fine. When running the fibonacci_server, the tutorial states:
You will see something similar to:
[ INFO] 1250790662.410962000: Started node [/fibonacci], pid [29267], bound on [aqy], xmlrpc port [39746], tcpros port [49573], logging to [~/ros/ros/log/fibonacci_29267.log], using [real] time
However, this info is not displayed. The server runs without error and rostopic list -v
lists the same topics as in the tutorial. Furthermore, running rqt_graph results in a single block fibonacci
with two topics color
and /fibonacci
as opposed to the graph in the tutorial.
I then continued with the client, following the tutorial precisely again. After creating the fibonacci_client.cpp file and editing the CMakeLists.txt, catkin_make fails:
achille@W530:~/Documents/tutorial_ws$ catkin_make
Base path: /home/achille/Documents/tutorial_ws
Source space: /home/achille/Documents/tutorial_ws/src
Build space: /home/achille/Documents/tutorial_ws/build
Devel space: /home/achille/Documents/tutorial_ws/devel
Install space: /home/achille/Documents/tutorial_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/achille/Documents/tutorial_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/achille/Documents/tutorial_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/achille/Documents/tutorial_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/achille/Documents/tutorial_ws/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/achille/Documents/tutorial_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.6
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 1 packages in topological order:
-- ~~ - actionlib_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'actionlib_tutorials'
-- ==> add_subdirectory(actionlib_tutorials)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- system
-- Generating .msg files for action actionlib_tutorials/Fibonacci /home/achille/Documents/tutorial_ws/src/actionlib_tutorials/action/Fibonacci.action
-- actionlib_tutorials: 7 messages, 0 services
-- Configuring done
CMake Error at actionlib_tutorials/CMakeLists.txt:138 (add_executable):
Cannot find source file:
fibonacci_client
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
CMake Warning (dev) at actionlib_tutorials/CMakeLists.txt:151 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "fibonacci_client" of target "fibonacci_server" does
not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error: CMake can not determine linker language for target: fibonacci_server
CMake Error: Cannot determine link language for target "fibonacci_server".
-- Generating done
-- Build files have been written to: /home/achille/Documents/tutorial_ws/build
Makefile:920: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
The build part of my CMakelists.txt is as follows (dropping comments):
include_directories(
# include
${catkin_INCLUDE_DIRS}
)
add_executable(
fibonacci_server src/fibonacci_server.cpp
fibonacci_client src/fibonacci_client.cpp
)
add_dependencies(
fibonacci_server
fibonacci_client
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(
fibonacci_server
fibonacci_client
${catkin_LIBRARIES}
)
I'm not sure ...
Can you make sure that you've actually added
add_executable(fibonacci_client src/fibonacci_client.cpp)
(note thesrc/
there), and not justadd_executable(fibonacci_client fibonacci_client.cpp)
, or evenadd_executable(fibonacci_client)
?That's the case. Updated my question with the BUILD part of the CMakeLists.txt file