Using at the same time a binary installed and a source installed version of a package [..] is it possible to manage (and how) two different versions of the package as I have described?
Yes, create two workspaces, and make sure to put the "source version" only in one of those workspaces.
Make sure to not auto source
anything, and source
each workspace in its own terminal.
Now you can start the released version and the built-from-source version each from their own workspace.
Make sure not to source
both workspaces in the same terminal, otherwise one will overlay the other and you will lose access to either the from-deb
or the from-source` version.
Originally posted by gvdhoorn with karma: 86574 on 2020-04-13
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by ale on 2020-04-13:
Thanks for the reply, but I have a doubt. In this way I can not do the "source" in the workspace where I installed the one from the source and not use it (while I use the other), however it is not clear how to do the opposite, the one installed by binaries is inserted in the ROS path, the only way to exclude it is not to "source" the ROS path, not being able to use everything else.
Comment by gvdhoorn on 2020-04-13:\
the one installed by binaries is inserted in the ROS path, the only way to exclude it is not to "source" the ROS path, not being able to use everything else.
No, that's not how it works.
Packages in overlaid workspaces will take precedence over packages in lower layers.
So if pkg A
is only present in /opt/ros
, you'll execute its binaries. If you have pkg A
in your workspace and in /opt/ros
, the A
in your workspace will be used. Refer to wiki/catkin/Tutorials/workspace_overlaying for more information about workspace overlaying.
Comment by ale on 2020-04-13:
Oh perfect thanks, everything is clear now. I'm sorry I opened a new question when there was already a clear tutorial on the subject but I hadn't really found it.