Creating snap file from existing ROS pakage

Hi,

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 https://github.com/7675t/roomblock .
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

parts:
  workspace:
    plugin: catkin
    rosdistro: kinetic
    source: https://github.com/7675t/roomblock.git
    catkin-packages: [roomblock_bringup, roomblock_description]

apps:
  launch:
    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:

parts:
  workspace:
    plugin: catkin
    rosdistro: kinetic
    source: https://github.com/7675t/roomblock.git
    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 https://github.com/kyrofa/edukit_bot , 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?

Thanks,

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

1 Like