Creating snap file from existing ROS pakage


I’m trying to create a snap package from existing ROS packages, but it fails.
Could you give me some advices how to setup the snapcraft.yaml?

The ROS package is hosted in Github, say .
Now I have snapcraft.yaml as:

$ cd ~/tmp
$ cat snap/snapcraft.yaml

name: tork-ros-roomblock
version: '0.1'
summary: Roomblock snap package
description: |
  This is Roomblock snap package.

grade: stable
confinement: devmode

    plugin: catkin
    rosdistro: kinetic
    catkin-packages: [roomblock_bringup, roomblock_description]

    command: roslaunch roomblock_bringup roomblock.launch --screen
    daemon: simple
    plugs: [network, network-bind]

When I run snapcraft as:

$ snapcraft cleanbuild --debug

It fails to find catkin package as follows:

FileNotFoundError: Unable to find package path: "/root/build_tork-ros-roomblock/parts/workspace/src/src"

The package path is apparently wrong, each package should be on workspace/src .
So I set snapcraft.yaml as:

    plugin: catkin
    rosdistro: kinetic
    source-space: .
    catkin-packages: [roomblock_bringup, roomblock_description]

However it fails as:

RuntimeError: source-space cannot be the root of the Catkin workspace

I referred some ROS-snap repositories such as , which I can successfully build a snap file. However, almost all existing ROS repositories are structured as each package is on the top of the repository (not on src directory).

Is there way to build a snap file from such repository?


I found my question is duplication of this post. The solution by rosinstall-files worked for me. Thank you!

1 Like