How colcon knows the history of sourced workspaces?

asked 2022-12-17 02:23:36 -0600

jorge gravatar image

Hi all,

I'm starting with ROS 2, but I need to use both ROS 1 noetic and ROS 2 foxy on the same machine.

I have created separated workspaces, all clean and tidy: when switching from one to the other, I reset all ROSxxxx env variables, and PATH and PYTHONPATH

BUT, I'm using a terminal session that I used before with noetic

Then, after building my workspace and sourcing install/setup.bash, I get

ROS_DISTRO was set to 'foxy' before. Please make sure that the environment does not mix paths from different distributions.
ROS_DISTRO was set to 'noetic' before. Please make sure that the environment does not mix paths from different distributions.

I inspected the content of install/setup.bash I found

....
# source chained prefixes
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
COLCON_CURRENT_PREFIX="/opt/ros/noetic"
_colcon_prefix_chain_bash_source_script "$COLCON_CURRENT_PREFIX/local_setup.bash"
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
COLCON_CURRENT_PREFIX="/home/jorge/rapyuta_ws/io_amr/devel"
_colcon_prefix_chain_bash_source_script "$COLCON_CURRENT_PREFIX/local_setup.bash"
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
COLCON_CURRENT_PREFIX="/opt/ros/foxy"
_colcon_prefix_chain_bash_source_script "$COLCON_CURRENT_PREFIX/local_setup.bash"
....

So my question is, where is this history of sourced workspaces stored? I cannot find any environment variable not file containing it. My intention is to find a way to reset it, so I don't need to worry about opening new terminal sessions (another tab is not enough) when witching between ROS 1 and 2

Thanks a lot for any hint!

edit retag flag offensive close merge delete