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

Unexpected behaviour of "source devel/setup.bash"

asked 2016-05-25 09:35:57 -0600

Behsad Ghanei gravatar image

OS: Ubuntu 14.04

ROS: Indigo Turtle

Bash: Terminator

Hello,

I have encountered an undesirable behaviour while working with ROS related to sourcing workspaces. First of all I have two workspaces which contain similar packages. The workspaces are: ~/r2d2_CL/... and ~/c3po_CL/... . I had had no problems installing packages, launching nodes and so on, up until today.

Before, I could source either workspace with source devel/setup.bash while being in ~/r2d2_CL/... or ~/c3po_CL/... . As a result ROS_PACKAGE_PATH would contain the proper workspace in which I sourced.

But now something strange happens. Whenever I source now, in either workspace, ROS_PACKAGE_PATH contains both workspaces. The output of printenv | grep ROS is:

ROS_ROOT=/opt/ros/indigo/share/ros
ROS_PACKAGE_PATH=/home/bzad/c3po_CL/src:/home/bzad/r2d2_CL/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks
ROS_MASTER_URI=http://localhost:11311
ROSLISP_PACKAGE_DIRECTORIES=/home/bzad/c3po_CL/devel/share/common-lisp:/home/bzad/r2d2_CL/devel/share/common-lisp
ROS_DISTRO=indigo
ROS_ETC_DIR=/opt/ros/indigo/etc/ros

You can see, that both workspaces are sourced. This has undesirable effects. For example: When I work in ~/r2d2_CL/... and type in the terminal roslaunch vrmagic_camera camera.launch, ROS executes the launchfile which is located in the workspace ~/c3po_CL/... .

My questions regarding this problem are:

  1. How could this happen? Before the problem occured I have installed another package in the workspace ~/r2d2_CL/... . Nothing more.
  2. How can I revert this, so that sourcing will lead to one sourced (desired) workspace again.

Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-05-25 09:50:41 -0600

gvdhoorn gravatar image

Could be that you inadvertently have built your c3po workspace while having sourced the other and vice versa.

Start a clean terminal, then remove the devel and build folders in both workspaces. Now source the distro setup.bash and rebuild c3po. In another terminal, the same with rd2d.

edit flag offensive delete link more

Comments

Thanks for the quick advice, I am going to try that out now.

Edit: It worked, I understood, what went wrong. Thank you!

Behsad Ghanei gravatar image Behsad Ghanei  ( 2016-05-25 09:51:41 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2016-05-25 09:35:57 -0600

Seen: 625 times

Last updated: May 25 '16