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

beginner tutorials msg srv catkin_make error

asked 2015-12-14 15:25:54 -0500

Nimirium gravatar image

Hey, I'm doing the srv/msg tutorial ( http://wiki.ros.org/ROS/Tutorials/Cre... ), and I'm having an error when i use catkin_make, after changing the CMakeLists.txt and package.xml and generally following the tutorial (and the previous tutorials).

I'm totally new to ROS, and It'll be great if someone can help me out, because I'm pretty lost. After having this error I even tried deleting my progress and recreating it, only to get this same error message again.

Here's my error:

sophie@sophie-HP-ProBook-4520s:~/catkin_ws$ catkin_make
Base path: /home/sophie/catkin_ws
Source space: /home/sophie/catkin_ws/src
Build space: /home/sophie/catkin_ws/build
Devel space: /home/sophie/catkin_ws/devel
Install space: /home/sophie/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/sophie/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/sophie/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/sophie/catkin_ws/devel;/opt/ros/indigo
-- This workspace overlays: /home/sophie/catkin_ws/devel;/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/sophie/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.16
-- BUILD_SHARED_LIBS is on
WARNING: Package "ompl" does not follow the version conventions. It should not contain leading zeros (unless the number is 0).
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;genlisp;genpy
-- beginner_tutorials: 1 messages, 1 services
-- BUILD_SHARED_LIBS is on
WARNING: Package "ompl" does not follow the version conventions. It should not contain leading zeros (unless the number is 0).
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkin_workspace.cmake:116 (add_subdirectory):
  The binary directory

    /home/sophie/catkin_ws/build/beginner_tutorials

  is already used to build a source directory.  It cannot be used to build
  source directory

    /home/sophie/catkin_ws/src/beginner_tutorials

  Specify a unique binary directory name.
Call Stack (most recent call first):
  CMakeLists.txt:125 (catkin_workspace)


-- Configuring incomplete, errors occurred!
See also "/home/sophie/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/sophie/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

Also, I added these two lines to my package.xml:

  <build_depend>message_generation</build_depend>
  <run_depend>message_runtime</run_depend>

And my CMakeLists.txt looks like this:

(It's mostly comments. All according to the tutorials, I hope)

cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  message_generation
)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare ...
(more)
edit retag flag offensive close merge delete

Comments

I have seen this error when the catkin workspace's CMake gets moved inside of a package. That may be your issue.

evanS gravatar image evanS  ( 2016-05-04 18:02:37 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-06-12 17:07:40 -0500

Here I leave the required files, also consider changing to catkin build instead of catkin_make, is a better build system. You can install by doing sudo apt install python-catkin-tools python3-catkin-tools

CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

find_package(catkin REQUIRED COMPONENTS
    roscpp
    std_msgs
    message_generation
)

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

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

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

catkin_package(
    INCLUDE_DIRS
    LIBRARIES beginner_tutorials
    CATKIN_DEPENDS roscpp std_msgs message_runtime
    DEPENDS
)

package.xml

<?xml version="1.0"?>
<package>
<name>beginner_tutorials</name>
<version>0.0.1</version>
<description>tutorial</description>
<maintainer email="foo@bar.com">Foo Author</maintainer>
<license>BSD</license>
<url type="website">https://foo.com</url>

<buildtool_depend>catkin</buildtool_depend>

<build_depend>roscpp</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>message_generation</build_depend>

<run_depend>roscpp</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>message_runtime</run_depend>

</package>

msg/Num.msg

int64 num

srv/AddTwoInts.srv

int64 a
int64 b
---
int64 sum
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-12-14 15:25:54 -0500

Seen: 1,198 times

Last updated: Jun 12 '19