From 756d5b533a54a107604a8a678ab0303c11837211 Mon Sep 17 00:00:00 2001 From: Sebastian Castro Date: Thu, 1 Aug 2024 18:31:07 -0400 Subject: [PATCH 1/2] Install Gazebo as part of Tutorials image build --- .docker/Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index fbf1234f6f..429c5fc308 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,6 +1,7 @@ # syntax = docker/dockerfile:1.3 ARG ROS_DISTRO=rolling +ARG GZ_VERSION=8 ######################### 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 "libgz-sim${GZ_VERSION}-dev" + # 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 From e93672155b646583037e28efbf029272cd1684cb Mon Sep 17 00:00:00 2001 From: Sebastian Castro Date: Thu, 1 Aug 2024 19:01:25 -0400 Subject: [PATCH 2/2] Use the named Gazebo version instead of a number --- .docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 429c5fc308..bfe2769e9b 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,7 +1,7 @@ # syntax = docker/dockerfile:1.3 ARG ROS_DISTRO=rolling -ARG GZ_VERSION=8 +ARG GZ_VERSION=harmonic ######################### Tutorial Image ################################################# @@ -52,7 +52,7 @@ COPY ./doc/tutorials/pick_and_place_with_moveit_task_constructor/launch src/mtc_ 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 "libgz-sim${GZ_VERSION}-dev" + 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