Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Docker images used across multiple repositories supporting simulation of water-r
## Distributions
This repository supports baseline images for running Gazebo on the following ROS distributions:

* Jazzy (Ubuntu 24.04 Noble Numbat / ROS 2 Jazzy Jalisco / Gazebo Harmonic)
* Humble (Ubuntu 22.04 Jammy Jellyfish / ROS 2 Humble Hawksbill / Gazebo Garden)
* Galactic (Ubuntu 20.04 Focal Fossa / ROS 2 Galactic Geochelone / Ignition Fortress)
* Noetic (Ubuntu 20.04 Focal Fossa / ROS Noetic Ninjemys / Gazebo 11)
Expand All @@ -14,9 +15,9 @@ This repository supports baseline images for running Gazebo on the following ROS
The latest images corresponding to each of the three distributions above are stored in the [`npslearninglab/watery_robots` repository on Dockerhub](https://hub.docker.com/r/npslearninglab/watery_robots).

## Build Instructions
Build the base image with the `build.bash` script.
Build the base image with the `build.bash` script.
```
DIST=(noetic | melodic | kinetic)
DIST=(jazzy | humble | galactic | noetic | melodic | kinetic)
./build.bash ${DIST}
```
Run the image locally using the `run.bash` script:
Expand Down
102 changes: 102 additions & 0 deletions jazzy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Ubuntu 24.04
FROM ros:jazzy-ros-base-noble

ENV DEBIAN_FRONTEND=noninteractive

# Setup timezone
ENV TZ=Etc/UTC
RUN echo $TZ > /etc/timezone && \
ln -fs /usr/share/zoneinfo/$TZ /etc/localtime

# Tools necessary and useful during development
RUN apt-get -q update \
&& apt-get -q -y upgrade \
&& apt-get -q install --no-install-recommends -y \
build-essential \
atop \
ca-certificates \
cmake \
cppcheck \
curl \
expect \
gdb \
git \
gnupg2 \
gnutls-bin \
iputils-ping \
libbluetooth-dev \
libccd-dev \
libcwiid-dev \
libeigen3-dev \
libfcl-dev \
libgflags-dev \
libgles2-mesa-dev \
libgoogle-glog-dev \
libspnav-dev \
libusb-dev \
lsb-release \
net-tools \
pkg-config \
protobuf-compiler \
python3-dbg \
python3-empy \
python3-numpy \
python3-setuptools \
python3-pip \
python3-venv \
ruby \
software-properties-common \
sudo \
vim \
wget \
xvfb \
&& apt clean -qq

# Setup locale
RUN sudo apt update && sudo apt install locales \
&& sudo locale-gen en_US en_US.UTF-8 \
&& sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \
&& export LANG=en_US.UTF-8

ARG ROSDIST=jazzy
ARG GZDIST=harmonic
ENV GZ_VERSION harmonic

# Install Gazebo and ROS2 Desktop
RUN sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \
&& 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 \
&& sudo apt-get -q update \
&& sudo apt-get -y --quiet --no-install-recommends install \
gz-${GZDIST} \
ros-${ROSDIST}-desktop \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

# Install some 'standard' ROS packages and utilities.
RUN sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' \
&& wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - \
&& sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& sudo apt-get -q install --no-install-recommends -y \
libsdformat14 \
python3-colcon-common-extensions \
python3-vcstool \
ros-${ROSDIST}-actuator-msgs \
ros-${ROSDIST}-ament-cmake-pycodestyle \
ros-${ROSDIST}-image-transport \
ros-${ROSDIST}-image-transport-plugins \
ros-${ROSDIST}-joy-teleop \
ros-${ROSDIST}-joy-linux \
ros-${ROSDIST}-mavros-msgs \
ros-${ROSDIST}-radar-msgs \
ros-${ROSDIST}-ros-gz \
ros-${ROSDIST}-rqt-graph \
ros-${ROSDIST}-rqt-image-view \
ros-${ROSDIST}-rqt-plot \
ros-${ROSDIST}-rqt-topic \
ros-${ROSDIST}-rviz2 \
ros-${ROSDIST}-xacro \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*
1 change: 1 addition & 0 deletions noetic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ RUN /bin/sh -c 'echo "deb http://packages.ros.org/ros/ubuntu ${RELEASE} main" >
python3-rosinstall \
python3-rosinstall-generator \
python3-vcstool \
python3-colcon-common-extensions \
ros-${DIST}-gazebo-plugins \
ros-${DIST}-gazebo-ros \
ros-${DIST}-gazebo-ros-control \
Expand Down
49 changes: 34 additions & 15 deletions run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,39 @@
############################################################
Help()
{
# Display Help
echo "Runs a docker container with the image created by build.bash."
echo
echo "Syntax: scriptTemplate [-c|s|t|h]"
echo "options:"
echo "c Add cuda library support."
echo "s Create an image with novnc for use with cloudsim."
echo "t Create a test image for use with CI pipelines."
echo "x Create base image for the VRX competition server."
echo "h Print this help message and exit."
echo
# Display Help
echo "Runs a docker container with the image created by build.bash."
echo
echo "Syntax: $(basename $0) [-p <host_port>] [-c|i|r|s|t|h] <docker_img_name>"
echo "options:"
echo "r With internal graphics card (without nvidia) and with RDP. The default user in container is 'docker' due to RDP constraints (custom host port can be set via the -p option)"
echo "c Add cuda library support."
echo "i With internal graphics card (without nvidia)"
echo "p Override host RDP port (follow syntax for usage, only affects -r option)"
echo "s Create an image with novnc for use with cloudsim."
echo "t Create a test image for use with CI pipelines."
echo "x Create base image for the VRX competition server."
echo "h Print this help message and exit."

echo
}


JOY=/dev/input/js0
CUDA=""
ROCKER_ARGS="--devices $JOY --dev-helpers --nvidia --x11 --user --home --git"
HOST_RDP_PORT=3389
ROCKER_ARGS="--devices /dev/dri $JOY --dev-helpers --nvidia --x11 --git --volume "$HOME":/root/HOST"

while getopts ":cstxh" option; do
while getopts ":cstxhirp:" option; do
case $option in
c) # enable cuda library support
CUDA="--cuda ";;
CUDA="--cuda";;
i) # With internal graphics card (without nvidia)
ROCKER_ARGS="--devices /dev/dri $JOY --x11 --git --volume "$HOME":/root/HOST";;
r) # With internal graphics card (without nvidia) and with RDP.
# The default user in container is 'docker' due to RDP constraints (custom host port can be set via the -p option)
# shellcheck disable=SC2116
ROCKER_ARGS="--devices /dev/dri $JOY --x11 --git --port "$HOST_RDP_PORT":3389 --volume "$HOME":/home/docker/HOST";;
s) # Build cloudsim image
ROCKER_ARGS="--nvidia --novnc --turbovnc --user --user-override-name=developer";;
t) # Build test image for Continuous Integration
Expand All @@ -62,6 +73,14 @@ while getopts ":cstxh" option; do
h) # print this help message and exit
Help
exit;;
p) # Override host RDP port
HOST_RDP_PORT=$OPTARG;;
:) #handle missing arguments
echo "Error: Option -$OPTARG requires an argument." >&2
exit 1;;
\?) # handle unrecognized options
echo "Invalid option: -$OPTARG" >&2
exit 1;;
esac
done

Expand All @@ -73,4 +92,4 @@ CONTAINER_NAME="$(tr ':' '_' <<< "$IMG_NAME")_runtime"
ROCKER_ARGS="${ROCKER_ARGS} --name $CONTAINER_NAME"
echo "Using image <$IMG_NAME> to start container <$CONTAINER_NAME>"

rocker ${CUDA} ${ROCKER_ARGS} $IMG_NAME
rocker ${CUDA} ${ROCKER_ARGS} $IMG_NAME