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

Added Dockerfile and docker compose files #206

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
48 changes: 48 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
ARG TAG=jammy
FROM ubuntu:${TAG}

ARG ROS_DISTRO
DavidSpielman marked this conversation as resolved.
Show resolved Hide resolved

SHELL ["/bin/bash", "-c"]

ENV DEBIAN_FRONTEND noninteractive

USER root

# Install
RUN apt update \
&& apt upgrade -y \
&& apt install -y cmake curl git python3

# Add ROS2 sources to install ROS infrastructure tools
RUN 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" | tee /etc/apt/sources.list.d/ros2.list > /dev/null

# Install and configure ROS infrastructure tools
RUN apt update \
&& apt install -y python3-vcstool python3-colcon-common-extensions python3-rosdep \
&& rosdep init \
&& rosdep update

# Bind mount the source directory so as not to unnecessarily copy source code into the docker image
ARG WORKSPACE_DIR=/opt/industrial_calibration
RUN --mount=type=bind,target=${WORKSPACE_DIR}/src/industrial_calibration \
apt update -y -qq \
&& vcs import ${WORKSPACE_DIR}/src < ${WORKSPACE_DIR}/src/industrial_calibration/dependencies.repos --shallow \
&& rosdep install \
--from-paths ${WORKSPACE_DIR}/src \
-iry

# Build the repository
# Bind mount the source directory so as not to unnecessarily copy source code into the docker image
RUN --mount=type=bind,target=${WORKSPACE_DIR}/src/industrial_calibration \
cd ${WORKSPACE_DIR} \
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release \
&& rm -rf build log

# Set the entrypoint to source the workspace
COPY docker/extrinsic_calibration_gui.sh /extrinsic_calibration_gui.sh
COPY docker/intrinsic_calibration_gui.sh /intrinsic_calibration_gui.sh


ENTRYPOINT ["/extrinsic_calibration_gui"]
DavidSpielman marked this conversation as resolved.
Show resolved Hide resolved
36 changes: 36 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
services:
industrial_calibration:
build:
context: ..
dockerfile: docker/Dockerfile
args:
TAG: jammy
ROS_DISTRO: humble
DavidSpielman marked this conversation as resolved.
Show resolved Hide resolved
environment:
DISPLAY: $DISPLAY
XAUTHORITY: $XAUTHORITY
NVIDIA_DRIVER_CAPABILITIES: all
DavidSpielman marked this conversation as resolved.
Show resolved Hide resolved
ROS_LOG_DIR: /tmp
container_name: industrial_calibration
image: ghcr.io/ros-industrial/industrial_calibration:jammy
stdin_open: true
tty: true
network_mode: host
privileged: false
user: ${CURRENT_UID} # CURRENT_UID=$(id -u):$(id -g)
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- /etc/hosts:/etc/hosts
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro

# entrypoint: /extrinsic_calibration_gui.sh
entrypoint: /intrinsic_calibration_gui.sh

deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
DavidSpielman marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions docker/extrinsic_calibration_gui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
source /opt/industrial_calibration/install/setup.bash
./opt/industrial_calibration/install/industrial_calibration/bin/industrial_calibration_extrinsic_hand_eye_calibration_app
3 changes: 3 additions & 0 deletions docker/intrinsic_calibration_gui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
source /opt/industrial_calibration/install/setup.bash
./opt/industrial_calibration/install/industrial_calibration/bin/industrial_calibration_camera_intrinsic_calibration_app
Loading