ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Hi I am a beginner with ROS, working through chapter 2 of the Learning ROS for Robotics Programming book (2nd ed).when i use catkin_make in my workspace i got errors.please help me.thank you.i use ROS indigo and ubunto 14.0.4.

asked 2016-08-17 06:07:31 -0500

m.kowsar gravatar image

updated 2016-08-17 06:55:59 -0500

gvdhoorn gravatar image

terminal output.

mk@ubuntu:~/catkin_ws$ catkin_make
Base path: /home/mk/catkin_ws
Source space: /home/mk/catkin_ws/src
Build space: /home/mk/catkin_ws/build
Devel space: /home/mk/catkin_ws/devel
Install space: /home/mk/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/mk/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/mk/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /opt/ros/indigo
-- 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/mk/catkin_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.6.18
-- BUILD_SHARED_LIBS is on
-
-  traversing 9 packages in topological order:
-- ~~  - image_pipeline (metapackage)
-- ~~  - am_tutorial
-- ~~  - chapter2_tutorials
-- ~~  - camera_calibration
-- ~~  - image_proc
-- ~~  - image_view
-- ~~  - stereo_image_proc
-- ~~  - depth_image_proc
-- ~~  - image_rotate
-- +++ processing catkin metapackage: 'image_pipeline'
-- ==> add_subdirectory(image_pipeline-indigo/image_pipeline)
-- +++ processing catkin package: 'am_tutorial'
-- ==> add_subdirectory(am_tutorial)
-- +++ processing catkin package: 'chapter2_tutorials'
-- ==> add_subdirectory(chapter2_tutorials)
CMake Error: Error in cmake code at
/home/mk/catkin_ws/src/chapter2_tutorials/CMakeLists.txt:46:
Parse error.  Expected "(", got identifier with text "messages".
-- +++ processing catkin package: 'camera_calibration'
-- ==> add_subdirectory(image_pipeline-indigo/camera_calibration)
-- +++ processing catkin package: 'image_proc'
-- ==> add_subdirectory(image_pipeline-indigo/image_proc)
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   thread
-- +++ processing catkin package: 'image_view'
-- ==> add_subdirectory(image_pipeline-indigo/image_view)
-- Using these message generators: gencpp;genlisp;genpy
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   signals
--   thread
-- +++ processing catkin package: 'stereo_image_proc'
-- ==> add_subdirectory(image_pipeline-indigo/stereo_image_proc)
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   thread
-- +++ processing catkin package: 'depth_image_proc'
-- ==> add_subdirectory(image_pipeline-indigo/depth_image_proc)
-- Using these message generators: gencpp;genlisp;genpy
-- Boost version: 1.54.0
-- Eigen found (include: /usr/include/eigen3)
-- +++ processing catkin package: 'image_rotate'
-- ==> add_subdirectory(image_pipeline-indigo/image_rotate)
-- Using these message generators: gencpp;genlisp;genpy
-- Eigen found (include: /usr/include/eigen3)
-- Configuring incomplete, errors occurred!
See also "/home/mk/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/mk/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1cmake_minimum_required(VERSION 2.8.3)
project(chapter2_tutorials)
Invoking "make cmake_check_build_system" failed

and my CMakelists:

cmake_minimum_required(VERSION 2.8.3)
project(chapter2_tutorials)
find_package(catkin REQUIRED COMPONENTS
  roscpp
  std_msgs
  message_generation
)
 Generate added messages and services with any dependencies listed here
 generate_messages(
   DEPENDENCIES
  std_msgs
 )
catkin_package(
  INCLUDE_DIRS include
  LIBRARIES chapter2_tutorials
  CATKIN_DEPENDS roscpp std_msgs
  DEPENDS system_lib
)
include_directories(
  ${catkin_INCLUDE_DIRS}
)
include_directories(
include
${catkin_INCLUDE_DIRS}
)
add_executable(chap2_example1_a src/example1_a.cpp)
add_executable(chap2_example1_b src/example1_b.cpp)
add_dependencies(chap2_example1_a chapter2_tutorials_generate_
messages_cpp)
add_dependencies(chap2_example1_b chapter2_tutorials_generate_
messages_cpp)
target_link_libraries(chap2_example1_a ${catkin_LIBRARIES})
target_link_libraries(chap2_example1_b ${catkin_LIBRARIES})
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-08-17 06:59:07 -0500

gvdhoorn gravatar image

updated 2016-08-20 03:03:05 -0500

If the CMakeLists.txt you included is really a copy-paste, then I'm guessing the

 Generate added messages and services with any dependencies listed here

and the

add_dependencies(chap2_example1_a chapter2_tutorials_generate_
messages_cpp)
add_dependencies(chap2_example1_b chapter2_tutorials_generate_
messages_cpp)

lines are confusing CMake (notice the line-breaks).

The first line ("Generate added messages ..") was originally a comment (so either remove it completely or put back the # in front of it), and the other two commands (add_dependencies(..)) should not be broken up into two lines (ie: each add_dependencies(..) should be on a single line).


Edit:

i said that use hapter 2 of the Learning ROS for Robotics Programming book (2nd ed) so my CMAke is a copy paste file. The line "Generate added messages and services with any dependencies listed here" come in book and ROS.org then can't be comment.

The book has probably wrapped some lines to make the CMakeLists.txt fit better in the overal layout of the text. The add_dependencies(..) lines cannot be split like you have it now. They must be a single line each.

As to the "Generate added messages and services with [..]" line: it doesn't matter what the book has there, that line is not a valid CMake command, so has to be removed: either delete it entirely, or make it a comment by prefixing it with a hash (#).

my problem did not solved.

If you changed things in your CMakeLists.txt and it still doesn't work, please update your original question with the adjusted CMakeLists.txt and any (new) errors you get.

edit flag offensive delete link more

Comments

thank you gvdhoorn.i said that use hapter 2 of the Learning ROS for Robotics Programming book (2nd ed) so my CMAke is a copy paste file.The line "Generate added messages and services with any dependencies listed here" come in book and ROS.org then can't be comment.my problem did not solved.

m.kowsar gravatar image m.kowsar  ( 2016-08-20 01:27:38 -0500 )edit

Btw: it seems like this repository holds the accompanying code for the book you mentioned. Can you compare your CMakeLists.txt to the one in that repository?

gvdhoorn gravatar image gvdhoorn  ( 2016-08-20 03:04:38 -0500 )edit

Question Tools

Stats

Asked: 2016-08-17 06:07:31 -0500

Seen: 568 times

Last updated: Aug 20 '16