diff --git a/README.md b/README.md index 890125c..e8f8af1 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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: diff --git a/jazzy/Dockerfile b/jazzy/Dockerfile new file mode 100644 index 0000000..95905fc --- /dev/null +++ b/jazzy/Dockerfile @@ -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/* diff --git a/noetic/Dockerfile b/noetic/Dockerfile index 7ebb32a..4ba80a3 100644 --- a/noetic/Dockerfile +++ b/noetic/Dockerfile @@ -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 \ diff --git a/run.bash b/run.bash index 09d3d96..d84162a 100755 --- a/run.bash +++ b/run.bash @@ -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." @@ -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 @@ -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