Skip to content

Commit

Permalink
Update Dockerfile to install stable version of webots_ros2
Browse files Browse the repository at this point in the history
Signed-off-by: IDavGal <[email protected]>
  • Loading branch information
IDavGal committed Jul 12, 2023
1 parent 50f51f2 commit 7ae1dea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM osrf/ros:humble-desktop-full

ARG COLCON_WS=/colcon_ws
ARG WEBOTS_ROS2_WS=/ros2_ws

COPY noah_description ${COLCON_WS}/src/noah_description
COPY noah_gazebo ${COLCON_WS}/src/noah_gazebo
Expand All @@ -12,22 +13,24 @@ RUN apt-get update && apt-get install -y \
software-properties-common \
wget

RUN wget -qO- https://cyberbotics.com/Cyberbotics.asc | sudo apt-key add -
RUN sudo wget -q https://cyberbotics.com/Cyberbotics.asc -O /etc/apt/keyrings/Cyberbotics.asc


RUN apt-add-repository 'deb https://cyberbotics.com/debian/ binary-amd64/'
RUN echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/Cyberbotics.asc] https://cyberbotics.com/debian binary-amd64/" | sudo tee /etc/apt/sources.list.d/Cyberbotics.list

RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
webots \
ros-humble-webots-ros2
webots

# Install the 2023.1.1 release of webots_ros2
RUN git clone --recurse-submodules --branch 2023.1.1 https://github.com/cyberbotics/webots_ros2.git ${WEBOTS_ROS2_WS}/src/webots_ros2

RUN apt-get update && \
apt-get -y dist-upgrade && \
. /opt/ros/humble/setup.sh && \
rosdep update && \
rosdep install --from-paths ${COLCON_WS}/src --ignore-src -r -y && \
rosdep install --from-paths ${COLCON_WS}/src ${WEBOTS_ROS2_WS}/src --ignore-src -r -y && \
colcon build --base-paths ${COLCON_WS}/src/ --build-base ${COLCON_WS}/build --install-base ${COLCON_WS}/install && \
colcon build --base-paths ${WEBOTS_ROS2_WS}/src/ --build-base ${WEBOTS_ROS2_WS}/build --install-base ${WEBOTS_ROS2_WS}/install && \
rm -rf /var/lib/apt/lists/*

# Env vars for the nvidia-container-runtime.
Expand Down
3 changes: 3 additions & 0 deletions docker/entrypoint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -e
export ROS_DISTRO=humble
export COLCON_WS=/colcon_ws

echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
echo "source /ros2_ws/install/local_setup.bash" >> ~/.bashrc

# setup ros2 environment
source "/opt/ros/${ROS_DISTRO}/setup.bash" --
# source gazebo
Expand Down

0 comments on commit 7ae1dea

Please sign in to comment.