Ask Your Question

When should I use catkin workspace?

asked 2016-12-17 14:48:16 -0500

peter1234 gravatar image

updated 2016-12-19 08:24:26 -0500

I dont undestand why should I use catkin worksapce. When I export a package from Moveit Setup Assistant I move it on opt/ros/indigo/share and I launch it with roslaunch di/rec/tory/demo.launch. But the name of the exported package must be the same as the urdf package.

If I move the exported file from Moveit Setup Assistant to home/name/catkin_ws/src and run cakin_make and launch it with roslaunch home/name/catkin_ws/src/<package_name>/launch/demo.launch it gives many errors.

The question: Am I doing the right way or should I use catkin workspace?

Upadate 1: The error was because I was not running this command source devel/setup.bash before catkin_make . Now it works. But if I import urdf file to Moveit Setup Assistant it will load only if it is on opt/ros/indigo/share if i load the urdf file from local work-space the urdf package with meshes is not found.

The question 2: What should I install to local work-space catkin_ws/src (if this is the right path)?

Update 2: catkin_make fails when I install rviz_visual_tools and moveit_tutorials on catkin_ws/src

student@:~/catkin_ws$ source devel/setup.bash
student@:~/catkin_ws$ catkin_make
Base path: /home/student/catkin_ws
Source space: /home/student/catkin_ws/src
Build space: /home/student/catkin_ws/build
Devel space: /home/student/catkin_ws/devel
Install space: /home/student/catkin_ws/install
#### Running command: "make cmake_check_build_system" in "/home/student/catkin_ws/build"
-- Using CATKIN_DEVEL_PREFIX: /home/student/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/student/catkin_ws/devel;/opt/ros/indigo
-- This workspace overlays: /home/student/catkin_ws/devel;/opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/student/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
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 4 packages in topological order:
-- ~~  - assem_moveit_config
-- ~~  - rviz_visual_tools
-- ~~  - moveit_visual_tools
-- ~~  - moveit_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'assem_moveit_config'
-- ==> add_subdirectory(assem_moveit_config)
-- +++ processing catkin package: 'rviz_visual_tools'
-- ==> add_subdirectory(rviz_visual_tools)
CMake Warning at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
  Could not find a package configuration file provided by "graph_msgs" with
  any of the following names:


  Add the installation prefix of "graph_msgs" to CMAKE_PREFIX_PATH or set
  "graph_msgs_DIR" to a directory containing one of the above files.  If
  "graph_msgs" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  rviz_visual_tools/CMakeLists.txt:13 (find_package)

-- Could not find the required component 'graph_msgs'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "graph_msgs" with
  any of the following names:


  Add the installation prefix of "graph_msgs" to CMAKE_PREFIX_PATH or set
  "graph_msgs_DIR" to a directory containing ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-12-18 04:42:13 -0500

gvdhoorn gravatar image

updated 2016-12-18 04:48:34 -0500

Until you are more comfortable with ROS and Catkin, I'd always create a Catkin workspace in your home directory and do all your development in/from there.

Never (*) move packages to /opt/ros/$distro: it's certainly possible to store whatever you want there, but it's likely that you'll do it incorrectly, leading to all sorts of weird and hard to debug problems. Besides: you must have had to either use sudo .. to get the files there, or have run the Setup Assistant as root. It's typically a red flag if you ever need super user rights to do anything in ROS (it's almost a second never (*)).

Treat /opt/ros/$distro as a no-go area, create a workspace and put your own packages in that workspace. Know btw that you'll only have to source your own devel/setup.bash: no need to source the one in /opt/ros/$distro every time as well (do it once, before you catkin_make / catkin build your workspace).

If I [..] run cakin_make and launch [..] roslaunch home/name/catkin_ws/src/<package_name>/launch/demo.launch it gives many errors.

And another tip: please include examples of any errors you get when you ask us questions. We can't know what is going wrong for you, and this makes it very hard for us to help you.

*) well, 'never'. But for now, no, never.

edit flag offensive delete link more


Look on my update please

peter1234 gravatar image peter1234  ( 2016-12-19 07:03:19 -0500 )edit

I don't have time to answer everything right now, but your missing packages are caused by the fact that you didn't install all prerequisites.

Run a rosdep update && rosdep install --from-paths /home/student/catkin_ws/src --ignore-src, then try building again.

gvdhoorn gravatar image gvdhoorn  ( 2016-12-19 08:21:27 -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


Asked: 2016-12-17 14:48:16 -0500

Seen: 1,355 times

Last updated: Dec 19 '16