From b1a23f32665586e8c7f1c355ca17fc3a2ea3f3d4 Mon Sep 17 00:00:00 2001 From: Sebastian Castro <4603398+sea-bass@users.noreply.github.com> Date: Fri, 2 Aug 2024 09:56:04 -0400 Subject: [PATCH] Install Gazebo as part of Tutorials image build (#937) * Install Gazebo as part of Tutorials image build * Use the named Gazebo version instead of a number --- .docker/Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index fbf1234f6f..bfe2769e9b 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,6 +1,7 @@ # syntax = docker/dockerfile:1.3 ARG ROS_DISTRO=rolling +ARG GZ_VERSION=harmonic ######################### Tutorial Image ################################################# @@ -8,6 +9,8 @@ FROM moveit/moveit2:${ROS_DISTRO}-source as tutorial_image LABEL org.opencontainers.image.description "This container has working versions of the tutorials discussed here: https://moveit.picknik.ai/main/doc/tutorials/tutorials.html" +ARG GZ_VERSION + # Copy sources from docker context COPY . src/moveit2_tutorials @@ -45,6 +48,12 @@ COPY ./doc/tutorials/pick_and_place_with_moveit_task_constructor/src/mtc_node.cp # Add the launch folder to the tutorial package and CMakeLists.txt COPY ./doc/tutorials/pick_and_place_with_moveit_task_constructor/launch src/mtc_tutorial/launch +# Install Gazebo, which is needed by some dependencies. +RUN 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 update && \ + sudo apt-get install -y "gz-${GZ_VERSION}" + # Add install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}) to CMakeLists.txt RUN sed -i "s|ament_package()|install(DIRECTORY launch DESTINATION share/\${PROJECT_NAME})\nament_package()|g" src/mtc_tutorial/CMakeLists.txt # Build the tutorials and set up the entrypoint/bashrc