-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDroneDockerfile
More file actions
131 lines (108 loc) · 4.15 KB
/
DroneDockerfile
File metadata and controls
131 lines (108 loc) · 4.15 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
FROM nvidia/vulkan:1.1.121-cuda-10.1--ubuntu18.04
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
# Allow using GUI apps.
ENV TERM=xterm
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y tzdata \
&& ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& apt-get clean
# Some useful tools.
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
build-essential sudo \
cmake \
gdb \
git \
vim \
tmux \
wget \
curl \
less \
htop \
python3-pip \
python-tk \
libsm6 libxext6 \
libboost-all-dev zlib1g-dev \
lsb-release \
&& apt-get clean
# Copied from
# https://github.com/carla-simulator/carla/blob/78e7ea11306ca164fb664ec74d2224f2e1d01923/Util/Docker/Release.Dockerfile#L15
RUN packages='libsdl2-2.0-0 libsdl2-dev xserver-xorg libvulkan1 libvulkan-dev' \
&& apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y $packages --no-install-recommends \
&& VULKAN_API_VERSION=`dpkg -s libvulkan1 | grep -oP 'Version: [0-9|\.]+' | grep -oP '[0-9|\.]+'` && \
mkdir -p /etc/vulkan/icd.d/ && \
echo \
"{\
\"file_format_version\" : \"1.0.0\",\
\"ICD\": {\
\"library_path\": \"libGLX_nvidia.so.0\",\
\"api_version\" : \"${VULKAN_API_VERSION}\"\
}\
}" > /etc/vulkan/icd.d/nvidia_icd.json \
&& rm -rf /var/lib/apt/lists/*
# Add a user with the same user_id and group_id as the user outside the container.
ARG user_id=1001
ARG group_id=100
ARG user_name=airsim_user
ARG group_name=users
# The "users" group with id=100 is already in the system.
# For other group setting, uncomment the following.
# RUN groupadd -g ${group_id} ${group_name}
ENV USERNAME ${user_name}
RUN useradd --uid ${user_id} --gid ${group_id} -ms /bin/bash $USERNAME \
&& echo "$USERNAME:$USERNAME" | chpasswd \
&& adduser $USERNAME sudo \
&& echo "$USERNAME ALL=NOPASSWD: ALL" >> /etc/sudoers.d/$USERNAME \
&& adduser $USERNAME audio \
&& adduser $USERNAME video
# Make sure that everything is up to date and install necessary libraries
RUN apt update
RUN apt install -y python3.8
RUN python3.8 -m pip install pip --upgrade
RUN ln -sf /usr/bin/python3.8 /usr/bin/python3
RUN python3 -m pip install numpy==1.24.3
RUN python3 -m pip install setuptools==74.1.2
RUN python3 -m pip install tensorflow==2.13.1
RUN python3 -m pip install geopy==2.4.1
RUN python3 -m pip install pillow==10.4.0
RUN python3 -m pip install msgpack-rpc-python==0.4.1
RUN python3 -m pip install airsim==1.8.1
RUN python3 -m pip install pyproj==3.5.0
RUN python3 -m pip install dronekit==2.9.2
RUN python3 -m pip install kconfiglib==14.1.0
RUN python3 -m pip install jinja2==3.1.4
RUN python3 -m pip install empy==3.3.4
RUN python3 -m pip install pyyaml==6.0.2
RUN python3 -m pip install pyros-genmsg==0.5.8
RUN python3 -m pip install jsonschema==4.23.0
RUN python3 -m pip install toml==0.10.2
RUN python3 -m pip install regex==2024.7.24
RUN python3 -m pip install argparse==1.4.0
RUN python3 -m pip install gymnasium==0.29.1
RUN python3 -m pip install sb3_contrib==2.3.0
RUN python3 -m pip install stable-baselines3==2.3.2
RUN python3 -m pip install gym==0.26.2
RUN python3 -m pip install shimmy==1.3.0
# Container start dir.
WORKDIR /home/$USERNAME
# Create the AirSim directory structure (if still required)
RUN mkdir -p /home/$USERNAME/Documents/AirSim/
# Run as the new user.
USER $USERNAME
RUN mkdir -p PX4
WORKDIR /home/$USERNAME/PX4
RUN git clone https://github.com/PX4/PX4-Autopilot.git --recursive
RUN chown -R ${user_id}:${group_id} /home/airsim_user/PX4/
RUN bash ./PX4-Autopilot/Tools/setup/ubuntu.sh --no-nuttx --no-sim-tools
WORKDIR /home/$USERNAME/PX4/PX4-Autopilot
RUN git checkout v1.13.3
RUN git submodule sync --recursive
RUN git submodule update --init --recursive || true
COPY modified_px4/EKF2.cpp src/modules/ekf2/EKF2.cpp
COPY modified_px4/PositionControl.cpp src/modules/mc_pos_control/PositionControl/PositionControl.cpp
RUN sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
WORKDIR /home/$USERNAME
# Entrypoint command.
CMD /bin/bash