Cannot roslaunch file after source workspaces

asked 2022-03-27 21:50:16 -0500

lzyr gravatar image

Hi,

There's something wrong with my roslaunch. I have created 2 catkin workspaces (denoted by A_ws and B_ws), and sourced them in ~/.bashrc. However, when ~/.bashrc file looks like:

source ~/A_ws/devel/setup.bash
source ~/B_ws/devel/setup.bash

only packages in B can be launched but packages in A can not:

[.launch] is neither a launch file in package [] nor is [] a launch file name

When I switch these lines,

source ~/B_ws/devel/setup.bash
source ~/A_ws/devel/setup.bash

only packages in A can be launched. So the question is, how can I launch files in the two workspaces simultaneously?

Thanks for help!

edit retag flag offensive close merge delete

Comments

Petros ADLATUS gravatar image Petros ADLATUS  ( 2022-03-28 01:16:34 -0500 )edit

Thanks, but it doesn't help with the source problem.

lzyr gravatar image lzyr  ( 2022-03-28 03:25:49 -0500 )edit

You cannot source multiple "sibling workspaces" (*). You can only use workspace overlaying, in which A_ws underlays B_ws (or the other way around).

To put it in other words: when you source ~/B_ws/devel/setup.bash, you essentially overwrite the environment configured by source ~/A_ws/devel/setup.bash.

(* technically this isn't completely true, but if you're just starting out, I would follow this rule)

gvdhoorn gravatar image gvdhoorn  ( 2022-03-29 03:34:15 -0500 )edit

Thanks for explanation, I'll try.

lzyr gravatar image lzyr  ( 2022-03-29 06:26:10 -0500 )edit