Skip to content

Commit

Permalink
Merge pull request #45 from clubcapra/43-well-gazebo-again
Browse files Browse the repository at this point in the history
real fix, I hope
  • Loading branch information
SimonR99 authored Apr 7, 2024
2 parents ea74103 + 725599f commit 18880f2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
40 changes: 34 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
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)
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 \
Expand All @@ -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
1 change: 0 additions & 1 deletion src/rove_description/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

<exec_depend>rviz2</exec_depend>
<exec_depend>xacro</exec_depend>
<exec_depend>ros_gz_bridge</exec_depend>
<exec_depend>velodyne_description</exec_depend>

<buildtool_depend>ament_cmake</buildtool_depend>
Expand Down

0 comments on commit 18880f2

Please sign in to comment.