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

ROS_PACKAGE_PATH erased every time I source devel/setup.bash

asked 2019-02-21 09:40:28 -0500

Poutchi gravatar image

updated 2019-02-21 09:40:47 -0500

Hello,

I need your help on what appears like a bug in catkin. I have two workspaces

  • catkin_ws1 contains :
    • pkg1
    • pkg2
  • catkin_ws2 contains :
    • pkgA
    • pkgB

If I source the setup of catkin_ws1 and echo ROS_PACKAGE_PATH everything works as expected

cd ~/catkin_ws1
source deve/setup.bash
echo $ROS_PACKAGE_PATH
~/catkin_ws1/src/pkg1:~/catkin_ws1/src/pkg2:/opt/ros/kinetic/share

When I source the setup of the second workspace catkin_ws2 the old ROS_PACKAGE_PATH is erased

cd ~/catkin_ws2
source deve/setup.bash
echo $ROS_PACKAGE_PATH
~/catkin_ws1/src/pkgA:~/catkin_ws1/src/pkgB:/opt/ros/kinetic/share

I lose the ~/catkin_ws1/src/pkg1:~/catkin_ws1/src/pkg2

Is there a problem in my configuration or is it an issue related to catkin ?

Config

  • catkin_tools 0.4.4
  • Python 2.7.12
  • GCC 5.4.0
  • ros kinetic

Cheers,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-02-21 10:16:55 -0500

Dirk Thomas gravatar image

There is no problem and what you see is intentional behavior. Assuming that you have build catkin_ws2 without catkin_ws1 being source before.

When you source a workspaces setup file you will get the environment available at its build time + the environment for that workspace.

See https://answers.ros.org/question/6470... for a similar question which describes a workaround (sourcing the second workspace with the option --extend) but also mentioning the potential pitfalls.

edit flag offensive delete link more

Comments

Thank you for your clear answer.

Poutchi gravatar image Poutchi  ( 2019-02-22 02:58:06 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-02-21 09:40:28 -0500

Seen: 239 times

Last updated: Feb 21 '19