Last time I introduced about Ubuntu Core. Ubuntu Core is using Snappy as a package system, however, so-called “Snappy” packaging system can be tried without installing Ubuntu Core. This time, I will try to make “Snappy” ROS package on ordinary Ubuntu.
Here is a tutorial on how to make a Snappy ROS package. Let’s follow this street for the time being.
Before doing this we recommend you to read through the Snapcraft Tour tutorials.
The following procedure is what I tried with Ubuntu 16.04 + ROS Kinetic. First, install Snappcraft which is a Snappy packaging tool.
$ sudo apt install snapcraft
I need the ROS package to make it a Snappy package, but it is a pain to type in my own code, so I clone the ros_tutorial source code from github.
$ mkdir -p catkin_ws / src $ cd ~/catkin_ws/src $ git clone https://github.com/ros/ros_tutorials.git
Initialize with snapcraft.
$ cd ~/catkin_ws $ snapcraft init
A directory named snap is created and a file named snapcraft.yaml is created below it. Rewrite this file to include the binaries in roscpp_tutorials. Refer to the tutorial for explanation as to how to rewrite it. I think that you can understand in the atmosphere.
Well, finally I will create a package.
$ cd ~/catkin_ws $ snapcraft
I started downloading various things from the network … snapcraft can understand the catkin workspace, so it looks at package.xml and download the necessary packages with rosdep.
Perhaps you think “All the necessary ROS packages are already in the system!” Because the Snappy makes all the necessary items into the virtual container as a snappy package. It downloads the packages, compiles it from source code, and installs it in the virtual container, every time its build.
After a while, the processing is over,
Snapped talker-listener_0.1 _ amd64.snap
A snap file is generated.
To install it,
$ sudo snap install --dangerous publisher-subscriber_0.1 _ amd64.snap
will do. Let’s see if it is installed.
$ snap list Name Version Rev Developer Notes Core 16-2.26.9 2381 canonical - Talker-listener 0.1 x 1 -
Let’s start the nodes in turn.
$ talker-listener.roscore $ talker-listener.talker $ talker-listener.listener
You can see familiar nodes of talker-listener began to proceed.