Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add internal graphics option and unrecognized opt #28

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
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
18 changes: 14 additions & 4 deletions run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ Help()
# Display Help
echo "Runs a docker container with the image created by build.bash."
echo
echo "Syntax: scriptTemplate [-c|s|t|h]"
echo "Syntax: scriptTemplate [-c|i|r|s|t|h]"
echo "options:"
echo "c Add cuda library support."
echo "i With internal graphics card (without nvidia)"
echo "r With internal graphics card (without nvidia) and with RDP. default user is docker"
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."
Expand All @@ -45,12 +47,17 @@ Help()

JOY=/dev/input/js0
CUDA=""
ROCKER_ARGS="--devices $JOY --dev-helpers --nvidia --x11 --user --home --git"
ROCKER_ARGS="--devices /dev/dri $JOY --dev-helpers --nvidia --x11 --git --volume $(echo ~):/docker/HOST"

while getopts ":cstxh" option; do
while getopts ":cstxhir" 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 $(echo ~):/docker/HOST";;
r) # With internal graphics card (without nvidia) and with RDP default user is docker
# shellcheck disable=SC2116
ROCKER_ARGS="--devices /dev/dri $JOY --x11 --git --port 3389:3389 --volume $(echo ~):/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 +69,9 @@ while getopts ":cstxh" option; do
h) # print this help message and exit
Help
exit;;
\?) # handle unrecognized options
echo "Invalid option: -$OPTARG" >&2
exit 1;;
esac
done

Expand Down