ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to install package from source as system package?

asked 2021-02-14 23:47:30 -0500

Rufus gravatar image

updated 2021-02-14 23:53:02 -0500

I am trying to set up a docker image which includes some custom source built ROS packages. Of course, the user of this image should not need to care where these custom ROS packages were built, and should be able to use them by simply running source /opt/ros/foxy/setup.bash, i.e. they behave no different from system packages installed with apt install ros-foxy-.... How should I run my build command (colcon build) such that these custom built packages get installed in a path that can be found by sourcing /opt/ros/foxy/setup.bash?

I've read this answer, however, that requires user to source multiple workspaces which is not ideal.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-02-15 01:29:27 -0500

ahcorde gravatar image

Hello,

If you run colcon build -h you will see all the available options. In this case you should use:

  --install-base INSTALL_BASE
                    The base path for all install prefixes (default:
                    install)

Your command should look like: colcon build --install-base /opt/ros/foxy/ ...

edit flag offensive delete link more

Comments

And of course run colcon with the required permissions once it gets to the install step.

In a Docker build that'll probably not be a problem, as you typically run everything as root there, but for regular use this is important, as otherwise CMake/Python/whatever_builds_the_pkgs will not be able to copy files to the /opt/ros prefix.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-15 02:29:04 -0500 )edit

Seems --merge-install is also required or else /opt/ros/foxy will be littered with package directories instead of them being placed nicely in the existing lib, include, share directories

Rufus gravatar image Rufus  ( 2021-02-15 03:22:20 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-02-14 23:47:30 -0500

Seen: 511 times

Last updated: Feb 15 '21