Ask Your Question
1

Failing to create catkin workspace

asked 2014-07-29 02:04:57 -0500

schultza gravatar image

updated 2014-07-30 02:02:55 -0500

Hey,

I tried to go through this tutorial Tutorial: Using a URDF in Gazebo but I failed in the first steps. I gitcloned the RRbot stuff and tried catkin_make. But no success. After this i tried to set up a complete new catkin workspace, just to make sure there is no error in my catkin workspace. But also with a new and plain catkin workspace it didnt work.

The error i get is here:

schultza@Andreas:~/catkin_ws$ catkin_make
Base path: /home/schultza/catkin_ws
Source space: /home/schultza/catkin_ws/src
Build space: /home/schultza/catkin_ws/build
Devel space: /home/schultza/catkin_ws/devel
Install space: /home/schultza/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/schultza/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/schultza/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/schultza/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.9    
-- Using these message generators: gencpp;genlisp;genpy
-- Boost version: 1.54.0
You have called ADD_LIBRARY for library ... without any source files. This typically indicates a problem with your                CMakeLists.txt file
CMake Error: File /home/schultza/catkin_ws/src/package.xml does not exist.
CMake Error at /opt/ros/indigo/share/catkin/cmake/stamp.cmake:10 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  /opt/ros/indigo/share/catkin/cmake/catkin_package_xml.cmake:61 (stamp)
  /opt/ros/indigo/share/catkin/cmake/catkin_package_xml.cmake:39 (_catkin_package_xml)
  /opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:95 (catkin_package_xml)
  CMakeLists.txt:77 (catkin_package)


CMake Error at /opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:112 (message):
  catkin_package() 'catkin' must be listed as a buildtool dependency in the
  package.xml
Call Stack (most recent call first):
  /opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:98 (_catkin_package)
  CMakeLists.txt:77 (catkin_package)


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

Maybe someone of you can help me. Im using ROS-indigo and Gazebo 2.2


Edit#1: Workspace structure

my workspace looks something like this:

catkin_ws
  build
  devel
  install
  src
    Package A
      (In almost every Package)
      include
      launch
      src
      worlds
      CMakeLists.txt
      package.xml
    Package B
    Package ....
    CMakeLists.txt
  RemoteSystemTempFiles

Sry for the bad formatting


Edit#2: Creating an empty workspace

schultza@Andreas:~$ source /opt/ros/indigo/setup.bash
schultza@Andreas:~$ mkdir -p ~/catkin_ws2/src
schultza@Andreas:~$ cd ~/catkin_ws2/src/
schultza@Andreas:~/catkin_ws2/src$ catkin_init_workspace
Creating symlink "/home/schultza/catkin_ws2/src/CMakeLists.txt" pointing to                     "/opt/ros/indigo/share/catkin/cmake/toplevel.cmake"
schultza@Andreas:~/catkin_ws2/src$ cd ~/catkin_ws2
schultza@Andreas:~/catkin_ws2$ catkin_make
Base path: /home/schultza/catkin_ws2
Source space: /home/schultza/catkin_ws2/src
Build space: /home/schultza/catkin_ws2/build
Devel space: /home/schultza/catkin_ws2/devel
Install space: /home/schultza/catkin_ws2/install ...
(more)
edit retag flag offensive close merge delete

Comments

> CMake Error: File /home/schultza/catkin_ws/src/package.xml does not exist. This is strange: can you show us the layout of your workspace?

gvdhoorn gravatar imagegvdhoorn ( 2014-07-29 02:07:13 -0500 )edit

sry this didnt work see my main post

schultza gravatar imageschultza ( 2014-07-29 02:12:36 -0500 )edit
BennyRe gravatar imageBennyRe ( 2014-07-29 02:31:02 -0500 )edit

Yes, as I said i tried to create a complete new workspace (with this tutorial you posted) and the same error occured

schultza gravatar imageschultza ( 2014-07-29 02:48:30 -0500 )edit

So just creating (in a fresh shell) a directory structure like `catkin_ws/src`, then `cd catkin_ws` and `catkin_make` also doesn't work? So basically building an empty ws?

gvdhoorn gravatar imagegvdhoorn ( 2014-07-29 02:53:32 -0500 )edit

Are you building from within eclipse? The `RemoteSystemTempFiles` seems to suggest you do.

gvdhoorn gravatar imagegvdhoorn ( 2014-07-29 02:54:23 -0500 )edit

I exactly tried to build an empty ws as you described above and it failed with same error. I tried once to use eclipse but didnt go further with it and stopped to use it, but it wasnt a problem times before

schultza gravatar imageschultza ( 2014-07-29 03:20:02 -0500 )edit

Ok that's strange. Please again create a fresh and empty workspace and post the output of the initial catkin_make.

BennyRe gravatar imageBennyRe ( 2014-07-29 03:53:23 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-07-29 16:52:30 -0500

William gravatar image

You should never edit the boilerplate toplevel.cmake file. This code should be removed:

project(YOURROBOT_gazebo_plugins)

find_package(catkin REQUIRED COMPONENTS
  gazebo_ros
)

# Depend on system install of Gazebo
find_package(gazebo REQUIRED)

include_directories(include ${catkin_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS} ${SDFormat_INCLUDE_DIRS})

# Build whatever you need here
#add_library(...) # TODO

catkin_package(
    DEPENDS
      gazebo_ros
    CATKIN_DEPENDS
    INCLUDE_DIRS
    LIBRARIES
)

If I am following your example correctly then that means you have actually edited the toplevel.cmake template file located at /opt/ros/indigo/share/catkin/cmake/toplevel.cmake and you should make sure you fix that one too.

edit flag offensive delete link more

Comments

Hey thank you, it is still not working for my original workspace but if I create a new plain workspace it is! Please see my Edit#4 for the output while catkin_make of my original workspace

schultza gravatar imageschultza ( 2014-07-30 02:01:12 -0500 )edit

But i dont get it or I do something wrong... In here http://gazebosim.org/tutorials/?tut=ros_overview they say i need to reconfigure my CMakeLists.txt, so I go to my current workspace in src and do it, but after this also my toplevel.cmake is reconfiguerd, where is the link between those?

schultza gravatar imageschultza ( 2014-07-30 02:08:44 -0500 )edit

So if I change the CMakeLists.txt in current workspace src folder also the toplevel.cmake changes

schultza gravatar imageschultza ( 2014-07-30 02:12:53 -0500 )edit
1

Yes - you should edit the CMakeLists.txt in your package - not the top-level CMakeLists.txt in your workspace. The top-level CMakeLists.txt is a symlink to toplevel.cmake, which is created by catkin the first time you run catkin_make.

ahendrix gravatar imageahendrix ( 2014-07-30 02:16:43 -0500 )edit

As a rule of thumb never edit anything under /opt/ros

BennyRe gravatar imageBennyRe ( 2014-07-30 02:29:52 -0500 )edit

Ok so it is menat to be that the toplevel.cmake changes within changing the CMakeLists.txt of my package?

schultza gravatar imageschultza ( 2014-07-30 02:35:40 -0500 )edit

No: the catkin_ws/src/CMakeLists.txt _points_ to /opt/ros/indigo/share/catkin/cmake/toplevel.cmake, they are the same file. You should edit the files in your own package, ie: catkin_ws/src/my_package/CMakeLists.txt. Perhaps http://www.nixtutor.com/freebsd/understanding-symbolic-links/ would help.

gvdhoorn gravatar imagegvdhoorn ( 2014-07-30 03:00:28 -0500 )edit

Actually that answer worked, there were just followed errors by an error in my workspace folders

schultza gravatar imageschultza ( 2014-07-31 09:14:34 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-07-29 02:04:57 -0500

Seen: 7,388 times

Last updated: Jul 30 '14