Skip to content

Commit

Permalink
building for humble/jazzy and for amd64/arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikN committed Aug 27, 2024
1 parent 4bbd98d commit b1ade93
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 35 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ jobs:
matrix:
include:
- ros_distro: humble
runner: ubuntu-latest
- ros_distro: jazzy
runner: ubuntu-latest
- ros_distro: humble
runner: ubuntu-24.04-arm64
- ros_distro: jazzy
runner: ubuntu-24.04-arm64

steps:

Expand All @@ -27,7 +33,8 @@ jobs:

- name: Render snapcraft.yaml
run: |
pip install jinja2
sudo apt update
sudo apt install python3-jinja2
export ROS_DISTRO=${{ matrix.ros_distro }}
./render_template.py ./snapcraft_template.yaml.jinja2 snap/snapcraft.yaml
Expand Down
2 changes: 2 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ iterate target="humble":
fi

snapcraft clean
sudo rm -rf snap/snapcraft.yaml
./render_template.py ./snapcraft_template.yaml.jinja2 snap/snapcraft.yaml
chmod 444 snap/snapcraft.yaml
snapcraft

unsquashfs husarion-depthai*.snap
Expand Down
47 changes: 24 additions & 23 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ description: |
grade: stable
confinement: strict
base: core22
base: core24

contact: https://github.com/husarion/depthai-snap/issues
issues: https://github.com/husarion/depthai-snap/issues
Expand All @@ -50,23 +50,13 @@ slots:
shm-slot:
interface: shared-memory
write: ['*'] # paths are relative to /dev/shm
# c189-slot:
# interface: custom-device
# custom-device: c189
# files:
# write:
# - /run/udev/data/c189:*

plugs:
shm-plug:
interface: shared-memory
shared-memory: shm-slot
private: false

# c189-plug:
# interface: custom-device
# custom-device: c189

apps:

daemon:
Expand All @@ -76,7 +66,7 @@ apps:
install-mode: enable
plugs: [network, network-bind, shm-plug, raw-usb]
slots: [shm-slot]
extensions: [ros2-humble-ros-base]
extensions: [ros2-jazzy-ros-base]

husarion-depthai:
command: usr/bin/launcher.sh
Expand All @@ -85,7 +75,7 @@ apps:
# plugs: [network, network-bind, shm-plug, raw-usb, system-observe, hardware-observe, network-control, network-observe, camera, browser-support]
# block-devices,
slots: [shm-slot]
extensions: [ros2-humble-ros-base]
extensions: [ros2-jazzy-ros-base]

start:
command: usr/bin/start_launcher.sh
Expand All @@ -99,24 +89,35 @@ apps:
parts:

husarion-depthai:
plugin: nil
stage-packages:
- ros-humble-depthai-ros
- ros-humble-image-transport
- ros-humble-image-transport-plugins
plugin: colcon
source: https://github.com/luxonis/depthai-ros.git
source-branch: jazzy
build-packages:
- python3-vcstool
stage-packages:
- ros-jazzy-image-transport
- ros-jazzy-image-transport-plugins
# https://index.ros.org/p/ffmpeg_image_transport/github-ros-misc-utilities-ffmpeg_image_transport/#humble
- ros-humble-ffmpeg-image-transport
- ros-jazzy-ffmpeg-image-transport
- ffmpeg
- ros-humble-cv-bridge
- ros-jazzy-cv-bridge
# needed to run ffmpeg without errors:
- libpulse-dev
- libblas3
- libjpeg-turbo8-dev
override-stage: |
- ros-jazzy-rmw-cyclonedds-cpp
override-pull: |
craftctl default
version="$(apt-cache policy ros-humble-depthai-ros-driver | grep Candidate | awk '{print $2}')"
# Set the snap version from the git tag
# The grade is set to 'stable' if the latest entry in the git history
# is the tag itself, otherwise set to devel
version="$(git describe --always --tags| sed -e 's/^v//;s/-/+git/;y/-/./')"
[ -n "$(echo $version | grep "+git")" ] && grade=devel || grade=stable
craftctl set version="$version"
craftctl set grade="stable"
craftctl set grade="$grade"

local-files:
plugin: dump
Expand Down
43 changes: 32 additions & 11 deletions snapcraft_template.yaml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,13 @@ slots:
shm-slot:
interface: shared-memory
write: ['*'] # paths are relative to /dev/shm
# c189-slot:
# interface: custom-device
# custom-device: c189
# files:
# write:
# - /run/udev/data/c189:*

plugs:
shm-plug:
interface: shared-memory
shared-memory: shm-slot
private: false

# c189-plug:
# interface: custom-device
# custom-device: c189

apps:

daemon:
Expand Down Expand Up @@ -99,6 +89,37 @@ apps:
parts:

husarion-depthai:
plugin: colcon
source: https://github.com/luxonis/depthai-ros.git
source-branch: {{ ros_distro }}
build-packages:
- python3-vcstool
stage-packages:
- ros-{{ ros_distro }}-image-transport
- ros-{{ ros_distro }}-image-transport-plugins
# https://index.ros.org/p/ffmpeg_image_transport/github-ros-misc-utilities-ffmpeg_image_transport/#humble
- ros-{{ ros_distro }}-ffmpeg-image-transport
- ffmpeg
- ros-{{ ros_distro }}-cv-bridge
# needed to run ffmpeg without errors:
- libpulse-dev
- libblas3
- libjpeg-turbo8-dev
- ros-{{ ros_distro }}-rmw-cyclonedds-cpp
override-pull: |
craftctl default

# Set the snap version from the git tag
# The grade is set to 'stable' if the latest entry in the git history
# is the tag itself, otherwise set to devel
version="$(git describe --always --tags| sed -e 's/^v//;s/-/+git/;y/-/./')"
[ -n "$(echo $version | grep "+git")" ] && grade=devel || grade=stable
craftctl set version="$version"
craftctl set grade="$grade"

{#
# uncomment when depthai-ros package for jazzy is available here: https://index.ros.org/search/?term=depthai
husarion-depthai:
plugin: nil
stage-packages:
- ros-{{ ros_distro }}-depthai-ros
Expand All @@ -116,7 +137,7 @@ parts:
craftctl default
version="$(apt-cache policy ros-{{ ros_distro }}-depthai-ros-driver | grep Candidate | awk '{print $2}')"
craftctl set version="$version"
craftctl set grade="stable"
craftctl set grade="stable" #}

local-files:
plugin: dump
Expand Down

0 comments on commit b1ade93

Please sign in to comment.