The colcon plugin

The colcon plugin is useful when building ROS 2 parts that use colcon.

This plugin uses the common plugin keywords as well as those for “sources”. For more information, see Snapcraft parts metadata.

Additionally, this plugin uses the following plugin-specific keywords:

  • colcon-packages (list of strings)
    List of colcon packages to build. If not specified, all packages in the
    workspace will be built. If set to an empty list ([]), no packages will
    be built, which could be useful if you only want ROS debs in the snap.
  • colcon-source-space (string)
    The source space containing colcon packages (defaults to src).
  • colcon-rosdistro (string)
    The ROS distro to use. Available options are bouncy and crystal (defaults to
    crystal), both of which are only compatible with core18 as the base.
  • colcon-cmake-args (list of strings)
    Arguments to pass to cmake projects. Note that any arguments here which match
    colcon arguments need to be prefixed with a space. This can be done by quoting
    each argument with a leading space.
  • colcon-catkin-cmake-args (list of strings)
    Arguments to pass to catkin packages. Note that any arguments here which match
    colcon arguments need to be prefixed with a space. This can be done by quoting
    each argument with a leading space.
  • colcon-ament-cmake-args (list of strings)
    Arguments to pass to ament_cmake packages. Note that any arguments here which
    match colcon arguments need to be prefixed with a space. This can be done by
    quoting each argument with a leading space.

See the catkin plugin for building ROS 1 parts.

For a simple example, see ROS 2 applications, or search GitHub for projects already using the plugin.

This is a snapcraft plugin. See Snapcraft plugins and Supported plugins for further details on how plugins are used.

Last updated 11 days ago. Help improve this document in the forum.