ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The issue is with your ROS_PACKAGE_PATH
. roscd
brings you to the first workspace on the path.
So they should be the other way around on you package path.
I highly discourage from manually fiddling with the ROS_PACKAGE_PATH
variable (if you've done that or plan on doing that). Also note that you don't need to have multiple source
statements for workspaces in your .bashrc. With catkin
, the last setting wins.
I suggest you clean your workspace, clean the bashrc, start a new terminal (without any ROS environment sourced), then do manually source /opt/ros/melodic/setup.bash
, build your workspace, and then source the workspaces setup.bash
. I'm assuming the package path is then in the correct order and your roscd
should work the way you want. If you want your workspace to be automatically sourced, put only the source command of your workspace into the bashrc.
2 | No.2 Revision |
The issue is with your ROS_PACKAGE_PATH
. roscd
brings you to the first workspace on the path.
So they should be the other way around on you package path.
I highly discourage from manually fiddling with the ROS_PACKAGE_PATH
variable (if you've done that or plan on doing that). Also note that you don't need to have multiple source
statements for workspaces in your .bashrc. With catkin
, the last setting wins.
I suggest you you
build
, devel
and logs
folder, if they exist; if you've built with catkin-tools
, you can use the catkin clean
command)source
commands that source a ROS workspace)source /opt/ros/melodic/setup.bash
setup.bash
I'm assuming the package path is then in the correct order and your roscd
should work the way you want. If you want your workspace to be automatically sourced, put only the source command of your workspace into the bashrc.