-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathDockerfile.l4t-humble
109 lines (88 loc) · 5.14 KB
/
Dockerfile.l4t-humble
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
ARG L4T_VERSION=l4t-r36.3.0
ARG IMAGE_NAME=dustynv/ros:humble-ros-base-${L4T_VERSION}
FROM ${IMAGE_NAME}
ARG ZED_SDK_MAJOR=4
ARG ZED_SDK_MINOR=2
ARG ZED_SDK_PATCH=3
ARG L4T_MAJOR=36
ARG L4T_MINOR=3
# ROS2 distribution
ARG ROS2_DIST=humble
# ZED ROS2 Wrapper dependencies version
ARG XACRO_VERSION=2.0.8
ARG DIAGNOSTICS_VERSION=4.0.0
ARG AMENT_LINT_VERSION=0.12.11
ARG ROBOT_LOCALIZATION_VERSION=3.5.3
ARG ZED_MSGS_VERSION=4.2.2
ARG NMEA_MSGS_VERSION=2.0.0
ARG ANGLES_VERSION=1.15.0
ARG GEOGRAPHIC_INFO_VERSION=1.0.6
ARG POINTCLOUD_TRANSPORT_VERSION=1.0.18
ARG POINTCLOUD_TRANSPORT_PLUGINS_VERSION=1.0.11
ENV DEBIAN_FRONTEND=noninteractive
# ZED SDK link
ENV ZED_SDK_URL="https://stereolabs.sfo2.cdn.digitaloceanspaces.com/zedsdk/${ZED_SDK_MAJOR}.${ZED_SDK_MINOR}/ZED_SDK_Tegra_L4T${L4T_MAJOR}.${L4T_MINOR}_v${ZED_SDK_MAJOR}.${ZED_SDK_MINOR}.${ZED_SDK_PATCH}.zstd.run"
# Check that this SDK exists
RUN if [ "$(curl -I "${ZED_SDK_URL}" -o /dev/null -s -w '%{http_code}\n' | head -n 1)" = "200" ]; then \
echo "The URL points to something."; \
else \
echo "The URL does not point to a .run file or the file does not exist."; \
exit 1; \
fi
# Disable apt-get warnings
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 42D5A192B819C5DA || true && \
apt-get update || true && apt-get install -y --no-install-recommends apt-utils dialog && \
rm -rf /var/lib/apt/lists/*
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
apt-get update && \
apt-get install --yes lsb-release wget less udev sudo build-essential cmake python3 python3-dev python3-pip python3-wheel git jq libpq-dev zstd usbutils && \
rm -rf /var/lib/apt/lists/*
RUN echo "# R${L4T_MAJOR} (release), REVISION: ${L4T_MINOR}" > /etc/nv_tegra_release && \
apt-get update -y || true && \
apt-get install -y --no-install-recommends zstd wget less cmake curl gnupg2 \
build-essential python3 python3-pip python3-dev python3-setuptools libusb-1.0-0-dev \
libgeographic-dev libdraco-dev zlib1g-dev -y && \
pip install protobuf && \
wget -q --no-check-certificate -O ZED_SDK_Linux_JP.run \
${ZED_SDK_URL} && \
chmod +x ZED_SDK_Linux_JP.run ; ./ZED_SDK_Linux_JP.run silent skip_tools && \
rm -rf /usr/local/zed/resources/* && \
rm -rf ZED_SDK_Linux_JP.run && \
rm -rf /var/lib/apt/lists/*
# Install the ZED ROS2 Wrapper
ENV ROS_DISTRO=${ROS2_DIST}
# Copy the sources in the Docker image
WORKDIR /root/ros2_ws/src
COPY tmp_sources/ ./
# Install missing dependencies from the sources
WORKDIR /root/ros2_ws/src
RUN wget https://github.com/ros/xacro/archive/refs/tags/${XACRO_VERSION}.tar.gz -O - | tar -xvz && mv xacro-${XACRO_VERSION} xacro && \
wget https://github.com/ros/diagnostics/archive/refs/tags/${DIAGNOSTICS_VERSION}.tar.gz -O - | tar -xvz && mv diagnostics-${DIAGNOSTICS_VERSION} diagnostics && \
wget https://github.com/ament/ament_lint/archive/refs/tags/${AMENT_LINT_VERSION}.tar.gz -O - | tar -xvz && mv ament_lint-${AMENT_LINT_VERSION} ament-lint && \
wget https://github.com/cra-ros-pkg/robot_localization/archive/refs/tags/${ROBOT_LOCALIZATION_VERSION}.tar.gz -O - | tar -xvz && mv robot_localization-${ROBOT_LOCALIZATION_VERSION} robot-localization && \
wget https://github.com/stereolabs/zed-ros2-interfaces/archive/refs/tags/${ZED_MSGS_VERSION}.tar.gz -O - | tar -xvz && mv zed-ros2-interfaces-${ZED_MSGS_VERSION} zed-ros2-interfaces && \
wget https://github.com/ros-drivers/nmea_msgs/archive/refs/tags/${NMEA_MSGS_VERSION}.tar.gz -O - | tar -xvz && mv nmea_msgs-${NMEA_MSGS_VERSION} nmea_msgs && \
wget https://github.com/ros/angles/archive/refs/tags/${ANGLES_VERSION}.tar.gz -O - | tar -xvz && mv angles-${ANGLES_VERSION} angles && \
wget https://github.com/ros-perception/point_cloud_transport/archive/refs/tags/${POINTCLOUD_TRANSPORT_VERSION}.tar.gz -O - | tar -xvz && mv point_cloud_transport-${POINTCLOUD_TRANSPORT_VERSION} point_cloud_transport && \
wget https://github.com/ros-perception/point_cloud_transport_plugins/archive/refs/tags/${POINTCLOUD_TRANSPORT_PLUGINS_VERSION}.tar.gz -O - | tar -xvz && mv point_cloud_transport_plugins-${POINTCLOUD_TRANSPORT_PLUGINS_VERSION} point_cloud_transport_plugins && \
wget https://github.com/ros-geographic-info/geographic_info/archive/refs/tags/${GEOGRAPHIC_INFO_VERSION}.tar.gz -O - | tar -xvz && mv geographic_info-${GEOGRAPHIC_INFO_VERSION} geographic-info && \
cp -r geographic-info/geographic_msgs/ . && \
rm -rf geographic-info
# Install cython
RUN python3 -m pip install --upgrade cython
# Build the dependencies and the ZED ROS2 Wrapper
WORKDIR /root/ros2_ws
RUN /bin/bash -c "source /opt/ros/$ROS_DISTRO/install/setup.bash && \
colcon build --parallel-workers $(nproc) --symlink-install \
--event-handlers console_direct+ --base-paths src \
--cmake-args ' -DCMAKE_BUILD_TYPE=Release' \
' -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs' \
' -DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined"' \
' --no-warn-unused-cli' "
WORKDIR /root/ros2_ws
# Setup environment variables
COPY ros_entrypoint_jetson.sh /sbin/ros_entrypoint.sh
RUN sudo chmod 755 /sbin/ros_entrypoint.sh
ENTRYPOINT ["/sbin/ros_entrypoint.sh"]
CMD ["bash"]