-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from Pugens/ros2-devel
Ros2 devel resume
- Loading branch information
Showing
34 changed files
with
1,156 additions
and
532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.217.4/containers/go | ||
{ | ||
"name": "scancontrol-devcontainer", | ||
"dockerComposeFile": [ | ||
"../../src/scancontrol/.docker/docker-compose.yml" | ||
], | ||
"service": "scancontrol-service", | ||
"remoteUser": "ros", | ||
"workspaceFolder": "/home/ros/workspace/", | ||
"customizations": { | ||
"vscode": { | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
}, | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
] | ||
} | ||
} | ||
// "postCreateCommand": "printenv | grep ROS" | ||
// "forwardPorts": [], | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
ARG SCANCONTROL_SDK_VERSION=1.0.0 | ||
|
||
FROM ubuntu:22.04 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 \ | ||
python3-pip \ | ||
ninja-build \ | ||
pkg-config \ | ||
unzip \ | ||
wget \ | ||
xsltproc \ | ||
meson \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
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 -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/libmescan/ && \ | ||
meson builddir && \ | ||
cd builddir && \ | ||
ninja && \ | ||
checkinstall --pkgname mescan --pkgversion ${SCANCONTROL_SDK_VERSION} --requires="aravis \(\>= 0.8.0\)" ninja install && \ | ||
ldconfig && \ | ||
cd /scanCONTROL-Linux-SDK/libllt/include && \ | ||
# scanCONTROL SDK fix for libglib | ||
sed -i '27,29 s/^/\/\/ /; 31,33 s/^/\/\/ /;' llt.h && \ | ||
cd /scanCONTROL-Linux-SDK/libllt && \ | ||
meson builddir && \ | ||
cd builddir && \ | ||
ninja && \ | ||
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.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:humble-ros-core | ||
ARG SCANCONTROL_SDK_VERSION | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends\ | ||
build-essential \ | ||
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.8.30-1_amd64.deb && \ | ||
apt install /library_pkgs/mescan_${SCANCONTROL_SDK_VERSION}-1_amd64.deb && \ | ||
apt install /library_pkgs/llt_${SCANCONTROL_SDK_VERSION}-1_amd64.deb \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
########################################### | ||
# Base image | ||
########################################### | ||
FROM ubuntu:22.04 AS base | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install language | ||
RUN apt-get update && apt-get install -y \ | ||
locales \ | ||
&& locale-gen en_US.UTF-8 \ | ||
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
ENV LANG en_US.UTF-8 | ||
|
||
# Install timezone | ||
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime \ | ||
&& export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get update \ | ||
&& apt-get install -y tzdata \ | ||
&& dpkg-reconfigure --frontend noninteractive tzdata \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN apt-get update && apt-get -y upgrade \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install common programs | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
curl \ | ||
gnupg2 \ | ||
lsb-release \ | ||
sudo \ | ||
software-properties-common \ | ||
wget \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install ROS2 base | ||
RUN sudo add-apt-repository universe \ | ||
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \ | ||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null \ | ||
&& apt-get update && apt-get install -y --no-install-recommends \ | ||
ros-humble-ros-base \ | ||
python3-argcomplete \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV ROS_DISTRO=humble | ||
ENV AMENT_PREFIX_PATH=/opt/ros/humble | ||
ENV COLCON_PREFIX_PATH=/opt/ros/humble | ||
ENV LD_LIBRARY_PATH=/opt/ros/humble/lib | ||
ENV PATH=/opt/ros/humble/bin:$PATH | ||
ENV PYTHONPATH=/opt/ros/humble/lib/python3.10/site-packages | ||
ENV ROS_PYTHON_VERSION=3 | ||
ENV ROS_VERSION=2 | ||
ENV DEBIAN_FRONTEND= | ||
|
||
########################################### | ||
# Develop image | ||
########################################### | ||
FROM base AS dev | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
bash-completion \ | ||
build-essential \ | ||
cmake \ | ||
gdb \ | ||
git \ | ||
openssh-client \ | ||
python3-argcomplete \ | ||
python3-pip \ | ||
ros-dev-tools \ | ||
ros-humble-ament-* \ | ||
vim \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN rosdep init || echo "rosdep already initialized" | ||
|
||
ARG USERNAME=ros | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
# Create a non-root user | ||
RUN groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
# Add sudo support for the non-root user | ||
&& apt-get update \ | ||
&& apt-get install -y sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Set up autocompletion for user | ||
RUN apt-get update && apt-get install -y git-core bash-completion \ | ||
&& echo "if [ -f /opt/ros/${ROS_DISTRO}/setup.bash ]; then source /opt/ros/${ROS_DISTRO}/setup.bash; fi" >> /home/$USERNAME/.bashrc \ | ||
&& echo "if [ -f /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash ]; then source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash; fi" >> /home/$USERNAME/.bashrc \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV DEBIAN_FRONTEND= | ||
ENV AMENT_CPPCHECK_ALLOW_SLOW_VERSIONS=1 | ||
|
||
########################################### | ||
# Full image | ||
########################################### | ||
FROM dev AS full | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
# Install the full release | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
ros-humble-desktop \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
ENV DEBIAN_FRONTEND= | ||
|
||
########################################### | ||
# Workspace | ||
########################################### | ||
FROM full AS workspace | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends \ | ||
unzip \ | ||
libxml2-dev cmake libusb-1.0-0-dev gobject-introspection \ | ||
libgtk-3-dev gtk-doc-tools xsltproc libgstreamer1.0-dev \ | ||
libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev \ | ||
libgirepository1.0-dev gettext \ | ||
autotools-dev automake intltool libtool \ | ||
meson \ | ||
ninja-build \ | ||
# Clean up | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
RUN wget https://github.com/AravisProject/aravis/releases/download/0.8.30/aravis-0.8.30.tar.xz && \ | ||
tar xfJ aravis-0.8.30.tar.xz && \ | ||
rm aravis-0.8.30.tar.xz | ||
|
||
RUN cd aravis-0.8.30 && \ | ||
meson setup build && \ | ||
cd build && \ | ||
ninja && \ | ||
ninja install && \ | ||
ldconfig | ||
|
||
RUN wget https://software.micro-epsilon.com/scanCONTROL-Linux-SDK-1-0-0.zip -O scanCONTROL-Linux-SDK.zip && \ | ||
unzip scanCONTROL-Linux-SDK.zip -d scanCONTROL-Linux-SDK/ && \ | ||
rm scanCONTROL-Linux-SDK.zip | ||
|
||
RUN cd scanCONTROL-Linux-SDK/libmescan/ && \ | ||
meson builddir && \ | ||
cd builddir && \ | ||
ninja install && \ | ||
ldconfig | ||
|
||
RUN cd scanCONTROL-Linux-SDK/libllt/include && \ | ||
wget -q https://raw.githubusercontent.com/Pugens/scancontrol/1105de0ea8a28526b03de488d76821e07bada265/micro_epsilon_scancontrol_driver/include/lltlib/llt.h -O llt.h && \ | ||
cd .. && meson builddir && \ | ||
cd builddir && \ | ||
ninja && \ | ||
ninja install && \ | ||
ldconfig | ||
|
||
ENV DEBIAN_FRONTEND=dialog | ||
|
||
WORKDIR /home/ros/workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
version: '3' | ||
|
||
name: scancontrol-compose | ||
services: | ||
scancontrol-service: | ||
container_name: scancontrol-container | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
user: ros | ||
working_dir: /home/ros/workspace | ||
# command: > | ||
# sh -c "sudo apt-get update && | ||
# rosdep update && | ||
# rosdep install --from-paths . --ignore-src -y && | ||
# source /opt/ros/humble/setup.bash && | ||
# colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DCMAKE_EXPORT_COMPILE_COMMANDS=On" -Wall -Wextra -Wpedantic && | ||
# . install/setup.bash" | ||
# Uncomment to expose graphic card drivers | ||
# deploy: | ||
# resources: | ||
# reservations: | ||
# devices: | ||
# - driver: nvidia | ||
# count: 1 | ||
# capabilities: [gpu] | ||
environment: | ||
- DISPLAY=${DISPLAY} | ||
- QT_X11_NO_MITSHM=1 | ||
- XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR} | ||
# Uncomment to expose graphic card drivers | ||
# - NVIDIA_DRIVER_CAPABILITIES=all | ||
volumes: | ||
- ../../../:/home/ros/workspace | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- /tmp/.X11-unix:/tmp/.X11-unix:rw | ||
- ${XAUTHORITY:-$HOME/.Xauthority}:/root/.Xauthority | ||
# Uncomment to use git within the devcontainer | ||
# - ~/.ssh/:/home/ros/.ssh/ | ||
network_mode: "host" #TODO: UNSAFE, change to specific port! | ||
tty: true | ||
init: true | ||
|
Oops, something went wrong.