diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c473f89..e4f0c06 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/clubcapra/gazebo:harmonic +FROM ros:humble-ros-base # Add vscode user with same UID and GID as your host system # (copied from https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user#_creating-a-nonroot-user) @@ -6,6 +6,10 @@ ARG USERNAME=rove ARG USER_UID=1000 ARG USER_GID=$USER_UID +# ENV variables +ENV ROS_DISTRO=humble +ENV GZ_VERSION=harmonic + WORKDIR /workspace/$USERNAME RUN groupadd --gid $USER_GID $USERNAME || true \ @@ -22,17 +26,41 @@ RUN apt update && apt upgrade -y # Install Git RUN apt install -y git +# Install necessary packages for Gazebo Garden and its dependencies +RUN apt-get update && apt-get install -y \ + software-properties-common \ + wget \ + lsb-release \ + gnupg \ + curl + +# Install Gazebo +RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg +RUN 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 + +RUN apt update -y + +RUN apt install -y ros-humble-ros-gzharmonic + +# Adding an APT update and clean step +RUN apt-get update && \ + apt-get install -y --no-install-recommends apt-utils && \ + rm -rf /var/lib/apt/lists/* && \ + apt-get clean && \ + apt-get update + # Change user +RUN chown $USER_UID:$USER_GID /workspace/$USERNAME + USER $USERNAME # Source the ROS setup file -RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc && \ - echo "source /gazebo/gazebo_ws/install/setup.bash" >> ~/.bashrc +RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc + +COPY --chown=$USERNAME ./ /workspace/$USERNAME # Install ROS dependencies RUN rosdep update -# Copy to preload the ros packages -COPY ./ /workspace/$USERNAME/ -RUN rosdep install --from-paths src --ignore-src --rosdistro humble -y +RUN rosdep install --from-paths src --ignore-src --rosdistro humble -y diff --git a/src/rove_description/package.xml b/src/rove_description/package.xml index b9e3ba1..340d14a 100644 --- a/src/rove_description/package.xml +++ b/src/rove_description/package.xml @@ -9,7 +9,6 @@ rviz2 xacro - ros_gz_bridge velodyne_description ament_cmake