-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (52 loc) · 2.85 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM ubuntu:20.04
#FROM python:3.10.12 Note: Unfortunately with this the 3D visualization with open3d does not work.
LABEL maintainer="Thomas Laebe <laebe@ipb.uni-bonn.de>"
# -----------------------------------------------------------------------------------------
# Needed Packages
# Python
RUN apt-get update && apt-get install -y python3-pip
RUN python3 -m pip install --no-cache-dir --upgrade pip # Note that without this the installation
# of the source package with "-e" does not work
# Libraries needed for open3d
RUN apt-get update && apt-get install --no-install-recommends -y libc++1 libgomp1 libpng16-16 libglfw3
# For building apriltag library
RUN apt-get update && apt-get install -y git
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y cmake
# For opencv (cv2)
RUN apt-get update && apt-get install -y libglib2.0-0 libsm6 libxrender1 libxext6
# -----------------------------------------------------------------------------------------
# We need the apriltag library. Note that this only works AFTER the source package install. Unclear why
# The version you get with "pip install apriltag" is too old
# (it has some different point numbering, thus the calibration may fail!). We use the github
# repo. Note that we have to do this AFTER the installation of the calibration package,
# because the build system checks for numpy which is not there before installing the calibration package.
WORKDIR /root
RUN git clone https://github.com/AprilRobotics/apriltag
WORKDIR /root/apriltag
# numpy needs to be there otherwise python wrapper is not built
RUN pip install numpy
RUN cmake -B build -DCMAKE_BUILD_TYPE=Release
RUN cmake --build build --target install
# Library path has to be set so that python finds the apriltag library
ENV LD_LIBRARY_PATH=/usr/local/lib
ENV PYTHONPATH=/usr/local/lib/python3.8/site-packages
# HACK: The build does not name the python wrapper library correctly. Correct this here.
RUN mv /usr/local/lib/python3.8/site-packages/apriltag..so /usr/local/lib/python3.8/site-packages/apriltag.cpython-38-x86_64-linux-gnu.so
# -----------------------------------------------------------------------------------------
# The actual program
# Python debugger which is actually not needed but may appear in source: ipdb
RUN pip --no-cache-dir install ipdb
# create folder for code and go to it
WORKDIR /root/calib
# Copy the neccessary files/dirs into the container
COPY scripts ./scripts
COPY src ./src
COPY pyproject.toml .
# Install the calibration python package and it's (python) dependencies
WORKDIR /root/calib
RUN pip --no-cache-dir install -e .
# =============================================================================
# Now do the actual work: Start the camera system and LiDAR calibration
WORKDIR /root
COPY entrypoint.bash /root/entrypoint.bash
CMD /root/entrypoint.bash