roscd cannot find the package
Everytime I compile a package I'm working on, or try to use a new package, ROS cannot find the package. I've even restarted from scratch. For example, this afternoon I'm trying to run a publisher for an imu. So I started from scratch because nothing is working, again. After 30 minuts of looking for a mistake, googling, etc. it just starts to work. This is what I'm doing:
myuser@mypc:$ cd ros
myuser@mypc:$ rm -rf *
myuser@mypc:$ mkdir src
myuser@mypc:$ cd src
myuser@mypc:$ catkin_init_workspace
myuser@mypc:$ cp -r ~/develeopment/imu .
myuser@mypc:$ cd ..
myuser@mypc:$ catkin_make
Base path: /home/myuser/development/ros
Source space: /home/myuser/development/ros/src
Build space: /home/myuser/development/ros/build
Devel space: /home/myuser/development/ros/devel
Install space: /home/myuser/development/ros/install
####
#### Running command: "cmake /home/myuser/development/ros/src -DCATKIN_DEVEL_PREFIX=/home/myuser/development/ros/devel -DCMAKE_INSTALL_PREFIX=/home/myuser/development/ros/install -G Unix Makefiles" in "/home/myuser/development/ros/build"
####
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- 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: /home/myuser/development/ros/devel
-- Using CMAKE_PREFIX_PATH: /home/myuser/development/ros/devel;/opt/ros/indigo
-- This workspace overlays: /home/myuser/development/ros/devel;/opt/ros/indigo
-- Found PythonInterp: /usr/bin/python (found version "2.7.6")
-- 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/myuser/development/ros/build/test_results
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.14
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 1 packages in topological order:
-- ~~ - imu_3dm_gx4
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'imu_3dm_gx4'
-- ==> add_subdirectory(imu_3dm_gx4)
-- Using these message generators: gencpp;genlisp;genpy
-- imu_3dm_gx4: 1 messages, 0 services
-- Boost version: 1.54.0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/myuser/development/ros/build
####
#### Running command: "make -j4 -l4" in "/home/myuser/development/ros/build"
####
Scanning dependencies of target _imu_3dm_gx4_generate_messages_check_deps_FilterOutput
Scanning dependencies of target geometry_msgs_generate_messages_cpp
Scanning dependencies of target geometry_msgs_generate_messages_py
Scanning dependencies of target std_msgs_generate_messages_cpp
[ 0%] [ 0%] [ 0%] Built target geometry_msgs_generate_messages_cpp
Built target geometry_msgs_generate_messages_py
Built target std_msgs_generate_messages_cpp
Scanning dependencies of target roscpp_generate_messages_cpp
Scanning dependencies of target rosgraph_msgs_generate_messages_py
Scanning dependencies of target std_msgs_generate_messages_lisp
[ 0%] Built target roscpp_generate_messages_cpp
[ 0%] [ 0%] Built target rosgraph_msgs_generate_messages_py
[ 0%] Built target std_msgs_generate_messages_lisp
Scanning dependencies of target sensor_msgs_generate_messages_py
Built ...
I see you edited your terminal log to use
catkin_init_workspace
. Did my answer fix your issue?