This repository has been archived by the owner on Aug 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.fog-drone
92 lines (79 loc) · 3.15 KB
/
Dockerfile.fog-drone
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
FROM ubuntu:20.04
# Setup timezone
RUN echo 'Etc/UTC' > /etc/timezone \
&& ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime \
&& apt-get update && apt-get install -q -y tzdata \
&& rm -rf /var/lib/apt/lists/*
# Install tools to add apt repository
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
gnupg2 \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
ENV ROS_DISTRO="galactic"
# Install ROS 2
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
RUN echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list
RUN apt-get update && apt-get install -y --no-install-recommends \
ros-${ROS_DISTRO}-ros-base \
ros-${ROS_DISTRO}-ros-core \
&& rm -rf /var/lib/apt/lists/*
# Install ROS2 dependencies
RUN curl http://repo.ros2.org/repos.key | apt-key add -
RUN apt-get update && apt-get install -y --no-install-recommends \
ros-${ROS_DISTRO}-octomap \
ros-${ROS_DISTRO}-octomap-msgs \
ros-${ROS_DISTRO}-dynamic-edt-3d \
ros-${ROS_DISTRO}-laser-geometry \
ros-${ROS_DISTRO}-pcl-conversions \
ros-${ROS_DISTRO}-pcl-msgs \
&& rm -rf /var/lib/apt/lists/*
# Install gstreamer libraries for video streaming
RUN apt-get update && apt-get install -y --no-install-recommends \
gstreamer1.0-0 \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-rtsp \
gstreamer1.0-tools \
&& rm -rf /var/lib/apt/lists/*
# Install git and ssh
RUN apt-get update && apt-get install -y --no-install-recommends \
git-core \
openssh-client \
&& rm -rf /var/lib/apt/lists/*
# Install PX4 SITL
# TODO: repplace with local px4 build
RUN curl -fsSL https://ssrc.jfrog.io/artifactory/ssrc-gen-public-remote/builds/px4-firmware/sitl/latest/px4_sitl_build.tar.gz -o px4_sitl_build.tar.gz \
&& tar -xzf px4_sitl_build.tar.gz \
&& mv px4_sitl/build/px4_sitl_rtps/bin/* /usr/bin/ \
&& mv px4_sitl/build/px4_sitl_rtps/etc /px4_sitl_etc \
&& rm -rf px4_sitl_build/ \
&& rm px4_sitl_build.tar.gz
## FOG SOFTWARE
WORKDIR /tmp
COPY packaging/deb_files/ .
RUN curl -LOs https://ssrc.jfrog.io/artifactory/ssrc-debian-release-remote/mavsdk_0.42.0_ubuntu20.04_amd64.deb && \
apt-get install -y -f \
./mavsdk*.deb \
./ros-${ROS_DISTRO}-px4-msgs*.deb \
./cloud-link*.deb \
./mavlink-router*.deb \
./ros-${ROS_DISTRO}-px4-ros-com*.deb \
./mission-engine*.deb \
./mission-data-recorder*.deb \
./ros-${ROS_DISTRO}-fog-msgs*.deb \
./ros-${ROS_DISTRO}-control-interface*.deb \
./ros-${ROS_DISTRO}-octomap-server2*.deb \
./ros-${ROS_DISTRO}-navigation*.deb \
./ros-${ROS_DISTRO}-rplidar-ros2*.deb
# Setup running environment
RUN /bin/sh -c 'echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc'
RUN mkdir /fog-drone
WORKDIR /fog-drone
COPY fog-drone/run-px4.sh run-px4.sh
COPY fog-drone/run-ros2.sh run-ros2.sh
COPY fog-drone/drone-entrypoint.sh drone-entrypoint.sh
EXPOSE 14560/UDP
EXPOSE 4560
ENTRYPOINT ["/fog-drone/drone-entrypoint.sh"]