Ask Your Question
0

How to make roscd go to ~/catkin_ws/devel instead of /opt/ros/kinetic?

asked 2018-03-28 07:30:29 -0500

hc gravatar image

updated 2018-08-08 03:08:34 -0500

jayess gravatar image

I have sourced the setup.bash in the devel folder of catkin_ws but still the roscd command takes to /opt/ros/kinetic

On env | grep ROS, the output is:

ROS_ROOT=/opt/ros/kinetic/
ROS_PACKAGE_PATH=/home/username/catkin_ws/src:/opt/ros/kinetic/share
ROS_MASTER_URI=http://localhost:11311
ROS_VERSION=1
ROS_HOSTNAME=localhost
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=kinetic
ROS_ETC_DIR=/opt/ros/kinetic/etc/ros
edit retag flag offensive close merge delete

Comments

Just to make sure: did you only add the source /home/username/catkin_ws/devel/setup.bash line to your .bashrc, or did you actually source setup.bash/open up a new terminal after adding the line?

Tim Stadtmann gravatar imageTim Stadtmann ( 2018-03-28 08:15:09 -0500 )edit

I added it to .bashrc as well. And then sourced it through terminal also.

hc gravatar imagehc ( 2018-03-28 09:10:47 -0500 )edit

source /opt/ros/kinetic/setup.bash source ~/catkin_ws/devel/setup.bash export ROS_HOSTNAME=localhost export ROS_MASTER_URI=http://localhost:11311 export ROS_ROOT=/opt/ros/kinetic/ export ROS_PACKAGE_PATH=/home/username/catkin_ws/src:${ROS_PACKAGE_PATH}

hc gravatar imagehc ( 2018-03-28 09:11:31 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2018-08-08 02:01:07 -0500

tfoote gravatar image

Without any arguments it goes to the ROS_ROOT by default. There's no way to override that. If you roscd <PACKAGE_NAME> for some <PACKAGE_NAME> in your workspace it should take you to the package's directory.

edit flag offensive delete link more
1

answered 2019-08-16 02:54:57 -0500

tropic gravatar image

Mine did the same for a fresh Melodic installation. The thing is that if you try to use roscd on the newly instantiated catkin_ws with no packages, then it will go to /opt/ros/melodic. If you add a package to src/ and build the workspace, then roscd should take you to ~/catkin_ws/devel/ afterwards.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-03-28 07:30:29 -0500

Seen: 261 times

Last updated: Aug 16