You should source setup.bash
of the original (underlay) workspace before building the overlay workspace. Once you have built the overlay workspace, you should be able to source setup.bash
, which will chain the underlay and the overlay together.
From the ament documentation:
The different shell scripts in the
root of the install space are
generated by the ament tool. The
local_setup.* files only iterate over
all packages in the install space (by
reading the list of packages in the
ament index) and source their package
specific setup files. The setup.*
files also consider workspaces outside
of this install space (by reading the
list of parent_prefixp_path in the
ament index) and source them before
the local_setup.* files.
Originally posted by mjcarroll with karma: 6414 on 2018-05-29
This answer was NOT ACCEPTED on the original site
Post score: 2
Original comments
Comment by aks on 2018-05-29:
Once you have built the overlay workspace, you should be able to source setup.bash, which will chain the underlay and the overlay together.
Did you mistype it here, i would be able to source local_setup.bash
after building the overlay space ?
Comment by mjcarroll on 2018-05-29:
If you source local_setup.bash
of the overlay, it will only consider the packages available in the overlay when adding to the environment. setup.bash
will source the underlay and then the overlay, giving you an environment with both workspaces in it.
Comment by aks on 2018-05-29:
@mjccarroll yes exactly this is what i meant. But in this case why should i use setup.bash
to source my overlay space ? this should be possible with local_setup.bash
Comment by mjcarroll on 2018-05-29:
local_setup.sh
exclusively sources the overlay, you will not have any other packages visible from the other workspace. My understanding is that this is not your desired behavior?
Comment by aks on 2018-05-29:
yes,in my case it is the other way round happening which is a bit confusing.
Comment by felixf4xu on 2023-07-17:
@mjccarroll I'm confused by your wording of "overlay" and "underlay".