-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
147 lines (113 loc) · 3.82 KB
/
dockerfile
File metadata and controls
147 lines (113 loc) · 3.82 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Build arguments
# Specify the parent image from which we build
FROM stereolabs/zed:3.7-runtime-jetson-jp4.6
# OpenCV Version
ARG OPENCV_VERSION=4.x
# Install dependencies
RUN apt-get update
RUN apt-get upgrade -y
# Install build tools, build dependencies and python
RUN apt-get install --no-install-recommends -y \
build-essential gcc g++ \
cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev \
libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev \
yasm libatlas-base-dev gfortran libpq-dev \
libxine2-dev libglew-dev libtiff5-dev zlib1g-dev libavutil-dev libpostproc-dev \
libeigen3-dev python3-dev python3-pip python3-numpy libx11-dev tzdata \
&& rm -rf /var/lib/apt/lists/*
# Set Working directory
WORKDIR /opt
# Install OpenCV from Source
RUN git clone --depth 1 --branch ${OPENCV_VERSION} https://github.com/opencv/opencv.git && \
git clone --depth 1 --branch ${OPENCV_VERSION} https://github.com/opencv/opencv_contrib.git && \
cd opencv && \
mkdir build && \
cd build && \
cmake \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/ \
-D PYTHON3_PACKAGES_PATH=/usr/lib/python3/dist-packages \
-D WITH_V4L=ON \
-D WITH_QT=OFF \
-D WITH_OPENGL=ON \
-D WITH_GSTREAMER=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D OPENCV_ENABLE_NONFREE=ON \
-D OPENCV_EXTRA_MODULES_PATH=/opt/opencv_contrib/modules \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D INSTALL_C_EXAMPLES=OFF \
-D BUILD_EXAMPLES=OFF .. && \
make -j"$(nproc)" && \
make install
WORKDIR /opt
RUN echo "Installing yaml-cpp"
RUN git clone https://github.com/jbeder/yaml-cpp.git && \
cd yaml-cpp && \
mkdir build && \
cd build && \
cmake -DBUILD_SHARED_LIBS=ON .. && \
make -j4 &&\
make install &&\
ldconfig
RUN echo "Installing nlohmann_json"
WORKDIR /opt
RUN git clone https://github.com/nlohmann/json.git
WORKDIR /opt/json
RUN mkdir build && cd build && \
cmake -D CMAKE_BUILD_TYPE=Release .. &&\
sudo make install -j4
WORKDIR /opt
RUN pip3 install --upgrade pip
RUN pip3 install cmake --upgrade
RUN git clone https://github.com/yhirose/cpp-httplib.git
WORKDIR /opt/cpp-httplib
RUN mkdir build && cd build &&\
cmake -D CMAKE_BUILD_TYPE=Release -D HTTPLIB_COMPILE=on -D BUILD_SHARED_LIBS=on .. && \
sudo cmake --build . --target install
## Installs Ros noetic
# setup timezone
WORKDIR /opt
RUN apt install -q -y --no-install-recommends tzdata
# install packages
RUN apt update
RUN apt-get install -q -y --no-install-recommends \
dirmngr \
gnupg2 \
&& rm -rf /var/lib/apt/lists/*
# setup sources.list
RUN echo "deb http://packages.ros.org/ros/ubuntu bionic main" > /etc/apt/sources.list.d/ros1-latest.list
# setup keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV ROS_DISTRO noetic
#install ros packages
RUN apt-get update && apt-get install -y --no-install-recommends \
ros-noetic-ros-core=1.4.1-0* \
&& rm -rf /var/lib/apt/lists/*
# setup entrypoint
RUN rm -rf /ros_entrypoint.sh
COPY ./ros_entrypoint.sh /
CMD ["bash"]
ENTRYPOINT ["/ros_entrypoint.sh"]
RUN mkdir -p /opt/catkin_ws/src
WORKDIR /opt/catkin_ws
RUN . /opt/ros/noetic/setup.sh && catkin_make
RUN apt update
RUN pip install -U rosdep
RUN rosdep init
RUN rosdep update
## Installing wayfinder module
COPY ./Wayfinder /opt
WORKDIR /opt/Wayfinder
RUN pip install .
RUN echo "Installing Vision Module"
WORKDIR /opt/catkin_ws
RUN cd ./src
RUN git clone --recursive https://github.com/stereolabs/zed-ros-wrapper.git
RUN rm -rf /usr/local/cuda-10.2/targets/aarch64-linux/lib/*
COPY lib64/* /usr/local/cuda-10.2/targets/aarch64-linux/lib/
WORKDIR /opt/catkin_ws
RUN rosdep install --from-paths src --ignore-src -r -y
RUN catkin_make -DCMAKE_BUILD_TYPE=Release