relocate ros2 install from a source build

asked 2021-09-14 13:47:31 -0500

strike_eagle_iii gravatar image

updated 2021-09-29 09:23:52 -0500

What is the best way to move a ros2 installation from one machine to another? Is it a matter of just copying the entire /opt/ros directory? or are their other dependencies as well? The rub and motivating case is that I'm building ros2 galactic from source on Ubuntu 18.04. It would be nice to be able to install on a number of machines without have to build from source on each one.

edit retag flag offensive close merge delete

Comments

Of course there are "other dependencies". If only the many build dependencies used to build your binaries, and the related run dependencies (ie: runtime libraries, etc).

gvdhoorn gravatar image gvdhoorn  ( 2021-09-29 13:54:57 -0500 )edit

Care to elaborate what they might be?...or maybe a better question is what dependencies are needed specifically to build from source that aren't needed for normal use? This be passed to other machines via a docker image and I'd like to keep the image as slim as reasonably possible.

strike_eagle_iii gravatar image strike_eagle_iii  ( 2021-09-29 18:17:15 -0500 )edit

When building from source, you go through the sections to setup your system in order for the build to succeed.

Almost all of the steps where you use pip or apt install dependencies.

ROS (1 or 2, doesn't matter) is like an SDK: it's a set of building blocks which you use to create other applications with. And in order to be able to build those applications, you almost invariably need at least the exact same set of dependencies (build and run) as you need to build ROS itself.

So while it is possible to figure out the run dependencies (rosdep supports querying packages for just their exec_depends fi), I'm wondering whether that will actually work. If you're looking to only deploy an application, you can do this. If those other installs are going to be used for any sort of development (ie: build a ...(more)

gvdhoorn gravatar image gvdhoorn  ( 2021-09-30 02:10:21 -0500 )edit

If this is more than a one-time-thing, you may want to look at things like Clearpaths bundle approach, or Bloom's support for generating debian packaging, or try to mimic the way the Linux tarball is built (not documented there, just linking to where that tarball is used to install ROS 2).

As a direct answer to the question "how do I only install the exec_depends of packages: rosdep install --from-paths /path/to/your/ros/install -i --dependency-types=exec. Note that this is a relatively new addition, and many packages don't distinguish between their exec or build dependencies. Your mileage may vary.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-30 02:16:39 -0500 )edit