ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

You should not manually adapt the ROS_PACKAGE_PATH. This will get overwritten every time you source a setup.bash. And there, last sourced setup.bash wins.

You need to chain your workspaces correctly.

Let me give you a short example.

You start with source /opt/ros/indigo/setup.bash, this gives you:

/opt/ros/indigo/share:/opt/ros/indigo/stacks

You now create a workspace in ~/catkin_ws, do a catkin_make and source ~/catkin_ws/devel/setup.bash. This gives you:

/home/USER/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks

You will get this every time you source ~/catkin_ws/devel/setup.bash, no matter which other setup.bash you sourced before.

If you now create another workspace, catkin_ws_overlay you can do two things:

  1. source /opt/ros/indigo/setup.bash, catkin_make your new ws catkin_ws_overlay and soruce ~/catkin_ws_overlay/devel/setup.bash. This will give you

    /home/USER/catkin_ws_overlay/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks
    
  2. or source ~/catkin_ws/devel/setup.bash, catkin_make your new ws catkin_ws_overlay and source ~/catkin_ws_overlay/devel/setup.bash. This will give you

    /home/USER/catkin_ws_overlay/src:/home/USER/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks
    

    with this, you have "chained" your workspaces such that it first searches catkin_ws_overaly, then catkin_ws and then /opt/ros.

If you want to undo a chaining, simply delete the build, devel and (potentially) install folder, source the setup.bash you want and compile again.