@@ -18,6 +18,7 @@ RUN apt-get -q update \
18
18
clang-tools \
19
19
python3-pip \
20
20
python3-dev \
21
+ python3-venv \
21
22
lsb-release \
22
23
wget \
23
24
gnupg \
@@ -39,13 +40,11 @@ RUN apt-get -q update \
39
40
FROM ci AS robot
40
41
41
42
# Configure a new non-root user
42
- ARG USERNAME=blue
43
+ ARG USERNAME=ubuntu
43
44
ARG USER_UID=1000
44
45
ARG USER_GID=$USER_UID
45
46
46
- RUN groupadd --gid $USER_GID $USERNAME \
47
- && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
48
- && echo $USERNAME ALL=\( root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
47
+ RUN echo $USERNAME ALL=\( root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
49
48
&& chmod 0440 /etc/sudoers.d/$USERNAME \
50
49
&& usermod -a -G dialout $USERNAME \
51
50
&& echo "source /usr/share/bash-completion/completions/git" >> /home/$USERNAME/.bashrc
@@ -56,6 +55,17 @@ ENV DEBIAN_FRONTEND=noninteractive
56
55
USER $USERNAME
57
56
ENV USER=$USERNAME
58
57
58
+ # Python in Ubuntu is now marked as a "Externally managed environment",
59
+ # Per best practice, create a venv for local python packages
60
+ # Is there a more elegant way to handle this?
61
+ #
62
+ # These two ENVs effectively "activate" the venv for subsequent calls to
63
+ # python/pip in the Dockerfile
64
+ WORKDIR /home/$USERNAME
65
+ ENV VIRTUAL_ENV=/home/$USERNAME/.venv/blue
66
+ RUN python3 -m venv --system-site-packages --symlinks $VIRTUAL_ENV
67
+ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
68
+
59
69
# Install MAVROS dependencies
60
70
WORKDIR /home/$USERNAME
61
71
RUN wget https://raw.githubusercontent.com/mavlink/mavros/ros2/mavros/scripts/install_geographiclib_datasets.sh \
@@ -97,19 +107,25 @@ RUN sudo apt-get -q update \
97
107
&& sudo rm -rf /var/lib/apt/lists/*
98
108
99
109
RUN echo "source ${USER_WORKSPACE}/install/setup.bash" >> /home/$USERNAME/.bashrc \
100
- && echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc
110
+ && echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc \
111
+ && echo "\n # Ensure colcon is run in the venv\n alias colcon='python3 -m colcon'" >> /home/$USERNAME/.bashrc
101
112
102
113
FROM robot AS desktop
103
114
104
115
ENV DEBIAN_FRONTEND=noninteractive
105
- ENV GZ_VERSION=garden
106
-
107
- # Install Gazebo Garden: https://gazebosim.org/docs/garden/install_ubuntu
116
+ ENV GZ_VERSION=harmonic
117
+
118
+ # Gazebo Binary availability:
119
+ # Humble: Garden
120
+ # Iron: Garden
121
+ # Jazzy: Harmonic
122
+ # Rolling: Harmonic
123
+ # Install Gazebo Harmonic: https://gazebosim.org/docs/harmonic/install_ubuntu
108
124
RUN sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \
109
125
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null \
110
126
&& sudo apt-get -q update \
111
127
&& sudo apt-get -y --quiet --no-install-recommends install \
112
- gz-garden \
128
+ gz-${GZ_VERSION} \
113
129
&& sudo apt-get autoremove -y \
114
130
&& sudo apt-get clean -y \
115
131
&& sudo rm -rf /var/lib/apt/lists/*
@@ -118,11 +134,14 @@ RUN sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrin
118
134
RUN sudo apt-get -q update \
119
135
&& sudo apt-get -q -y upgrade \
120
136
&& sudo apt-get -q install --no-install-recommends -y \
137
+ python3-pexpect \
121
138
python3-wxgtk4.0 \
139
+ python3-future \
122
140
rapidjson-dev \
123
141
xterm \
124
- libgz-sim7 -dev \
142
+ libgz-sim? -dev \
125
143
rapidjson-dev \
144
+ cppzmq-dev \
126
145
libopencv-dev \
127
146
&& sudo apt-get autoremove -y \
128
147
&& sudo apt-get clean -y \
@@ -133,7 +152,10 @@ RUN sudo apt-get -q update \
133
152
# When deployed onto hardware, the native installation of ArduSub
134
153
# (on the FCU) will be used.
135
154
WORKDIR /home/$USERNAME
136
- RUN git clone https://github.com/ArduPilot/ardupilot.git --recurse-submodules
155
+ # Really should do version pinning but Sub-4.5 is waaaay behind master
156
+ # (doesn't know about "noble" yet)
157
+ ARG ARDUPILOT_RELEASE=master
158
+ RUN git clone -b ${ARDUPILOT_RELEASE} https://github.com/ArduPilot/ardupilot.git --recurse-submodules
137
159
138
160
# Install ArduSub dependencies
139
161
WORKDIR /home/$USERNAME/ardupilot
0 commit comments