Hi everyone,

I tried to follow tutorials for rviz in http://wiki.ros.org/rviz/Tutorials/Ma...

However, after I did it step by step, ros cannot find the package even though I have sourced setup.bash. Can someone help me out? Great thanks!!!

z1huo@z1huo-ThinkPad-P51:~$catkin_create_pkg using_markers roscpp visualization_msgs usage: catkin_create_pkg [-h] [--meta] [-s [SYS_DEPS [SYS_DEPS ...]]] [-b [BOOST_COMPS [BOOST_COMPS ...]]] [-V PKG_VERSION] [-D DESCRIPTION] [-l LICENSE] [-a AUTHOR] [-m MAINTAINER] [--rosdistro ROSDISTRO] name [dependencies [dependencies ...]] catkin_create_pkg: error: File exists: /home/z1huo/using_markers/CMakeLists.txt z1huo@z1huo-ThinkPad-P51:~$ cd ~/catkin_ws

z1huo@z1huo-ThinkPad-P51:~/catkin_ws$catkin_make Base path: /home/z1huo/catkin_ws Source space: /home/z1huo/catkin_ws/src Build space: /home/z1huo/catkin_ws/build Devel space: /home/z1huo/catkin_ws/devel Install space: /home/z1huo/catkin_ws/install #### #### Running command: "make cmake_check_build_system" in "/home/z1huo/catkin_ws/build" #### #### #### Running command: "make -j8 -l8" in "/home/z1huo/catkin_ws/build" #### [ 0%] Built target std_msgs_generate_messages_lisp [ 0%] Built target std_msgs_generate_messages_nodejs [ 0%] Built target std_msgs_generate_messages_eus [ 0%] Built target std_msgs_generate_messages_cpp [ 0%] Built target std_msgs_generate_messages_py [ 0%] Built target _beginner_tutorials_generate_messages_check_deps_AddTwoInts [ 0%] Built target _beginner_tutorials_generate_messages_check_deps_Num [ 15%] Built target beginner_tutorials_generate_messages_lisp [ 46%] Built target beginner_tutorials_generate_messages_py [ 69%] Built target beginner_tutorials_generate_messages_eus [ 84%] Built target beginner_tutorials_generate_messages_cpp [100%] Built target beginner_tutorials_generate_messages_nodejs [100%] Built target beginner_tutorials_generate_messages z1huo@z1huo-ThinkPad-P51:~/catkin_ws$ source devel/setup.bash

z1huo@z1huo-ThinkPad-P51:~/catkin_ws$rosrun using_markers basic_shapes [rospack] Error: package 'using_markers' not found  edit retag close merge delete ## 1 Answer Sort by » oldest newest most voted The problem is that z1huo@z1huo-ThinkPad-P51:~$ catkin_create_pkg using_markers roscpp visualization_msgs


was executed from your home directory rather than in the source space (src directory) of your workspace. Therefore, it can't be found by catkin_make. It's easy to miss (and misunderstand), but in the tutorial that you linked to it tells you (my emphasis added)

Before getting started, let's create a package called using_markers, somewhere in your package path:

catkin_create_pkg using_markers roscpp visualization_msgs


This basically means to run that command from the src directory of a catkin workspace. Now, try the same command, but from your src directory just as follows

z1huo@z1huo-ThinkPad-P51:~/catkin_ws/src\$ catkin_create_pkg using_markers roscpp visualization_msgs


These are pretty basic concepts (that you need to put packages in the src directory and compile from the root of your workspace), so I suggest that you go through the tutorials on the wiki until these concepts are really driven in.

more

Make sure to use the advice that @gvdhoorn gave you in one of your previous questions (#q292904) which is basically what I've outlined here. (As a side note, you should also accept that answer as it tells you how to solve your issue.)

( 2018-06-10 20:05:15 -0600 )edit