Skip to content

Commit d440679

Browse files
authored
Merge branch 'main' into iron-mp
2 parents 6abfd46 + ab705d2 commit d440679

File tree

11 files changed

+92
-69
lines changed

11 files changed

+92
-69
lines changed

.devcontainer/nouveau/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM ghcr.io/robotic-decision-making-lab/blue:iron-desktop
33
# Install ROS dependencies
44
# This is done in a previous stage, but we include it again here in case anyone wants to
55
# add new dependencies during development
6-
ENV USERNAME=blue
6+
ENV USERNAME=ubuntu
77
ENV USER_WORKSPACE=/home/$USERNAME/ws_blue
88
WORKDIR $USER_WORKSPACE
99

.devcontainer/nouveau/devcontainer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "Nouveau Dev Container",
33
"dockerFile": "Dockerfile",
44
"context": "../..",
5-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/blue/ws_blue/src/blue,type=bind",
6-
"workspaceFolder": "/home/blue/ws_blue/src/blue",
7-
"remoteUser": "blue",
5+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_blue/src/blue,type=bind",
6+
"workspaceFolder": "/home/ubuntu/ws_blue/src/blue",
7+
"remoteUser": "ubuntu",
88
"runArgs": [
99
"--network=host",
1010
"--cap-add=SYS_PTRACE",
@@ -23,6 +23,7 @@
2323
"customizations": {
2424
"vscode": {
2525
"settings": {
26+
"python.defaultInterpreterPath": "/home/ubuntu/.venv/blue/bin/python",
2627
"python.autoComplete.extraPaths": ["${workspaceFolder}/install/"],
2728
"python.analysis.extraPaths": ["${workspaceFolder}/install/"]
2829
},

.devcontainer/nvidia/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM ghcr.io/jbvakshaya/blue:iron-nvidia-ompl
44
# Install ROS dependencies
55
# This is done in a previous stage, but we include it again here in case anyone wants to
66
# add new dependencies during development
7-
ENV USERNAME=blue
7+
ENV USERNAME=ubuntu
88
ENV USER_WORKSPACE=/home/$USERNAME/ws_blue
99
WORKDIR $USER_WORKSPACE
1010

.devcontainer/nvidia/devcontainer.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "NVIDIA Dev Container",
33
"dockerFile": "Dockerfile",
44
"context": "../..",
5-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/blue/ws_blue/src/blue,type=bind",
6-
"workspaceFolder": "/home/blue/ws_blue/src/blue",
7-
"remoteUser": "blue",
5+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_blue/src/blue,type=bind",
6+
"workspaceFolder": "/home/ubuntu/ws_blue/src/blue",
7+
"remoteUser": "ubuntu",
88
"runArgs": [
99
"--network=host",
1010
"--cap-add=SYS_PTRACE",
@@ -28,12 +28,9 @@
2828
"customizations": {
2929
"vscode": {
3030
"settings": {
31-
"python.autoComplete.extraPaths": [
32-
"${workspaceFolder}/install/"
33-
],
34-
"python.analysis.extraPaths": [
35-
"${workspaceFolder}/install/"
36-
]
31+
"python.defaultInterpreterPath": "/home/ubuntu/.venv/blue/bin/python",
32+
"python.autoComplete.extraPaths": ["${workspaceFolder}/install/"],
33+
"python.analysis.extraPaths": ["${workspaceFolder}/install/"]
3734
},
3835
"extensions": [
3936
"ms-azuretools.vscode-docker",

.devcontainer/robot/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FROM ${BLUE_GITHUB_REPO}:${ROS_DISTRO}-robot
88
# Install ROS dependencies
99
# This is done in a previous stage, but we include it again here in case anyone wants to
1010
# add new dependencies during development
11-
ENV USERNAME=blue
11+
ENV USERNAME=ubuntu
1212
ENV USER_WORKSPACE=/home/$USERNAME/ws_blue
1313
WORKDIR $USER_WORKSPACE
1414

.devcontainer/robot/devcontainer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"ROS_DISTRO": "rolling"
99
}
1010
},
11-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/blue/ws_blue/src/blue,type=bind",
12-
"workspaceFolder": "/home/blue/ws_blue/src/blue",
13-
"remoteUser": "blue",
11+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/ubuntu/ws_blue/src/blue,type=bind",
12+
"workspaceFolder": "/home/ubuntu/ws_blue/src/blue",
13+
"remoteUser": "ubuntu",
1414
"runArgs": [
1515
"--network=host",
1616
"--cap-add=SYS_PTRACE",
@@ -24,6 +24,7 @@
2424
"customizations": {
2525
"vscode": {
2626
"settings": {
27+
"python.defaultInterpreterPath": "/home/ubuntu/.venv/blue/bin/python",
2728
"python.autoComplete.extraPaths": ["${workspaceFolder}/install/"],
2829
"python.analysis.extraPaths": ["${workspaceFolder}/install/"]
2930
},

.docker/Dockerfile

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
ARG ROS_DISTRO=iron
2-
ARG USERNAME=blue
3-
ARG USER_GID=1000
4-
ARG USER_UID=1000
1+
ARG ROS_DISTRO=rolling
2+
FROM ros:$ROS_DISTRO-ros-base AS ci
53

64
FROM ros:$ROS_DISTRO-ros-base AS ci
75
ARG USERNAME
@@ -25,6 +23,7 @@ RUN apt-get -q update \
2523
clang-tools \
2624
python3-pip \
2725
python3-dev \
26+
python3-venv \
2827
lsb-release \
2928
wget \
3029
gnupg \
@@ -54,14 +53,14 @@ RUN apt-get -q update \
5453
#
5554
FROM ci AS robot
5655

57-
# Configure a new non-root user
58-
ARG USERNAME=blue
56+
#
57+
# Ubuntu 24.04 "Noble", which is used as the base image for
58+
# jazzy and rolling images, now includes a user "ubuntu" at UID 1000
59+
ARG USERNAME=ubuntu
5960
ARG USER_UID=1000
6061
ARG USER_GID=1000
6162

62-
RUN groupadd --gid $USER_GID $USERNAME \
63-
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
64-
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
63+
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
6564
&& chmod 0440 /etc/sudoers.d/$USERNAME \
6665
&& usermod -a -G dialout $USERNAME \
6766
&& echo "source /usr/share/bash-completion/completions/git" >> /home/$USERNAME/.bashrc
@@ -72,6 +71,16 @@ ENV DEBIAN_FRONTEND=noninteractive
7271
USER $USERNAME
7372
ENV USER=$USERNAME
7473

74+
# Python in Ubuntu is now marked as a "Externally managed environment",
75+
# Per best practice, create a venv for local python packages
76+
#
77+
# These two ENVs effectively "activate" the venv for subsequent calls to
78+
# python/pip in the Dockerfile
79+
WORKDIR /home/$USERNAME
80+
ENV VIRTUAL_ENV=/home/$USERNAME/.venv/blue
81+
RUN python3 -m venv --system-site-packages --symlinks $VIRTUAL_ENV
82+
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
83+
7584
# Install MAVROS dependencies
7685
WORKDIR /home/$USERNAME
7786
RUN wget https://raw.githubusercontent.com/mavlink/mavros/ros2/mavros/scripts/install_geographiclib_datasets.sh \
@@ -106,10 +115,16 @@ RUN sudo apt-get -q update \
106115
&& sudo apt-get clean -y \
107116
&& sudo rm -rf /var/lib/apt/lists/*
108117

118+
# Manually install MAVROS from source in the ws_blue/ workspace
119+
WORKDIR $USER_WORKSPACE/src/
120+
ARG MAVROS_RELEASE=ros2
121+
ARG MAVLINK_RELEASE=release/rolling/mavlink
122+
RUN git clone --depth 1 -b ${MAVROS_RELEASE} https://github.com/mavlink/mavros.git
123+
RUN git clone --depth 1 --recursive -b ${MAVLINK_RELEASE} https://github.com/ros2-gbp/mavlink-gbp-release.git mavlink
124+
109125
WORKDIR $USER_WORKSPACE
110126
RUN sudo apt-get -q update \
111127
&& sudo apt-get -q -y upgrade \
112-
&& sudo chown -R ${USER_UID}:${USER_GID} src \
113128
&& vcs import src < src/blue/blue.repos \
114129
&& rosdep update \
115130
&& rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} \
@@ -119,16 +134,15 @@ RUN sudo apt-get -q update \
119134

120135
# Actually build workspace
121136
RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" \
122-
&& sudo chown -R ${USER_UID}:${USER_GID} $USER_WORKSPACE \
123137
&& colcon build
124138

125139
RUN echo "source ${USER_WORKSPACE}/install/setup.bash" >> /home/$USERNAME/.bashrc \
126-
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc
140+
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc \
141+
&& echo "source $VIRTUAL_ENV/bin/activate" >> /home/$USERNAME/.bashrc \
142+
&& echo "\n# Ensure colcon is run in the venv\nalias colcon='python3 -m colcon'" >> /home/$USERNAME/.bashrc
127143

128144
FROM robot AS desktop
129-
ARG USERNAME
130-
ARG USER_UID
131-
ARG USER_GID
145+
132146
ENV DEBIAN_FRONTEND=noninteractive
133147
ENV GZ_VERSION=harmonic
134148

@@ -137,18 +151,13 @@ ENV GZ_VERSION=harmonic
137151
# https://github.com/hadolint/hadolint/wiki/DL3004
138152
USER root
139153
# Install custom rosdep list
140-
# ADD --chown=root:root --chmod=0644 https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list /etc/ros/rosdep/sources.list.d/00-gazebo.list
141-
ADD https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list /etc/ros/rosdep/sources.list.d/00-gazebo.list
142-
143-
RUN sudo chown root:root /etc/ros/rosdep/sources.list.d/00-gazebo.list \
144-
&& sudo chmod 0644 /etc/ros/rosdep/sources.list.d/00-gazebo.list
145-
154+
ADD --chown=root:root --chmod=0644 https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list /etc/ros/rosdep/sources.list.d/00-gazebo.list
146155
RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \
147156
&& 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" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null \
148157
&& apt-get -q update \
149158
&& apt-get -y --quiet --no-install-recommends install \
159+
cppzmq-dev \
150160
gz-${GZ_VERSION} \
151-
ros-${ROS_DISTRO}-ros-gz${GZ_VERSION} \
152161
python3-pexpect \
153162
python3-wxgtk4.0 \
154163
python3-future \
@@ -160,7 +169,7 @@ RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pk
160169
&& apt-get clean -y \
161170
&& rm -rf /var/lib/apt/lists/*
162171
USER $USERNAME
163-
RUN echo $USERNAME
172+
164173
# Clone ArduSub
165174
# ArduSub is installed for simulation purposes ONLY
166175
# When deployed onto hardware, the native installation of ArduSub
@@ -174,7 +183,12 @@ RUN git clone -b ${ARDUPILOT_RELEASE} https://github.com/ArduPilot/ardupilot.git
174183
# Install ArduSub dependencies
175184
WORKDIR /home/$USERNAME/ardupilot
176185
ENV SKIP_AP_EXT_ENV=1 SKIP_AP_GRAPHIC_ENV=1 SKIP_AP_COV_ENV=1 SKIP_AP_GIT_CHECK=1
177-
RUN Tools/environment_install/install-prereqs-ubuntu.sh -y
186+
# Do not install the STM development tools
187+
ENV DO_AP_STM_ENV=0
188+
# Do not activate the Ardupilot venv by default
189+
ENV DO_PYTHON_VENV_ENV=0
190+
RUN echo "\n# Below from ardupilot script \"install-prereqs-ubuntu.sh\"\n" >> /home/$USERNAME/.bashrc && \
191+
Tools/environment_install/install-prereqs-ubuntu.sh -y
178192

179193
# Build ArduSub
180194
WORKDIR /home/$USERNAME/ardupilot
@@ -197,6 +211,7 @@ RUN [ "/bin/bash" , "-c" , " \
197211
WORKDIR $USER_WORKSPACE
198212
RUN sudo apt-get -q update \
199213
&& sudo apt-get -q -y upgrade \
214+
&& vcs import src < src/blue/sim.repos \
200215
&& rosdep update \
201216
&& rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --skip-keys="gz-transport12 gz-sim7 gz-math7 gz-msgs9 gz-plugin2" \
202217
&& sudo apt-get autoremove -y \
@@ -231,6 +246,15 @@ export GZ_SIM_SYSTEM_PLUGIN_PATH=\$HOME/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_P
231246
export GZ_SIM_RESOURCE_PATH=\$HOME/ardupilot_gazebo/models:\$HOME/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH
232247
EOT
233248

249+
FROM desktop AS desktop-nvidia
250+
251+
# Add ardupilot_gazebo plugin
252+
export GZ_SIM_SYSTEM_PLUGIN_PATH=\$HOME/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH
253+
254+
# Add ardupilot_gazebo models and worlds
255+
export GZ_SIM_RESOURCE_PATH=\$HOME/ardupilot_gazebo/models:\$HOME/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH
256+
EOT
257+
234258
FROM desktop AS desktop-nvidia
235259
ARG USERNAME
236260
ARG USER_UID
@@ -257,19 +281,3 @@ RUN sudo apt-get update \
257281
ENV NVIDIA_VISIBLE_DEVICES=all
258282
ENV NVIDIA_DRIVER_CAPABILITIES=graphics,utility,compute
259283
ENV QT_X11_NO_MITSHM=1
260-
261-
# # Incase rqt is not showing all the plugins.
262-
# RUN sudo apt update
263-
# RUN sudo apt install ros-${ROS_DISTRO}-rqt* -y
264-
265-
266-
267-
# # Install OMPL with ROS2
268-
# RUN curl http://repo.ros2.org/repos.key | sudo apt-key add -
269-
# RUN sudo apt-get update
270-
# RUN sudo apt-get install -y ros-${ROS_DISTRO}-ompl
271-
272-
# # Install learn_ros2
273-
# RUN cd ../..
274-
# RUN colcon build --packages-select learn_ros2
275-
# RUN . install/setup.bash

.github/workflows/docker.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ jobs:
3838

3939
- name: Set up Docker Buildx
4040
uses: docker/setup-buildx-action@v3
41+
with:
42+
# Pin docker-buildx to this version for now
43+
# v0.19.2 has issues with empty keys,
44+
# particularly the "*.cache-to=" used below
45+
#
46+
version: v0.18.0
4147

4248
- if: env.PUSH == 'true'
4349
name: Log into registry

.vscode/settings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
"autoDocstring.startOnNewLine": false,
2424
"autoDocstring.docstringFormat": "google-notypes",
2525
"python.autoComplete.extraPaths": [
26-
"/opt/ros/iron/lib/python3.10/site-packages/",
27-
"/opt/ros/iron/local/lib/python3.10/dist-packages/"
26+
"/opt/ros/rolling/lib/python3.12/site-packages/",
27+
"/opt/ros/rolling/local/lib/python3.12/dist-packages/"
2828
],
2929
"python.analysis.extraPaths": [
30-
"/opt/ros/iron/lib/python3.10/site-packages/",
31-
"/opt/ros/iron/local/lib/python3.10/dist-packages/"
30+
"/opt/ros/rolling/lib/python3.12/site-packages/",
31+
"/opt/ros/rolling/local/lib/python3.12/dist-packages/"
3232
],
3333
"[python]": {
3434
"editor.tabSize": 4,

docs/package-lock.json

Lines changed: 6 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)