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

[Groovy Beta] Troubles migrating to catkin

asked 2012-12-02 02:55:22 -0600

Kevin gravatar image

updated 2012-12-03 15:38:59 -0600

I installed the groovy base packages following these instructions. I want to convert my packages (I wrote) to catkin so they are "groovy". However, when I run catkin_make, nothing gets built.

I converted my manifest.xml to a package.xml:

<?xml version="1.0"?>
<package>
  <name>serial_node</name>
  <version>0.0.0</version>
  <description>serial_node</description>

  <maintainer email="kevin@todo.todo">kevin</maintainer>


  <license>BSD</license>

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>std_msgs</build_depend>


  <!-- The export tag contains other, unspecified, tags -->
  <export>
    <!-- You can specify that this package is a metapackage here: -->
    <!-- <metapackage/> -->

    <!-- Other tools can request additional information be placed here -->

  </export>
</package>

My CMakeLists.txt is:

cmake_minimum_required(VERSION 2.8.3)
project(serial_node)

## Find catkin and system dependencies

## Find catkin and any catkin packages on which
## this package depends at build time
find_package(catkin REQUIRED COMPONENTS roscpp)

## Declare ROS messages and services

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

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

## Declare things to be passed to other projects
catkin_package(
  INCLUDE_DIRS include
  LIBRARIES ${PROJECT_NAME}
  CATKIN_DEPENDS roscpp std_msgs # catkin-pkg1 catkin-pkg2
#  DEPENDS Boost # other-3rd-party-libraries
)

## Specify additional locations of header files
include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})


## Declare a cpp executable
add_executable(serial_node src/serial_node_service.cpp)

I have sourced setup.bash and my environment is:

[kevin@tardis serial_node]$ env | grep ROS
ROS_ROOT=/opt/ros/groovy/share/ros
ROS_PACKAGE_PATH=/Users/kevin/ros_sandbox/serial_node/src:/opt/ros/groovy/share:/opt/ros/groovy/stacks
ROS_MASTER_URI=http://localhost:11311
ROS_TEST_RESULTS_DIR=/Users/kevin/ros_sandbox/serial_node/build/test_results
ROS_OS_OVERRIDE=osx:homebrew
ROS_NO_SUDO_PIP=True
ROS_DISTRO=groovy
ROS_ETC_DIR=/opt/ros/groovy/etc/roslib

In the package directory, when I run catkin_make I don't get any binaries in the devel or build folder.

[kevin@tardis serial_node]$ catkin_make
Base path: /Users/kevin/ros_sandbox/serial_node
Source space: /Users/kevin/ros_sandbox/serial_node/src
Build space: /Users/kevin/ros_sandbox/serial_node/build
Devel space: /Users/kevin/ros_sandbox/serial_node/devel
Install space: /Users/kevin/ros_sandbox/serial_node/install
####
#### Running command: "cmake /Users/kevin/ros_sandbox/serial_node/src -DCATKIN_DEVEL_PREFIX=/Users/kevin/ros_sandbox/serial_node/devel -DCMAKE_INSTALL_PREFIX=/Users/kevin/ros_sandbox/serial_node/install" in "/Users/kevin/ros_sandbox/serial_node/build"
####
-- The C compiler identification is Clang 4.1.0
-- The CXX compiler identification is Clang 4.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using CATKIN_DEVEL_PREFIX: /Users/kevin/ros_sandbox/serial_node/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/groovy
-- This workspace overlays: /opt/ros/groovy
-- Found PythonInterp: /usr/bin/python (found version "2.7.2") 
-- Found PY_em: /Library/Python/2.7/site-packages/em.pyc  
-- Found gtest: gtests will be built
-- catkin 0.5.52
-- BUILD_SHARED_LIBS is on
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/kevin/ros_sandbox/serial_node/build
####
#### Running command: "make -j2" in "/Users/kevin/ros_sandbox ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
5

answered 2012-12-03 15:57:46 -0600

jbohren gravatar image

Kevin, does this clear up any of the confusion? http://www.ros.org/wiki/catkin/what#How_To_Use_Catkin_Packages

edit flag offensive delete link more

Comments

1

Yes, it helps ... things are beginning to compile ... this is much different than I had thought. I was mainly reading the migration stuff ...

Kevin gravatar image Kevin  ( 2012-12-03 16:11:37 -0600 )edit
3

Yeah, this is a page where I've been trying to maintain a catkin brief for those who just want to skip all the design details. If you find anything in catkin or the official documentation confusing or counter-intuitive, please comment on it here.

jbohren gravatar image jbohren  ( 2012-12-03 16:15:28 -0600 )edit
2

answered 2012-12-02 23:58:09 -0600

KruseT gravatar image

catkin_make does not behave like rosmake. You have to go into your workspace folder (/Users/kevin/ros_sandbox) and run it from there. Also, delete the folder /Users/kevin/ros_sandbox/serial_node/build.

edit flag offensive delete link more

Comments

1

I tried that, but it doesn't work. My source code is located at ~/ros_sandbox/serial_node/src ... my workspace should be at the serial_node level with build, devel, src all there. If this isn't correct I am confused. This also isn't clear.

Kevin gravatar image Kevin  ( 2012-12-03 14:15:32 -0600 )edit
1

So, you are saying that my source files ( eg, some_file.cpp) is not stored in the package, but up a level? That makes no sense.

Kevin gravatar image Kevin  ( 2012-12-03 15:30:34 -0600 )edit

Please see the above linked docs to clarify how a catkin workspace looks like and the terms for the different folders. The previous comment referred to the "src" folder of the workspace. Your package should be checked out in there. Then catkin_make is invoked in the root of the workspace.

Dirk Thomas gravatar image Dirk Thomas  ( 2012-12-05 15:31:40 -0600 )edit

Question Tools

Stats

Asked: 2012-12-02 02:55:22 -0600

Seen: 1,711 times

Last updated: Dec 03 '12