generated from citros-garden/template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
85 lines (73 loc) · 1.9 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
73
74
75
76
77
78
79
80
81
82
83
84
85
FROM althack/ros2:humble-gazebo-nvidia
# configure environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV COM_RCL_EXCEPT=4
ENV PYTHONOPTIMIZE=1
ENV ROS_DOMAIN_ID=0
# install utils
RUN apt-get update && apt-get install -y \
bash-completion \
build-essential \
cmake \
gdb \
git \
python3-argcomplete \
python3-pip \
nano \
wget \
curl \
autoconf \
automake \
libtool \
make \
g++ \
unzip \
sudo \
openssh-server \
gnupg \
gdb-multiarch \
default-jre \
python3 \
python3-setuptools \
python3-vcstool \
python3-colcon-common-extensions \
python3-rosdep \
mesa-utils \
x11-apps \
libcanberra-gtk* \
libglfw3-dev \
libglew-dev \
libgl1-mesa-glx \
libgl1-mesa-dri \
ros-humble-rosbridge-suite \
ros-humble-rosidl* \
gazebo \
&& rm -rf /var/lib/apt/lists/* \
&& echo "source /usr/share/bash-completion/completions/git" >> /home/$USERNAME/.bashrc
RUN pip install setuptools==58.2.0 citros
# define the workdir
WORKDIR /workspaces/drone
# build ros workspace
COPY ros2_ws/src ros2_ws/src
RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \
cd ros2_ws && \
colcon build
# set up px4
COPY PX4-Autopilot PX4-Autopilot
RUN PX4-Autopilot/Tools/setup/ubuntu.sh --no-nuttx
COPY .devcontainer/px4_setup.py .devcontainer/px4_setup.py
RUN python3 /workspaces/drone/.devcontainer/px4_setup.py
RUN apt-get update && apt-get install -y gazebo && \
cd PX4-Autopilot/ && \
make clean && \
DONT_RUN=1 make -j12 px4_sitl gazebo-classic && \
DONT_RUN=1 make -j12 px4_sitl gazebo-classic
# finial setup
COPY ros2_entrypoint.sh ros2_entrypoint.sh
RUN chmod +x ros2_entrypoint.sh
RUN pip install xmltodict
RUN apt update && apt-get install -y ros-humble-rosbag2-storage-mcap
RUN pip install citros==1.2.28
RUN echo "source /workspaces/drone/ros2_ws/install/local_setup.bash" >> /home/$USERNAME/.bashrc
ENTRYPOINT ["/workspaces/drone/ros2_entrypoint.sh"]
CMD ["bash"]