diff --git a/README.md b/README.md index da78a43..b1a4794 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Docker Images for ROS 2 Development +# Docker Images for ROS Development -This repository provides Docker images designed to simplify ROS 2 development. These images come pre-configured with the necessary ROS 2 packages and tools, allowing you to get started with your robotics projects quickly and efficiently. +This repository provides Docker images designed to simplify ROS 2 and ROS 1 development. These images come pre-configured with the necessary ROS packages and tools, allowing you to get started with your robotics projects quickly and efficiently. ## Available Images @@ -10,6 +10,7 @@ The following Docker images are available: * `humble-garden`: Extends the `humble` image and includes Gazebo Garden, a powerful 3D robotics simulator. * `iron`: Based on `ubuntu:jammy`, this image includes ROS 2 Iron Irwini packages and a non-root user. * `iron-garden`: Extends the `iron` image and includes Gazebo Garden. +* `noetic`: Based on `ubuntu:focal`, this image includes ROS Noetic Ninjemys packages and a non-root user. **Important Note:** The `iron` and `iron-garden` images are currently **under development** and have not been heavily tested. They may be unstable or contain significant bugs. @@ -69,6 +70,8 @@ The following repositories demonstrate how to use these Docker images in real-wo * **[6DOF_ObjectFollowing](https://github.com/soham2560/6DOF_ObjectFollowing)**: Implements a 6-DOF object following system using ROS 2 and the `humble-garden` image within a Dev Container. * **[ros2_tutorial_repo](https://github.com/soham2560/ros2_tutorial_repo)**: A basic ROS 2 tutorial repository demonstrating fundamental concepts, configured with the `humble` image within a Dev Container. +* **[Husky Mobile robot](https://github.com/RoboticsIIITH/husky_ws)**: Basic ROS Noetic packages for running the Husky mobile robot on AMD64/x86 device. +* **[P3DX Mobile robot](https://github.com/rtarun1/P3DX-Docker)**: Basic ROS Noetic packages for running the P3DX mobile robot on AMD64/x86 device. ## Contributing diff --git a/noetic/Dockerfile b/noetic/Dockerfile new file mode 100644 index 0000000..df55245 --- /dev/null +++ b/noetic/Dockerfile @@ -0,0 +1,82 @@ +FROM ubuntu:focal + +# basic args +ENV ROS_DISTRO=noetic +ARG USERNAME=container_user +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +# Add the following labels +LABEL org.opencontainers.image.description="ROS1 Development Container" +LABEL org.opencontainers.image.title="ROS1DevCon" +LABEL org.opencontainers.image.vendor="Tarun R" +LABEL org.opencontainers.image.source="https://github.com/soham2560/DockerForROS2Development" +LABEL maintainer="tarun.ramak@gmail.com" +LABEL org.opencontainers.image.licenses="MIT" +# handle default shell +SHELL ["/bin/bash", "-c"] +ENV SHELL=/bin/bash + +# setup timezone +RUN echo 'Asia/Kolkata' > /etc/timezone && \ + ln -s /usr/share/zoneinfo/Asia/Kolkata /etc/localtime && \ + apt-get update && \ + apt-get install -q -y --no-install-recommends tzdata && \ + rm -rf /var/lib/apt/lists/* + +RUN apt-get update && apt-get install -q -y --no-install-recommends \ + dirmngr \ + gnupg2 \ + && rm -rf /var/lib/apt/lists/* + +# setup keys +RUN set -eux; \ + key='C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654'; \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ + mkdir -p /usr/share/keyrings; \ + gpg --batch --export "$key" > /usr/share/keyrings/ros1-latest-archive-keyring.gpg; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" + +# setup sources.list +RUN echo "deb [ signed-by=/usr/share/keyrings/ros1-latest-archive-keyring.gpg ] http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list + +# setup environment +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +# Create non root user with sudo privilege +RUN groupadd --gid $USER_GID $USERNAME \ + && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ + && apt-get update \ + && apt-get install -y sudo \ + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME +USER $USERNAME + +ENV ROS_DISTRO=$ROS_DISTRO + +# install ros1 packages +RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends \ + ros-$ROS_DISTRO-desktop-full=1.5.0-1* \ + && sudo rm -rf /var/lib/apt/lists/* + +# setup entrypoint +COPY ./ros_entrypoint.sh / +ENTRYPOINT ["/ros_entrypoint.sh"] + +# install bootstrap tools +RUN sudo apt-get update && sudo apt-get install --no-install-recommends -y \ + build-essential \ + python3-rosdep \ + python3-rosinstall \ + python3-vcstools \ + git \ + && sudo rm -rf /var/lib/apt/lists/* + +# bootstrap rosdep +RUN sudo rosdep init && \ + rosdep update --rosdistro $ROS_DISTRO + +RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" | sudo tee -a ~/.bashrc > /dev/null \ No newline at end of file diff --git a/noetic/ros_entrypoint.sh b/noetic/ros_entrypoint.sh new file mode 100644 index 0000000..3214333 --- /dev/null +++ b/noetic/ros_entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +# setup ros environment +source "/opt/ros/$ROS_DISTRO/setup.bash" -- +exec "$@" \ No newline at end of file