Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Micro epsilon SDK and dependencies #32

Merged
merged 6 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 40 additions & 26 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,68 +1,82 @@
ARG SCANCONTROL_SDK_VERSION=0.2.5
ARG SCANCONTROL_SDK_VERSION=1.0.0

FROM ubuntu:bionic AS build
FROM ubuntu:focal AS build

ARG SCANCONTROL_SDK_VERSION
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y --no-install-recommends \
checkinstall \
cmake \
debhelper \
g++ \
gcc \
gettext \
git \
gobject-introspection \
gtk-doc-tools \
intltool \
libgirepository1.0-dev \
libglib2.0-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-good1.0-dev \
libgtk-3-dev \
libusb-1.0-0-dev \
libxml2-dev \
meson \
python3-pip \
ninja-build \
pkg-config \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*
xsltproc \
&& rm -rf /var/lib/apt/lists/* && \
pip3 install meson
Copy link

@katettudelft katettudelft Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest expanding this a bit further - this is the standard 'clean-up' stanza I use with each apt call:

apt-get autoremove -y &&\
apt-get clean -y &&\
rm -rf /var/lib/apt/lists/*


RUN wget http://ftp.acc.umu.se/pub/GNOME/sources/aravis/0.6/aravis-0.6.4.tar.xz && \
tar xfJ aravis-0.6.4.tar.xz && \
rm aravis-0.6.4.tar.xz && \
cd aravis-0.6.4 && \
./configure && \
make && \
checkinstall --pkgname aravis --requires="libglib2.0-dev, libxml2-dev" && \
ldconfig
RUN wget https://github.com/AravisProject/aravis/releases/download/0.8.30/aravis-0.8.30.tar.xz -O aravis-0.8.30.tar.xz &&\
tar xfJ aravis-0.8.30.tar.xz && \
rm aravis-0.8.30.tar.xz && \
cd aravis-0.8.30 && \
meson setup build && \
cd build && \
ninja && \
checkinstall --pkgname aravis --pkgversion 0.8.30 --requires="libglib2.0-dev, libxml2-dev, libusb-1.0-0-dev" ninja install

SHELL ["/bin/bash", "-c"]
RUN wget https://software.micro-epsilon.com/scanCONTROL-Linux-SDK-${SCANCONTROL_SDK_VERSION//./-}.zip && \
unzip scanCONTROL-Linux-SDK-${SCANCONTROL_SDK_VERSION//./-}.zip && \
RUN wget https://software.micro-epsilon.com/scanCONTROL-Linux-SDK-${SCANCONTROL_SDK_VERSION//./-}.zip -O scanCONTROL-Linux-SDK-${SCANCONTROL_SDK_VERSION//./-}.zip && \
unzip scanCONTROL-Linux-SDK-${SCANCONTROL_SDK_VERSION//./-}.zip -d scanCONTROL-Linux-SDK/ && \
rm scanCONTROL-Linux-SDK-${SCANCONTROL_SDK_VERSION//./-}.zip && \
cd /scanCONTROL\ Linux\ SDK\ ${SCANCONTROL_SDK_VERSION}/libmescan/ && \
cd scanCONTROL-Linux-SDK/libmescan/ && \
meson builddir && \
cd builddir && \
ninja && \
checkinstall --pkgname mescan --pkgversion ${SCANCONTROL_SDK_VERSION} --requires="aravis \(\>= 0.6.0\)" ninja install && \
checkinstall --pkgname mescan --pkgversion ${SCANCONTROL_SDK_VERSION} --requires="aravis \(\>= 0.8.0\)" ninja install && \
ldconfig && \
cd "/scanCONTROL Linux SDK ${SCANCONTROL_SDK_VERSION}/libllt/" && \
cd /scanCONTROL-Linux-SDK/libllt && \
meson builddir && \
cd builddir && \
ninja && \
checkinstall --pkgname llt --pkgversion ${SCANCONTROL_SDK_VERSION} --requires="mescan \(\>= ${SCANCONTROL_SDK_VERSION}\),aravis \(\>= 0.6.0\)" ninja install
checkinstall --pkgname llt --pkgversion ${SCANCONTROL_SDK_VERSION} --requires="mescan \(\>= ${SCANCONTROL_SDK_VERSION}\),aravis \(\>= 0.8.0\)" ninja install

RUN mkdir /library_pkgs && \
mv /aravis-0.6.4/aravis_0.6.4-1_amd64.deb /library_pkgs && \
mv "/scanCONTROL Linux SDK ${SCANCONTROL_SDK_VERSION}/libmescan/builddir/mescan_${SCANCONTROL_SDK_VERSION}-1_amd64.deb" /library_pkgs && \
mv "/scanCONTROL Linux SDK ${SCANCONTROL_SDK_VERSION}/libllt/builddir/llt_${SCANCONTROL_SDK_VERSION}-1_amd64.deb" /library_pkgs
mv /aravis-0.8.30/build/aravis_0.8.30-1_amd64.deb /library_pkgs && \
mv "/scanCONTROL-Linux-SDK/libmescan/builddir/mescan_${SCANCONTROL_SDK_VERSION}-1_amd64.deb" /library_pkgs && \
mv "/scanCONTROL-Linux-SDK/libllt/builddir/llt_${SCANCONTROL_SDK_VERSION}-1_amd64.deb" /library_pkgs

FROM ros:melodic-ros-core
FROM ros:noetic-ros-core
ARG SCANCONTROL_SDK_VERSION

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend that you add an AS label for FROM statements. It breaks the file up a bit conceptually, and makes multi-target builds an option (if we want to use them later).

There's an example on line 3.


RUN apt-get update && \
apt-get install -y \
RUN apt-get update && apt-get install -y --no-install-recommends\
intltool \
pkg-config \
&& rm -rf /var/lib/apt/lists/*

COPY --from=build ["/library_pkgs", "/library_pkgs"]

RUN apt-get update && \
apt install -y /library_pkgs/aravis_0.6.4-1_amd64.deb && \
apt install -y /library_pkgs/aravis_0.8.30-1_amd64.deb && \
apt install /library_pkgs/mescan_${SCANCONTROL_SDK_VERSION}-1_amd64.deb && \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's preferable to use apt-get rather than apt in scripts - it has a more reliable command line interface.

I think you can do all of the packages in one install command too (but please test it works if you change it).

Finally, if these are the only files in /library_pkgs/, then you could consider using
apt-get install /library_pkgs/* to make the command shorter. Obviously if there are additional files in there that you don't want, or the contents are subject to change, then don't do this. :)

apt install /library_pkgs/llt_${SCANCONTROL_SDK_VERSION}-1_amd64.deb
apt install /library_pkgs/llt_${SCANCONTROL_SDK_VERSION}-1_amd64.deb \
&& rm -rf /var/lib/apt/lists/*

4 changes: 2 additions & 2 deletions .github/workflows/industrial_ci_action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
env:
- {OS_NAME: ubuntu, OS_CODE_NAME: bionic, ROS_DISTRO: melodic, DOCKER_IMAGE: "samxl/scancontrol:latest"}
- {OS_NAME: ubuntu, OS_CODE_NAME: focal, ROS_DISTRO: noetic, DOCKER_IMAGE: "samxl/scancontrol:sdk_v1.0.0"}
env:
CCACHE_DIR: /github/home/.ccache
runs-on: ubuntu-latest
Expand All @@ -18,4 +18,4 @@ jobs:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}
- uses: 'ros-industrial/industrial_ci@master'
env: ${{ matrix.env }}
env: ${{ matrix.env }}
16 changes: 13 additions & 3 deletions micro_epsilon_scancontrol_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@ project(micro_epsilon_scancontrol_driver)
find_package(catkin REQUIRED COMPONENTS roscpp pcl_ros nodelet micro_epsilon_scancontrol_msgs)
find_package(PkgConfig REQUIRED)

pkg_check_modules(scancontrol REQUIRED glib-2.0 aravis-0.6 mescan llt)
pkg_check_modules(scancontrol REQUIRED
aravis-0.8
glib-2.0
llt
mescan
)

catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS roscpp pcl_ros nodelet micro_epsilon_scancontrol_msgs
DEPENDS scancontrol
CATKIN_DEPENDS
micro_epsilon_scancontrol_msgs
nodelet
pcl_ros
roscpp
DEPENDS
scancontrol
)

include_directories(include ${catkin_INCLUDE_DIRS} ${scancontrol_INCLUDE_DIRS})
Expand Down
Loading