Problem on zsh - roscd:cd: no such file or directory

asked 2019-08-26 09:03:29 -0500

mun gravatar image

updated 2019-08-26 21:24:52 -0500

Hi all

I'm just getting started with ROS and trying to follow https://wiki.ros.org/ROS/Tutorials/Cr... to create a catkin package. I've done the following on my Mac running zsh:

$ cd /Volumes/Data/Projects/catkin_ws/src
$ catkin_create_pkg beginner_tutorials std_msgs rospy roscpp
$ cd /Volumes/Data/Projects/catkin_ws
$ catkin_make

Base path: /Volumes/Data/Projects/catkin_ws
Source space: /Volumes/Data/Projects/catkin_ws/src
Build space: /Volumes/Data/Projects/catkin_ws/build
Devel space: /Volumes/Data/Projects/catkin_ws/devel
Install space: /Volumes/Data/Projects/catkin_ws/install
####
#### Running command: "cmake /Volumes/Data/Projects/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/Volumes/Data/Projects/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/Volumes/Data/Projects/catkin_ws/install -G Unix Makefiles" in "/Volumes/Data/Projects/catkin_ws/build"
####
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Using CATKIN_DEVEL_PREFIX: /Volumes/Data/Projects/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /Volumes/Data/Projects/catkin_ws/devel;/opt/ros/melodic;/usr/local/opt/qt
-- This workspace overlays: /Volumes/Data/Projects/catkin_ws/devel;/opt/ros/melodic
-- Found PythonInterp: /usr/local/bin/python2 (found suitable version "2.7.16", minimum required is "2")
-- Using PYTHON_EXECUTABLE: /usr/local/bin/python2
-- Using default Python package layout
-- Using empy: /usr/local/lib/python2.7/site-packages/em.pyc
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /Volumes/Data/Projects/catkin_ws/build/test_results
-- Forcing gtest/gmock from source, though one was otherwise available.
-- Found gtest sources under '/Volumes/Data/Projects/googletest': gtests will be built
-- Found gmock sources under '/Volumes/Data/Projects/googletest': gmock will be built
-- Found PythonInterp: /usr/local/bin/python2 (found version "2.7.16")
-- Using Python nosetests: /usr/local/bin/nosetests-2.7
-- catkin 0.7.17
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   gmock
   gmock_main
   gtest
   gtest_main

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Volumes/Data/Projects/catkin_ws/build
####
#### Running command: "make -j4 -l4" in "/Volumes/Data/Projects/catkin_ws/build"
####

$ catkin_ws roscd beginner_tutorials
roscd:[:28: too many arguments
roscd:cd:36: no such file or directory: beginner_tutorials/Volumes/Data/Projects/catkin_ws/src/beginner_tutorials

Anyone know why roscd gives the too many arguments error and it tries to find the path beginner_tutorials/Volumes/Data/Projects/catkin_ws/src/beginner_tutorials?

It runs fine on bash though. Is roszsh meant to be reasonably stable?

edit retag flag offensive close merge delete

Comments

You just write roscd beginner_tutorials right? Because it shouldn't look for beginner_tutorials/Volumes/Data/Projects/catkin_ws/src/beginner_tutorials, it should be looking for /Volumes/Data/Projects/catkin_ws/src/beginner_tutorials

Also when you just type roscd, where it brings you?

ermanas gravatar imageermanas ( 2019-08-26 09:25:22 -0500 )edit

@ermanasroscd gives the error "Neither ROS_WORKSPACE is set nor a catkin workspace is listed in CMAKE_PREFIX_PATH. Please set ROS_WORKSPACE or source a catkin workspace to use roscd with no arguments." ROS_WORKSPACE is indeed not set. I thought it'd be set after running source setup.bash?

mun gravatar imagemun ( 2019-08-26 09:58:43 -0500 )edit

@ermanas I've tried manually setting ROS_WORKSPACE. roscd alone no longer throws an error, but roscd still tries to look for beginner_tutorials/Volumes/Data/Projects/catkin_ws/src/beginner_tutorials. I'm using zsh -- not sure if that makes a difference.

mun gravatar imagemun ( 2019-08-26 20:25:36 -0500 )edit
1

From the output of catkin_make I get the impression that there are some more fundamental problems with your install of ROS @mun. How did you install it? Which version of OSX is this? ROS 1 on OSX support is spotty at best, and typically doesn't really work right now (afaik, I'm not a mac user).

And an observation: if you're using zsh, you should source the setup.zsh file (or whatever the zsh equivalent of source is). Not setup.bash.

gvdhoorn gravatar imagegvdhoorn ( 2019-08-27 03:47:55 -0500 )edit