Bläddra i källkod

Dockerscript simplification (#23)

- Add additional arguments to pick ros distro and ubuntu distro and simplify
- Merge simulation and navstack into one dockerscript
- Created agnostic LaunchNavStack.bash script
- Consolidate and simplify docker script

Signed-off-by: Steve Pham <[email protected]>
Steve Pham 2 år sedan
förälder
incheckning
44543b3264

+ 140 - 0
Docker/Dockerfile

@@ -0,0 +1,140 @@
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+# Collect the arguments for the base ros image
+ARG ROS_VERSION=humble
+ARG UBUNTU_VERSION=jammy
+
+FROM ros:${ROS_VERSION}-ros-base-${UBUNTU_VERSION}
+
+ARG ROS_VERSION
+ARG UBUNTU_VERSION
+
+
+# Argument to determining the image type ('simulation' or 'navstack')
+ARG IMAGE_TYPE=simulation  # Default to 'simulation'
+
+
+# Arguments for the source repos needed for the robot vacuum sample docker
+
+ARG O3DE_REPO=https://github.com/o3de/o3de.git
+ARG O3DE_BRANCH=development
+
+ARG ROS2_GEM_REPO=https://github.com/RobotecAI/o3de-ros2-gem.git
+ARG ROS2_GEM_BRANCH=development
+
+ARG LOFT_GEM_REPO=https://github.com/o3de/loft-arch-vis-sample.git
+ARG LOFT_GEM_BRANCH=main
+
+ARG ROBOT_VAC_SAMPLE_REPO=https://github.com/RobotecAI/o3de-demo-project.git
+ARG ROBOT_VAC_SAMPLE_BRANCH=main
+
+ENV WORKSPACE=/data/workspace
+
+WORKDIR $WORKSPACE
+
+RUN apt-get update && apt-get upgrade -y
+
+# Add additional package repositories needed for packages
+RUN apt-get install -y --no-install-recommends gpg wget curl
+
+
+# For ubuntu 20.04 (focal) then default version of cmake is not supported. Update and get version 3.24.1 from kitware
+RUN if [ "${UBUNTU_VERSION}" = "focal" ]; then \
+      wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \
+        gpg --dearmor - | \
+        tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null \
+      && echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | \
+        tee /etc/apt/sources.list.d/kitware.list >/dev/null \
+      && apt-get update; \
+    fi
+
+#
+# Install packages needed for cloning and building from the source repos
+#
+
+# Install the git and build tools
+RUN apt-get install -y --no-install-recommends git \
+                       git-lfs \
+                       clang-12 \
+                       ninja-build \
+                       cmake \
+                       libglu1-mesa-dev \
+                       libxcb-xinerama0 \
+                       libxcb-xinput0 \
+                       libxcb-xinput-dev \
+                       libxcb-xfixes0-dev \
+                       libxcb-xkb-dev \
+                       libxkbcommon-dev \
+                       libxkbcommon-x11-dev \
+                       libfontconfig1-dev \
+                       libcurl4-openssl-dev \
+                       libsdl2-dev \
+                       zlib1g-dev \
+                       mesa-common-dev \
+                       libssl-dev libxcb-icccm4 \
+                       libxcb-image0 \
+                       libxcb-keysyms1 \
+                       libxcb-render-util0 \
+                       libxcb-randr0 \
+                       libnvidia-gl-470 \
+                       ufw \
+                       ros-${ROS_VERSION}-slam-toolbox \
+                       ros-${ROS_VERSION}-navigation2 \
+                       ros-${ROS_VERSION}-nav2-bringup \
+                       ros-${ROS_VERSION}-pointcloud-to-laserscan \
+                       ros-${ROS_VERSION}-gazebo-msgs \
+                       ros-${ROS_VERSION}-ackermann-msgs \
+                       ros-${ROS_VERSION}-rmw-cyclonedds-cpp \
+                       ros-${ROS_VERSION}-control-toolbox
+
+
+COPY cleanup.bash /data/workspace/cleanup.bash
+
+# Clone O3DE repos, register, build, and cleanup in the same layer to reduce the size
+RUN if [ "${IMAGE_TYPE}" = "simulation" ]; then \
+        cd $WORKSPACE && \
+        git clone --recursive $O3DE_REPO && \
+        git -C $WORKSPACE/o3de checkout $O3DE_BRANCH &&\
+        git -C $WORKSPACE/o3de lfs install && \
+        git -C $WORKSPACE/o3de lfs pull && \
+        $WORKSPACE/o3de/python/get_python.sh && \
+        $WORKSPACE/o3de/scripts/o3de.sh register -ep $WORKSPACE/o3de && \
+        git clone $ROS2_GEM_REPO && \
+        git -C $WORKSPACE/o3de-ros2-gem checkout $ROS2_GEM_BRANCH &&\
+        $WORKSPACE/o3de/scripts/o3de.sh register -gp $WORKSPACE/o3de-ros2-gem && \
+        git clone --recursive $LOFT_GEM_REPO && \
+        git -C $WORKSPACE/loft-arch-vis-sample checkout $LOFT_GEM_BRANCH &&\
+        git -C $WORKSPACE/loft-arch-vis-sample lfs install && \
+        git -C $WORKSPACE/loft-arch-vis-sample lfs pull && \
+        $WORKSPACE/o3de/scripts/o3de.sh register -gp $WORKSPACE/loft-arch-vis-sample/Gems/ArchVis/ && \
+        git clone --recursive $ROBOT_VAC_SAMPLE_REPO && \
+        git -C $WORKSPACE/o3de-demo-project checkout $ROBOT_VAC_SAMPLE_BRANCH &&\
+        git -C $WORKSPACE/o3de-demo-project lfs install && \
+        git -C $WORKSPACE/o3de-demo-project lfs pull && \
+        $WORKSPACE/o3de/scripts/o3de.sh register -pp $WORKSPACE/o3de-demo-project/  && \
+        . /opt/ros/${ROS_VERSION}/setup.sh && \
+        cmake -B $WORKSPACE/o3de-demo-project/build/linux -S $WORKSPACE/o3de-demo-project -G "Ninja Multi-Config" -DLY_STRIP_DEBUG_SYMBOLS=TRUE -DLY_DISABLE_TEST_MODULES=ON && \
+        cmake --build $WORKSPACE/o3de-demo-project/build/linux --config profile --target AssetProcessorBatch ROS2-Gem-Demo.GameLauncher ROS2-Gem-Demo.Assets -j 20 && \
+        $WORKSPACE/cleanup.bash; \
+    elif [  "${IMAGE_TYPE}" = "navstack" ]; then \
+        apt-get install -y --no-install-recommends ros-${ROS_DISTRO}-desktop && \
+        cd $WORKSPACE && \
+        git clone --recursive $ROBOT_VAC_SAMPLE_REPO && \
+        git -C $WORKSPACE/o3de-demo-project checkout $ROBOT_VAC_SAMPLE_BRANCH; \
+    else \
+        echo "Unsupported IMAGE_TYPE: ${IMAGE_TYPE}" && exit 1; \
+    fi
+
+COPY LaunchSimulation.bash /data/workspace/LaunchSimulation.bash
+COPY LaunchNavStack.bash /data/workspace/LaunchNavStack.bash
+
+ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp 
+
+ENV NVIDIA_VISIBLE_DEVICES all
+ENV NVIDIA_DRIVER_CAPABILITIES all
+ 
+ENTRYPOINT ["/bin/bash", "-c"]

+ 0 - 60
Docker/Dockerfile.navstack.ubuntu-galactic

@@ -1,60 +0,0 @@
-# Copyright (c) Contributors to the Open 3D Engine Project.
-# For complete copyright and license terms please see the LICENSE at the root of this distribution.
-#
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-
-FROM ros:galactic-ros-base-focal
-
-ARG o3de_demo_branch=main
-
-ENV WORKSPACE=/data/workspace
-
-ENV DEBIAN_FRONTEND=noninteractive
-
-ENV O3DE_DEMO_REPO=https://github.com/RobotecAI/o3de-demo-project.git
-
-WORKDIR $WORKSPACE
-
-RUN apt-get update && apt-get upgrade -y
-
-# Add additional package repositories needed for packages
-RUN apt-get install -y --no-install-recommends gpg wget
-
-#
-# Install packages needed for cloning and building from the source repos
-#
-
-# InLaunchNavStackstall the git and build tools
-RUN apt-get install -y --no-install-recommends git 
-
-# Add additional ROS2/Galactic packages
-RUN /bin/bash -c 'source /opt/ros/galactic/setup.bash && \
-                  apt install --no-install-recommends -y ros-${ROS_DISTRO}-desktop \
-                                                         ros-${ROS_DISTRO}-slam-toolbox \
-                                                         ros-${ROS_DISTRO}-navigation2 \
-                                                         ros-${ROS_DISTRO}-nav2-bringup \
-                                                         ros-${ROS_DISTRO}-pointcloud-to-laserscan \
-                                                         ros-${ROS_DISTRO}-gazebo-msgs \
-                                                         ros-${ROS_DISTRO}-ackermann-msgs \
-                                                         ros-${ROS_DISTRO}-control-toolbox'
-
-# Install the O3DE-specific required packages
-RUN apt-get install -y --no-install-recommends libglu1-mesa-dev \
-                                               mesa-common-dev \
-                                               libnvidia-gl-470
-
-# Clone the demo project and register the project
-RUN cd $WORKSPACE && \
-    git clone --recursive $O3DE_DEMO_REPO && \
-    git -C $WORKSPACE/o3de-demo-project checkout $o3de_demo_branch
-
-COPY LaunchNavStack.bash.ubuntu-galactic /data/workspace/LaunchNavStack.bash
-
-ENV NVIDIA_VISIBLE_DEVICES all
-ENV NVIDIA_DRIVER_CAPABILITIES all
- 
-ENTRYPOINT ["/bin/bash", "-c"]
-
-
-

+ 0 - 64
Docker/Dockerfile.navstack.ubuntu-humble

@@ -1,64 +0,0 @@
-# Copyright (c) Contributors to the Open 3D Engine Project.
-# For complete copyright and license terms please see the LICENSE at the root of this distribution.
-#
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-
-FROM ros:humble-ros-base-jammy
-
-ARG o3de_demo_branch=main
-
-ENV WORKSPACE=/data/workspace
-
-ENV DEBIAN_FRONTEND=noninteractive
-
-ENV O3DE_DEMO_REPO=https://github.com/RobotecAI/o3de-demo-project.git
-
-WORKDIR $WORKSPACE
-
-RUN apt-get update && apt-get upgrade -y
-
-# Add additional package repositories needed for packages
-RUN apt-get install -y --no-install-recommends gpg wget curl
-
-#
-# Install packages needed for cloning and building from the source repos
-#
-
-# Install the git and build tools
-RUN apt-get install -y --no-install-recommends git 
-
-# Add additional ROS2/Humble packages
-RUN /bin/bash -c 'source /opt/ros/humble/setup.bash && \
-                  apt install --no-install-recommends -y ros-${ROS_DISTRO}-desktop \
-                                                         ros-${ROS_DISTRO}-slam-toolbox \
-                                                         ros-${ROS_DISTRO}-navigation2 \
-                                                         ros-${ROS_DISTRO}-nav2-bringup \
-                                                         ros-${ROS_DISTRO}-pointcloud-to-laserscan \
-                                                         ros-${ROS_DISTRO}-gazebo-msgs \
-                                                         ros-${ROS_DISTRO}-ackermann-msgs \
-                                                         ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \
-                                                         ros-${ROS_DISTRO}-control-toolbox'
-
-
-# Install the O3DE-specific required packages
-RUN apt-get install -y --no-install-recommends libglu1-mesa-dev \
-                                               mesa-common-dev \
-                                               libnvidia-gl-470
-
-# Clone the demo project and register the project
-RUN cd $WORKSPACE && \
-    git clone --recursive $O3DE_DEMO_REPO && \
-    git -C $WORKSPACE/o3de-demo-project checkout $o3de_demo_branch
-
-COPY LaunchNavStack.bash.ubuntu-humble /data/workspace/LaunchNavStack.bash
-
-ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp 
-
-ENV NVIDIA_VISIBLE_DEVICES all
-ENV NVIDIA_DRIVER_CAPABILITIES all
- 
-ENTRYPOINT ["/bin/bash", "-c"]
-
-
-

+ 0 - 109
Docker/Dockerfile.simulation.ubuntu-galactic

@@ -1,109 +0,0 @@
-# Copyright (c) Contributors to the Open 3D Engine Project.
-# For complete copyright and license terms please see the LICENSE at the root of this distribution.
-#
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-
-FROM ros:galactic-ros-base-focal
-
-ARG o3de_branch=development
-ARG ros2_gem_branch=development
-ARG loft_gem_branch=main
-ARG o3de_demo_branch=main
-
-ENV WORKSPACE=/data/workspace
-
-ENV O3DE_REPO=https://github.com/o3de/o3de.git
-ENV ROS2_GEM_REPO=https://github.com/RobotecAI/o3de-ros2-gem.git
-ENV LOFT_GEM_REPO=https://github.com/o3de/loft-arch-vis-sample.git
-ENV O3DE_DEMO_REPO=https://github.com/RobotecAI/o3de-demo-project.git
-
-WORKDIR $WORKSPACE
-
-COPY LaunchSimulation.bash.ubuntu-galactic /data/workspace/LaunchSimulation.bash
-COPY cleanup.bash /data/workspace/cleanup.bash
-
-RUN apt-get update && apt-get upgrade -y
-
-# Add additional package repositories needed for packages
-RUN apt-get install -y --no-install-recommends gpg wget curl
-
-# Configure the installation of the minimal version of cmake (3.24) from kitware's apt repo since the default cmake version of ubuntu focal does not meet it
-RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \
-    echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
-
-RUN apt-get update
-
-#
-# Install packages needed for cloning and building from the source repos
-#
-
-# Install the git and build tools
-RUN apt-get install -y --no-install-recommends git \
-                       git-lfs \
-                       cmake=3.24.1-0kitware1ubuntu20.04.1 \
-                       clang-12 \
-                       ninja-build \
-                       libglu1-mesa-dev \
-                       libxcb-xinerama0 \
-                       libxcb-xinput0 \
-                       libxcb-xinput-dev \
-                       libxcb-xfixes0-dev \
-                       libxcb-xkb-dev \
-                       libxkbcommon-dev \
-                       libxkbcommon-x11-dev \
-                       libfontconfig1-dev \
-                       libcurl4-openssl-dev \
-                       libsdl2-dev \
-                       zlib1g-dev \
-                       mesa-common-dev \
-                       libssl-dev libxcb-icccm4 \
-                       libxcb-image0 \
-                       libxcb-keysyms1 \
-                       libxcb-render-util0 \
-                       libxcb-randr0 \
-                       libnvidia-gl-470 \
-                       ufw
-
-# Add additional ROS2/Galactic packages
-RUN /bin/bash -c 'source /opt/ros/galactic/setup.bash && \
-                  apt install -y ros-${ROS_DISTRO}-slam-toolbox \
-                                 ros-${ROS_DISTRO}-navigation2 \
-                                 ros-${ROS_DISTRO}-nav2-bringup \
-                                 ros-${ROS_DISTRO}-pointcloud-to-laserscan \
-                                 ros-${ROS_DISTRO}-gazebo-msgs \
-                                 ros-${ROS_DISTRO}-ackermann-msgs \
-                                 ros-${ROS_DISTRO}-control-toolbox'
-
-
-# Clone O3DE repos, register, build, and cleanup in the same layer to reduce the size
-RUN cd $WORKSPACE && \
-    git clone --recursive $O3DE_REPO && \
-    git -C $WORKSPACE/o3de checkout $o3de_branch &&\
-    git -C $WORKSPACE/o3de lfs install && \
-    git -C $WORKSPACE/o3de lfs pull && \
-    $WORKSPACE/o3de/python/get_python.sh && \
-    $WORKSPACE/o3de/scripts/o3de.sh register -ep $WORKSPACE/o3de && \
-    git clone $ROS2_GEM_REPO && \
-    git -C $WORKSPACE/o3de-ros2-gem checkout $ros2_gem_branch &&\
-    $WORKSPACE/o3de/scripts/o3de.sh register -gp $WORKSPACE/o3de-ros2-gem && \
-    git clone --recursive $LOFT_GEM_REPO && \
-    git -C $WORKSPACE/loft-arch-vis-sample checkout $loft_gem_branch &&\
-    git -C $WORKSPACE/loft-arch-vis-sample lfs install && \
-    git -C $WORKSPACE/loft-arch-vis-sample lfs pull && \
-    $WORKSPACE/o3de/scripts/o3de.sh register -gp $WORKSPACE/loft-arch-vis-sample/Gems/ArchVis/ && \
-    git clone --recursive $O3DE_DEMO_REPO && \
-    git -C $WORKSPACE/o3de-demo-project checkout $o3de_demo_branch &&\
-    git -C $WORKSPACE/o3de-demo-project lfs install && \
-    git -C $WORKSPACE/o3de-demo-project lfs pull && \
-    $WORKSPACE/o3de/scripts/o3de.sh register -pp $WORKSPACE/o3de-demo-project/  && \
-    /bin/bash -c 'source /opt/ros/galactic/setup.bash && \
-                  cmake -B $WORKSPACE/o3de-demo-project/build/linux -S $WORKSPACE/o3de-demo-project -G "Ninja Multi-Config" -DLY_STRIP_DEBUG_SYMBOLS=TRUE -DLY_DISABLE_TEST_MODULES=ON && \
-                  cmake --build $WORKSPACE/o3de-demo-project/build/linux --config profile --target AssetProcessorBatch ROS2-Gem-Demo.GameLauncher ROS2-Gem-Demo.Assets && \
-                  $WORKSPACE/cleanup.bash'
-
- 
-ENV NVIDIA_VISIBLE_DEVICES all
-ENV NVIDIA_DRIVER_CAPABILITIES all
- 
-ENTRYPOINT ["/bin/bash", "-c"]

+ 0 - 103
Docker/Dockerfile.simulation.ubuntu-humble

@@ -1,103 +0,0 @@
-# Copyright (c) Contributors to the Open 3D Engine Project.
-# For complete copyright and license terms please see the LICENSE at the root of this distribution.
-#
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-
-FROM ros:humble-ros-base-jammy
-
-ARG o3de_branch=development
-ARG ros2_gem_branch=development
-ARG loft_gem_branch=main
-ARG o3de_demo_branch=main
-
-ENV WORKSPACE=/data/workspace
-
-ENV O3DE_REPO=https://github.com/o3de/o3de.git
-ENV ROS2_GEM_REPO=https://github.com/RobotecAI/o3de-ros2-gem.git
-ENV LOFT_GEM_REPO=https://github.com/o3de/loft-arch-vis-sample.git
-ENV O3DE_DEMO_REPO=https://github.com/RobotecAI/o3de-demo-project.git
-
-WORKDIR $WORKSPACE
-
-COPY LaunchSimulation.bash.ubuntu-humble /data/workspace/LaunchSimulation.bash
-COPY cleanup.bash /data/workspace/cleanup.bash
-
-RUN apt-get update && apt-get upgrade -y
-
-# Add additional package repositories needed for packages
-RUN apt-get install -y --no-install-recommends gpg wget curl build-essential libssl-dev
-
-#
-# Install packages needed for cloning and building from the source repos
-#
-
-# Install the git and build tools
-RUN apt-get install -y --no-install-recommends git \
-                       git-lfs \
-                       clang-12 \
-                       ninja-build \
-                       libglu1-mesa-dev \
-                       libxcb-xinerama0 \
-                       libxcb-xinput0 \
-                       libxcb-xinput-dev \
-                       libxcb-xfixes0-dev \
-                       libxcb-xkb-dev \
-                       libxkbcommon-dev \
-                       libxkbcommon-x11-dev \
-                       libfontconfig1-dev \
-                       libcurl4-openssl-dev \
-                       libsdl2-dev \
-                       zlib1g-dev \
-                       mesa-common-dev \
-                       libssl-dev libxcb-icccm4 \
-                       libxcb-image0 \
-                       libxcb-keysyms1 \
-                       libxcb-render-util0 \
-                       libxcb-randr0 \
-                       libnvidia-gl-470 \
-                       ufw
-
-# Add additional ROS2/Galactic packages
-RUN /bin/bash -c 'source /opt/ros/humble/setup.bash && \
-                  apt install -y ros-${ROS_DISTRO}-slam-toolbox \
-                                 ros-${ROS_DISTRO}-navigation2 \
-                                 ros-${ROS_DISTRO}-nav2-bringup \
-                                 ros-${ROS_DISTRO}-pointcloud-to-laserscan \
-                                 ros-${ROS_DISTRO}-gazebo-msgs \
-                                 ros-${ROS_DISTRO}-ackermann-msgs \
-                                 ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \
-                                 ros-${ROS_DISTRO}-control-toolbox'
-
-# Clone O3DE repos, register, build, and cleanup in the same layer to reduce the size
-RUN cd $WORKSPACE && \
-    git clone --recursive $O3DE_REPO && \
-    git -C $WORKSPACE/o3de checkout $o3de_branch &&\
-    git -C $WORKSPACE/o3de lfs install && \
-    git -C $WORKSPACE/o3de lfs pull && \
-    $WORKSPACE/o3de/python/get_python.sh && \
-    $WORKSPACE/o3de/scripts/o3de.sh register -ep $WORKSPACE/o3de && \
-    git clone $ROS2_GEM_REPO && \
-    git -C $WORKSPACE/o3de-ros2-gem checkout $ros2_gem_branch &&\
-    $WORKSPACE/o3de/scripts/o3de.sh register -gp $WORKSPACE/o3de-ros2-gem && \
-    git clone --recursive $LOFT_GEM_REPO && \
-    git -C $WORKSPACE/loft-arch-vis-sample checkout $loft_gem_branch &&\
-    git -C $WORKSPACE/loft-arch-vis-sample lfs install && \
-    git -C $WORKSPACE/loft-arch-vis-sample lfs pull && \
-    $WORKSPACE/o3de/scripts/o3de.sh register -gp $WORKSPACE/loft-arch-vis-sample/Gems/ArchVis/ && \
-    git clone --recursive $O3DE_DEMO_REPO && \
-    git -C $WORKSPACE/o3de-demo-project checkout $o3de_demo_branch &&\
-    git -C $WORKSPACE/o3de-demo-project lfs install && \
-    git -C $WORKSPACE/o3de-demo-project lfs pull && \
-    $WORKSPACE/o3de/scripts/o3de.sh register -pp $WORKSPACE/o3de-demo-project/  && \
-    /bin/bash -c 'source /opt/ros/humble/setup.bash && \
-                  cmake -B $WORKSPACE/o3de-demo-project/build/linux -S $WORKSPACE/o3de-demo-project -G "Ninja Multi-Config" -DLY_STRIP_DEBUG_SYMBOLS=TRUE -DLY_DISABLE_TEST_MODULES=ON && \
-                  cmake --build $WORKSPACE/o3de-demo-project/build/linux --config profile --target AssetProcessorBatch ROS2-Gem-Demo.GameLauncher ROS2-Gem-Demo.Assets && \
-                  $WORKSPACE/cleanup.bash'
-
-ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp 
-
-ENV NVIDIA_VISIBLE_DEVICES all
-ENV NVIDIA_DRIVER_CAPABILITIES all
- 
-ENTRYPOINT ["/bin/bash", "-c"]

+ 1 - 1
Docker/LaunchNavStack.bash.ubuntu-galactic → Docker/LaunchNavStack.bash

@@ -8,7 +8,7 @@
 
 unset LD_LIBRARY_PATH
 
-source /opt/ros/galactic/setup.bash
+source /opt/ros/$ROS_DISTRO/setup.bash
 
 cd /data/workspace/o3de-demo-project/launch
 

+ 0 - 16
Docker/LaunchNavStack.bash.ubuntu-humble

@@ -1,16 +0,0 @@
-#!/bin/bash
-
-# Copyright (c) Contributors to the Open 3D Engine Project.
-# For complete copyright and license terms please see the LICENSE at the root of this distribution.
-#
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-
-unset LD_LIBRARY_PATH
-
-source /opt/ros/humble/setup.bash
-
-cd /data/workspace/o3de-demo-project/launch
-
-ros2 launch navigation.launch.py
-

+ 8 - 6
Docker/LaunchSimulation.bash.ubuntu-galactic → Docker/LaunchSimulation.bash

@@ -8,13 +8,15 @@
 
 unset LD_LIBRARY_PATH
 
-source /opt/ros/galactic/setup.bash
+source /opt/ros/$ROS_DISTRO/setup.bash
 
 export LD_LIBRARY_PATH=/data/workspace/o3de-demo-project/build/linux/bin/profile:$LD_LIBRARY_PATH
 
-cd /data/workspace/o3de-demo-project/build/linux/bin/profile
-
-./ROS2-Gem-Demo.GameLauncher -bg_ConnectToAssetProcessor=0
-
-
+if [ -d /data/workspace/o3de-demo-project/build/linux/bin/profile ]
+then
+    cd /data/workspace/o3de-demo-project/build/linux/bin/profile
+    ./ROS2-Gem-Demo.GameLauncher -bg_ConnectToAssetProcessor=0 > /data/workspace/simulation_launch.log 2>&1
+else
+    echo "Simulation not installed on this image"
+fi
 

+ 0 - 20
Docker/LaunchSimulation.bash.ubuntu-humble

@@ -1,20 +0,0 @@
-#!/bin/bash
-
-# Copyright (c) Contributors to the Open 3D Engine Project.
-# For complete copyright and license terms please see the LICENSE at the root of this distribution.
-#
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-
-unset LD_LIBRARY_PATH
-
-source /opt/ros/humble/setup.bash
-
-export LD_LIBRARY_PATH=/data/workspace/o3de-demo-project/build/linux/bin/profile:$LD_LIBRARY_PATH
-
-cd /data/workspace/o3de-demo-project/build/linux/bin/profile
-
-./ROS2-Gem-Demo.GameLauncher -bg_ConnectToAssetProcessor=0
-
-
-

+ 45 - 36
Docker/README.md

@@ -15,34 +15,28 @@ the components necessary to run the O3DE demo project simulator through the O3DE
 
 ## Building the Docker Image
 
-There are two demo simulation Dockerfile scripts defined
-
-* Dockerfile.simulation.ubuntu-galactic (Focal / Galactic)
-* Dockerfile.simulation.ubuntu-humble (Jammy / Humble)
-
-There are also two robot navigation stack Dockerfile scripts defined
-
-* Dockerfile.navstack.ubuntu-galactic (Focal / Galactic)
-* Dockerfile.navstack.ubuntu-humble (Jammy / Humble)
-
-
-Select which docker image you would like to build and run the following commands to build the simulation and navigation stack docker images
+By default, the docker script provided in this project will build a docker image to run the Robot Vacuum sample project
+on Ubuntu 22.04 (jammy) with the ROS2 Humble distribution. For example, to build the docker image, run the following
+command:
 
+```
+sudo docker build -t o3de_robot_vacuum_simulation:latest .
 ```
 
-sudo docker build -t o3de_loft_demo_simulation:latest -f Dockerfile.simulation.ubuntu-galactic .
+This will create a docker image named 'o3de_robot_vacuum_simulation' with the tag 'latest' that contains both the simulation launcher and the 
+navigation stack. It will also contain helper scripts that will launch either the simulation (LaunchSimulation.bash) or 
+the Rviz2 (LaunchNavStack.bash).
 
-sudo docker build -t o3de_loft_demo_navstack:latest -f Dockerfile.navstack.ubuntu-galactic .
+You can also create a separate docker image that only contains the navigation stack and Rviz2 by supplying the argument 
+```IMAGE_TYPE``` and setting it to 'navstack':
 
 ```
-
+sudo docker build --build-arg IMAGE_TYPE=navstack -t o3de_robot_vacuum_navstack:latest .
 ```
 
-sudo docker build -t o3de_loft_demo_simulation:latest -f Dockerfile.simulation.ubuntu-humble .
+ROS2 allows for communication across multiple docker images running on the same host, provided that they specify the 'bridge' 
+network type when launching the docker image.
 
-sudo docker build -t o3de_loft_demo_navstack:latest -f Dockerfile.navstack.ubuntu-humble .
-
-```
 
 ## Running the Docker Image
 
@@ -59,13 +53,13 @@ xhost +local:root
 Then launch the built simulation docker image with the following command
 
 ```
-sudo docker run --rm --network="bridge" --gpus all -e DISPLAY=:1 -v /tmp/.X11-unix:/tmp/.X11-unix -it o3de_loft_demo_simulation:latest /data/workspace/LaunchSimulation.bash
+sudo docker run --rm --network="bridge" --gpus all -e DISPLAY=:1 -v /tmp/.X11-unix:/tmp/.X11-unix -it o3de_robot_vacuum_simulation:latest /data/workspace/LaunchSimulation.bash
 ```
 
 Once the simulation is up and running, launch the robot application docker image, which will bring up RViz to control the robot.
 
 ```
-sudo docker run --rm --network="bridge" --gpus all -e DISPLAY=:1 -v /tmp/.X11-unix:/tmp/.X11-unix -it o3de_loft_demo_navstack:latest /data/workspace/LaunchNavStack.bash
+sudo docker run --rm --network="bridge" --gpus all -e DISPLAY=:1 -v /tmp/.X11-unix:/tmp/.X11-unix -it o3de_robot_vacuum_navstack:latest /data/workspace/LaunchNavStack.bash
 
 ```
 
@@ -82,29 +76,44 @@ Alternatively, you can use [Rocker](https://github.com/osrf/rocker) to run a GPU
 Launch the built simulation docker image with the following rocker command
 
 ```
-rocker --x11 --nvidia o3de_loft_demo_simulation:latest /data/workspace/LaunchSimulation.bash
+rocker --x11 --nvidia o3de_robot_vacuum_simulation:latest /data/workspace/LaunchSimulation.bash
 ```
 
 Once the simulation is up and running, launch the robot application docker image, which will bring up RViz to control the robot.
 
 ```
-rocker --x11 --nvidia o3de_loft_demo_simulation:latest /data/workspace/LaunchNavStack.bash
+rocker --x11 --nvidia o3de_robot_vacuum_navstack:latest /data/workspace/LaunchNavStack.bash
 ```
 
-### Advanced Options
+## Advanced Options
+
+### Target ROS2 Distribution
+The Docker script defaults to building an image based on Ubuntu 20.04 (bionic) and the ROS2 Humble distribution. This can be overridden 
+with a combination if the ```ROS_VERSION``` and ```UBUNTU_VERSION``` arguments.
+
+| ROS2 Distro   | Repository                                |
+|---------------|-------------------------------------------|
+| galactic      | ROS_VERSION=galactic UBUNTU_VERSION=focal |
+| humble        | ROS_VERSION=humble UBUNTU_VERSION=humble  |
+
+
+### Custom source repos and branches
+
+The Dockerscripts use the following arguments to determine the repository to pull the source from. 
 
-The Dockerscripts as written are designed to pull from the latest branches of the following github repos:
+| Argument              | Repository                       | Default     |
+|-----------------------|----------------------------------|-------------|
+| O3DE_REPO             | O3DE                             | https://github.com/o3de/o3de.git                   |
+| ROS2_GEM_REPO         | O3DE ROS2 Gem                    | https://github.com/RobotecAI/o3de-ros2-gem.git     |
+| LOFT_GEM_REPO         | Loft ArchVis Sample Scene        | https://github.com/o3de/loft-arch-vis-sample.git   |
+| ROBOT_VAC_SAMPLE_REPO | Loft Scene Simulation repository | https://github.com/RobotecAI/o3de-demo-project.git |
 
-[O3DE main repository](https://github.com/o3de/o3de.git)  (development)
-[O3DE ROS2 Gem repository](https://github.com/RobotecAI/o3de-ros2-gem.git) (development)
-[O3DE Loft ArchVis Sample Scene repository](https://github.com/o3de/loft-arch-vis-sample.git) (main)
-[Loft Scene Simulation repository](https://github.com/RobotecAI/o3de-demo-project.git) (main)
+In addition the repositories, the following arguments target the branch, commit, or tag to pull from their corresponding repository
 
-The following build arguments are supported to pull from alternative branches, tags, or commits:
+| Argument                | Repository                       | Default     |
+|-------------------------|----------------------------------|-------------|
+| O3DE_BRANCH             | O3DE                             | development |
+| ROS2_GEM_BRANCH         | O3DE ROS2 Gem                    | development |
+| LOFT_GEM_BRANCH         | Loft ArchVis Sample Scene        | main        |
+| ROBOT_VAC_SAMPLE_BRANCH | Loft Scene Simulation repository | main        |
 
-| Argument         | Repository                       | Default     |
-|------------------|----------------------------------|-------------|
-| o3de_branch      | O3DE                             | development |
-| ros2_gem_branch  | O3DE ROS2 Gem                    | development |
-| loft_gem_branch  | Loft ArchVis Sample Scene        | main        |
-| o3de_demo_branch | Loft Scene Simulation repository | main        |