Catkin Tools plugin

The Catkin Tools plugin builds ROS 1 parts using the catkin CLI tool.

In Snapcraft 8, this plugin depends on the Catkin plugin for configuration. Both these plugins can be used in combination with the ROS 1 extension to build core20 snaps.

Keywords

This plugin uses the same keys as the Catkin plugin, and provides the following unique keys for core20 snaps.

catkin-tools-packages

Type: list of strings Default: all workspace packages

The list of catkin packages to build. If not set, all packages in the catkin workspace are built. If set to an empty list, no packages are built, and the snap will only contain Debian packages for ROS 1.

catkin-tools-cmake-args

Type: list of strings Default: []

The arguments to pass to CMake.

Dependencies

For core20 snaps, this plugin installs python3-catkin-tools and any other ROS 1 packages declared in the part.

If the project isn’t using the ROS 1 extension, the part must set the ROS_DISTRO environment variable like so:

snapcraft.yaml
build-environment:
  - ROS_DISTRO: "noetic"

How it works

The Catkin plugin is designed to work alongside the ROS 1 extension.

During the build step, the plugin performs the following actions:

  1. Source catkin workspaces in any declared build snaps, stage snaps, and on the host system.

  2. Install any missing project dependencies with rosdep.

  3. Initialize the workspace to use catkin tools.

  4. Overwrite the default catkin build, so that builds aren’t affected by profile changes.

  5. Configure the project for snap builds.

  6. Run catkin build, passing the arguments in the catkin-tools-cmake-args key to CMake.

Example snap

The test suite in Snapcraft has a catkin-tools-noetic-hello snap built with the Catkin Tools plugin.