diff --git a/cartographer_ws/docker/.bashrc b/cartographer_ws/docker/.bashrc index ed090d4a..2f0726eb 100644 --- a/cartographer_ws/docker/.bashrc +++ b/cartographer_ws/docker/.bashrc @@ -1,3 +1,12 @@ +# Setup paths in `~/.profile` to allow unified environment variable across login/non-login shells +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/bin" ] ; then + PATH="$HOME/bin:$PATH" +fi +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/.local/bin" ] ; then + PATH="$HOME/.local/bin:$PATH" +fi # Source global ROS2 environment source /opt/ros/$ROS_DISTRO/setup.bash # Optionally perform apt update if it has not been executed yet @@ -9,13 +18,14 @@ fi if [ ! -d $HOME/.ros/rosdep/sources.cache ]; then echo "rosdep update has not been executed yet. Running rosdep update..." rosdep update + cd $ROS2_WS + # Ref: https://docs.ros.org/en/humble/Tutorials/Intermediate/Rosdep.html + rosdep install --from-paths src --ignore-src -y -r fi # Optionally build the workspace if it has not been built yet if [ ! -f $ROS2_WS/install/setup.bash ]; then echo "Workspace has not been built yet. Building workspace..." cd $ROS2_WS - # Ref: https://docs.ros.org/en/humble/Tutorials/Intermediate/Rosdep.html - rosdep install --from-paths src --ignore-src -y -r # TODO: If command `arch` outputs `aarch64`, consider adding `--packages-ignore ` to ignore x86 packages # Ref: https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-Your-First-ROS2-Package.html if [ $(arch) == "aarch64" ]; then @@ -25,6 +35,18 @@ if [ ! -f $ROS2_WS/install/setup.bash ]; then fi echo "Workspace built." fi +# Source gazebo environment +# Ref: https://classic.gazebosim.org/tutorials?tut=ros2_installing&cat=connect_ros#InstallGazebo +if [ $(arch) == "x86_64" ]; then + source /usr/share/gazebo/setup.bash +fi # TODO: Source other workspace environments as underlay +# Set Isaac Sim environment variables +# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#running-isaac-sim +# Ref: https://github.com/NVIDIA-Omniverse/IsaacSim-dockerfiles/blob/e3c09375c2d110b39c3fab3611352870aa3ce6ee/Dockerfile.2023.1.0-ubuntu22.04#L49-L53 +export OMNI_USER=admin +export OMNI_PASS=admin +export OMNI_KIT_ACCEPT_EULA=YES # Source workspace environment source $ROS2_WS/install/setup.bash +echo "Successfully built workspace and configured environment variables." diff --git a/cartographer_ws/docker/Dockerfile b/cartographer_ws/docker/Dockerfile index f6e5178c..e7dd7b17 100644 --- a/cartographer_ws/docker/Dockerfile +++ b/cartographer_ws/docker/Dockerfile @@ -59,12 +59,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ python3-pip \ && rm -rf /var/lib/apt/lists/* -# Install custom tools +# Install GUI debugging tools +# - `x11-apps` and `x11-utils` for `xeyes` and `xdpyinfo` +# Ref: https://packages.debian.org/sid/x11-apps +# Ref: https://packages.debian.org/sid/x11-utils +# - `mesa-utils` for `glxgears` and `glxinfo` +# Ref: https://wiki.debian.org/Mesa +# - `vulkan-tools` for `vkcube` and `vulkaninfo` +# Ref: https://docs.vulkan.org/tutorial/latest/02_Development_environment.html#_vulkan_packages +# Ref: https://gitlab.com/nvidia/container-images/vulkan/-/blob/master/docker/Dockerfile.ubuntu RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ apt-get update && apt-get install -y \ - git-extras \ + x11-apps x11-utils \ + mesa-utils \ + libgl1 vulkan-tools \ && rm -rf /var/lib/apt/lists/* +# Setup the required capabilities for the container runtime +# Ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#driver-capabilities +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=all + +# Install Vulkan config files +# Ref: https://gitlab.com/nvidia/container-images/vulkan +RUN cat > /etc/vulkan/icd.d/nvidia_icd.json <` to ignore x86 packages # Ref: https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-Your-First-ROS2-Package.html if [ $(arch) == "aarch64" ]; then @@ -30,6 +35,18 @@ if [ ! -f $ROS2_WS/install/setup.bash ]; then fi echo "Workspace built." fi +# Source gazebo environment +# Ref: https://classic.gazebosim.org/tutorials?tut=ros2_installing&cat=connect_ros#InstallGazebo +if [ $(arch) == "x86_64" ]; then + source /usr/share/gazebo/setup.bash +fi # TODO: Source other workspace environments as underlay +# Set Isaac Sim environment variables +# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#running-isaac-sim +# Ref: https://github.com/NVIDIA-Omniverse/IsaacSim-dockerfiles/blob/e3c09375c2d110b39c3fab3611352870aa3ce6ee/Dockerfile.2023.1.0-ubuntu22.04#L49-L53 +export OMNI_USER=admin +export OMNI_PASS=admin +export OMNI_KIT_ACCEPT_EULA=YES # Source workspace environment source $ROS2_WS/install/setup.bash +echo "Successfully built workspace and configured environment variables." diff --git a/gazebo_world_ws/docker/Dockerfile b/gazebo_world_ws/docker/Dockerfile index 524c28b3..132a3d97 100644 --- a/gazebo_world_ws/docker/Dockerfile +++ b/gazebo_world_ws/docker/Dockerfile @@ -59,12 +59,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ python3-pip \ && rm -rf /var/lib/apt/lists/* -# Install custom tools +# Install GUI debugging tools +# - `x11-apps` and `x11-utils` for `xeyes` and `xdpyinfo` +# Ref: https://packages.debian.org/sid/x11-apps +# Ref: https://packages.debian.org/sid/x11-utils +# - `mesa-utils` for `glxgears` and `glxinfo` +# Ref: https://wiki.debian.org/Mesa +# - `vulkan-tools` for `vkcube` and `vulkaninfo` +# Ref: https://docs.vulkan.org/tutorial/latest/02_Development_environment.html#_vulkan_packages +# Ref: https://gitlab.com/nvidia/container-images/vulkan/-/blob/master/docker/Dockerfile.ubuntu RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ apt-get update && apt-get install -y \ - git-extras \ + x11-apps x11-utils \ + mesa-utils \ + libgl1 vulkan-tools \ && rm -rf /var/lib/apt/lists/* +# Setup the required capabilities for the container runtime +# Ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#driver-capabilities +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=all + +# Install Vulkan config files +# Ref: https://gitlab.com/nvidia/container-images/vulkan +RUN cat > /etc/vulkan/icd.d/nvidia_icd.json <` to ignore x86 packages # Ref: https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-Your-First-ROS2-Package.html if [ $(arch) == "aarch64" ]; then - colcon build --symlink-install + colcon build --symlink-install --packages-ignore velodyne_gazebo_plugins else colcon build --symlink-install fi echo "Workspace built." fi +# Source gazebo environment +# Ref: https://classic.gazebosim.org/tutorials?tut=ros2_installing&cat=connect_ros#InstallGazebo +if [ $(arch) == "x86_64" ]; then + source /usr/share/gazebo/setup.bash +fi # TODO: Source other workspace environments as underlay # Source Clearpath robot environment source ~/husky_driver_ws/install/local_setup.bash # Source Clearpath default environment installed by `clearpath_computer_installer.sh` source /etc/clearpath/setup.bash +# Set Isaac Sim environment variables +# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#running-isaac-sim +# Ref: https://github.com/NVIDIA-Omniverse/IsaacSim-dockerfiles/blob/e3c09375c2d110b39c3fab3611352870aa3ce6ee/Dockerfile.2023.1.0-ubuntu22.04#L49-L53 +export OMNI_USER=admin +export OMNI_PASS=admin +export OMNI_KIT_ACCEPT_EULA=YES # Source workspace environment source $ROS2_WS/install/setup.bash +echo "Successfully built workspace and configured environment variables." diff --git a/husky_ws/docker/Dockerfile b/husky_ws/docker/Dockerfile index e15a4efb..4db9f25a 100644 --- a/husky_ws/docker/Dockerfile +++ b/husky_ws/docker/Dockerfile @@ -59,12 +59,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ python3-pip \ && rm -rf /var/lib/apt/lists/* -# Install custom tools +# Install GUI debugging tools +# - `x11-apps` and `x11-utils` for `xeyes` and `xdpyinfo` +# Ref: https://packages.debian.org/sid/x11-apps +# Ref: https://packages.debian.org/sid/x11-utils +# - `mesa-utils` for `glxgears` and `glxinfo` +# Ref: https://wiki.debian.org/Mesa +# - `vulkan-tools` for `vkcube` and `vulkaninfo` +# Ref: https://docs.vulkan.org/tutorial/latest/02_Development_environment.html#_vulkan_packages +# Ref: https://gitlab.com/nvidia/container-images/vulkan/-/blob/master/docker/Dockerfile.ubuntu RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ apt-get update && apt-get install -y \ - git-extras \ + x11-apps x11-utils \ + mesa-utils \ + libgl1 vulkan-tools \ && rm -rf /var/lib/apt/lists/* +# Setup the required capabilities for the container runtime +# Ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#driver-capabilities +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=all + +# Install Vulkan config files +# Ref: https://gitlab.com/nvidia/container-images/vulkan +RUN cat > /etc/vulkan/icd.d/nvidia_icd.json <` to ignore x86 packages # Ref: https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-Your-First-ROS2-Package.html if [ $(arch) == "aarch64" ]; then @@ -25,8 +35,20 @@ if [ ! -f $ROS2_WS/install/setup.bash ]; then fi echo "Workspace built." fi +# Source gazebo environment +# Ref: https://classic.gazebosim.org/tutorials?tut=ros2_installing&cat=connect_ros#InstallGazebo +if [ $(arch) == "x86_64" ]; then + source /usr/share/gazebo/setup.bash +fi # TODO: Source other workspace environments as underlay # Source kobuki driver workspace environment source ~/kobuki_driver_ws/install/local_setup.bash +# Set Isaac Sim environment variables +# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#running-isaac-sim +# Ref: https://github.com/NVIDIA-Omniverse/IsaacSim-dockerfiles/blob/e3c09375c2d110b39c3fab3611352870aa3ce6ee/Dockerfile.2023.1.0-ubuntu22.04#L49-L53 +export OMNI_USER=admin +export OMNI_PASS=admin +export OMNI_KIT_ACCEPT_EULA=YES # Source workspace environment source $ROS2_WS/install/setup.bash +echo "Successfully built workspace and configured environment variables." diff --git a/kobuki_ws/docker/Dockerfile b/kobuki_ws/docker/Dockerfile index b0823e44..232b2420 100644 --- a/kobuki_ws/docker/Dockerfile +++ b/kobuki_ws/docker/Dockerfile @@ -59,12 +59,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ python3-pip \ && rm -rf /var/lib/apt/lists/* -# Install custom tools +# Install GUI debugging tools +# - `x11-apps` and `x11-utils` for `xeyes` and `xdpyinfo` +# Ref: https://packages.debian.org/sid/x11-apps +# Ref: https://packages.debian.org/sid/x11-utils +# - `mesa-utils` for `glxgears` and `glxinfo` +# Ref: https://wiki.debian.org/Mesa +# - `vulkan-tools` for `vkcube` and `vulkaninfo` +# Ref: https://docs.vulkan.org/tutorial/latest/02_Development_environment.html#_vulkan_packages +# Ref: https://gitlab.com/nvidia/container-images/vulkan/-/blob/master/docker/Dockerfile.ubuntu RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ apt-get update && apt-get install -y \ - git-extras \ + x11-apps x11-utils \ + mesa-utils \ + libgl1 vulkan-tools \ && rm -rf /var/lib/apt/lists/* +# Setup the required capabilities for the container runtime +# Ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#driver-capabilities +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=all + +# Install Vulkan config files +# Ref: https://gitlab.com/nvidia/container-images/vulkan +RUN cat > /etc/vulkan/icd.d/nvidia_icd.json <` to ignore x86 packages # Ref: https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-Your-First-ROS2-Package.html if [ $(arch) == "aarch64" ]; then - colcon build --symlink-install + colcon build --symlink-install --packages-ignore velodyne_gazebo_plugins else colcon build --symlink-install fi echo "Workspace built." fi +# Source gazebo environment +# Ref: https://classic.gazebosim.org/tutorials?tut=ros2_installing&cat=connect_ros#InstallGazebo +if [ $(arch) == "x86_64" ]; then + source /usr/share/gazebo/setup.bash +fi # TODO: Source other workspace environments as underlay source ~/test_ws/install/local_setup.bash +# Set Isaac Sim environment variables +# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#running-isaac-sim +# Ref: https://github.com/NVIDIA-Omniverse/IsaacSim-dockerfiles/blob/e3c09375c2d110b39c3fab3611352870aa3ce6ee/Dockerfile.2023.1.0-ubuntu22.04#L49-L53 +export OMNI_USER=admin +export OMNI_PASS=admin +export OMNI_KIT_ACCEPT_EULA=YES # Source workspace environment source $ROS2_WS/install/setup.bash +echo "Successfully built workspace and configured environment variables." diff --git a/orbslam3_ws/docker/Dockerfile b/orbslam3_ws/docker/Dockerfile index 54f8c52b..56e823b0 100644 --- a/orbslam3_ws/docker/Dockerfile +++ b/orbslam3_ws/docker/Dockerfile @@ -59,12 +59,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ python3-pip \ && rm -rf /var/lib/apt/lists/* -# Install custom tools +# Install GUI debugging tools +# - `x11-apps` and `x11-utils` for `xeyes` and `xdpyinfo` +# Ref: https://packages.debian.org/sid/x11-apps +# Ref: https://packages.debian.org/sid/x11-utils +# - `mesa-utils` for `glxgears` and `glxinfo` +# Ref: https://wiki.debian.org/Mesa +# - `vulkan-tools` for `vkcube` and `vulkaninfo` +# Ref: https://docs.vulkan.org/tutorial/latest/02_Development_environment.html#_vulkan_packages +# Ref: https://gitlab.com/nvidia/container-images/vulkan/-/blob/master/docker/Dockerfile.ubuntu RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ apt-get update && apt-get install -y \ - git-extras \ + x11-apps x11-utils \ + mesa-utils \ + libgl1 vulkan-tools \ && rm -rf /var/lib/apt/lists/* +# Setup the required capabilities for the container runtime +# Ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#driver-capabilities +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=all + +# Install Vulkan config files +# Ref: https://gitlab.com/nvidia/container-images/vulkan +RUN cat > /etc/vulkan/icd.d/nvidia_icd.json <` to ignore x86 packages # Ref: https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-Your-First-ROS2-Package.html if [ $(arch) == "aarch64" ]; then @@ -25,6 +35,18 @@ if [ ! -f $ROS2_WS/install/setup.bash ]; then fi echo "Workspace built." fi +# Source gazebo environment +# Ref: https://classic.gazebosim.org/tutorials?tut=ros2_installing&cat=connect_ros#InstallGazebo +if [ $(arch) == "x86_64" ]; then + source /usr/share/gazebo/setup.bash +fi # TODO: Source other workspace environments as underlay +# Set Isaac Sim environment variables +# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#running-isaac-sim +# Ref: https://github.com/NVIDIA-Omniverse/IsaacSim-dockerfiles/blob/e3c09375c2d110b39c3fab3611352870aa3ce6ee/Dockerfile.2023.1.0-ubuntu22.04#L49-L53 +export OMNI_USER=admin +export OMNI_PASS=admin +export OMNI_KIT_ACCEPT_EULA=YES # Source workspace environment source $ROS2_WS/install/setup.bash +echo "Successfully built workspace and configured environment variables." diff --git a/rtabmap_ws/docker/Dockerfile b/rtabmap_ws/docker/Dockerfile index dcbb15b3..22f153f1 100644 --- a/rtabmap_ws/docker/Dockerfile +++ b/rtabmap_ws/docker/Dockerfile @@ -11,6 +11,9 @@ ARG TARGETARCH LABEL org.opencontainers.image.authors="assume0701@gmail.com" +# RTAB-Map docker image does not define ROS_DISTRO, so we need to define it here +ENV ROS_DISTRO humble + # Arguments for the default user ARG USERNAME=user ARG USER_UID=1000 @@ -28,9 +31,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ apt-get update && apt-get upgrade -y \ && rm -rf /var/lib/apt/lists/* -# RTAB-Map docker image does not define ROS_DISTRO, so we need to define it here -ENV ROS_DISTRO humble - # Install sudo and create a user with sudo privileges # Ref: https://stackoverflow.com/a/65434659 RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ @@ -62,12 +62,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ python3-pip \ && rm -rf /var/lib/apt/lists/* -# Install custom tools +# Install GUI debugging tools +# - `x11-apps` and `x11-utils` for `xeyes` and `xdpyinfo` +# Ref: https://packages.debian.org/sid/x11-apps +# Ref: https://packages.debian.org/sid/x11-utils +# - `mesa-utils` for `glxgears` and `glxinfo` +# Ref: https://wiki.debian.org/Mesa +# - `vulkan-tools` for `vkcube` and `vulkaninfo` +# Ref: https://docs.vulkan.org/tutorial/latest/02_Development_environment.html#_vulkan_packages +# Ref: https://gitlab.com/nvidia/container-images/vulkan/-/blob/master/docker/Dockerfile.ubuntu RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ apt-get update && apt-get install -y \ - git-extras \ + x11-apps x11-utils \ + mesa-utils \ + libgl1 vulkan-tools \ && rm -rf /var/lib/apt/lists/* +# Setup the required capabilities for the container runtime +# Ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#driver-capabilities +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=all + +# Install Vulkan config files +# Ref: https://gitlab.com/nvidia/container-images/vulkan +RUN cat > /etc/vulkan/icd.d/nvidia_icd.json <` to ignore x86 packages # Ref: https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-Your-First-ROS2-Package.html if [ $(arch) == "aarch64" ]; then @@ -25,6 +35,18 @@ if [ ! -f $ROS2_WS/install/setup.bash ]; then fi echo "Workspace built." fi +# Source gazebo environment +# Ref: https://classic.gazebosim.org/tutorials?tut=ros2_installing&cat=connect_ros#InstallGazebo +if [ $(arch) == "x86_64" ]; then + source /usr/share/gazebo/setup.bash +fi # TODO: Source other workspace environments as underlay +# Set Isaac Sim environment variables +# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#running-isaac-sim +# Ref: https://github.com/NVIDIA-Omniverse/IsaacSim-dockerfiles/blob/e3c09375c2d110b39c3fab3611352870aa3ce6ee/Dockerfile.2023.1.0-ubuntu22.04#L49-L53 +export OMNI_USER=admin +export OMNI_PASS=admin +export OMNI_KIT_ACCEPT_EULA=YES # Source workspace environment source $ROS2_WS/install/setup.bash +echo "Successfully built workspace and configured environment variables." diff --git a/template_ws/docker/Dockerfile b/template_ws/docker/Dockerfile index f7173a6f..168fc24d 100644 --- a/template_ws/docker/Dockerfile +++ b/template_ws/docker/Dockerfile @@ -57,12 +57,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ python3-pip \ && rm -rf /var/lib/apt/lists/* -# Install custom tools +# Install GUI debugging tools +# - `x11-apps` and `x11-utils` for `xeyes` and `xdpyinfo` +# Ref: https://packages.debian.org/sid/x11-apps +# Ref: https://packages.debian.org/sid/x11-utils +# - `mesa-utils` for `glxgears` and `glxinfo` +# Ref: https://wiki.debian.org/Mesa +# - `vulkan-tools` for `vkcube` and `vulkaninfo` +# Ref: https://docs.vulkan.org/tutorial/latest/02_Development_environment.html#_vulkan_packages +# Ref: https://gitlab.com/nvidia/container-images/vulkan/-/blob/master/docker/Dockerfile.ubuntu RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ apt-get update && apt-get install -y \ - git-extras \ + x11-apps x11-utils \ + mesa-utils \ + libgl1 vulkan-tools \ && rm -rf /var/lib/apt/lists/* +# Setup the required capabilities for the container runtime +# Ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#driver-capabilities +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=all + +# Install Vulkan config files +# Ref: https://gitlab.com/nvidia/container-images/vulkan +RUN cat > /etc/vulkan/icd.d/nvidia_icd.json <` to ignore x86 packages # Ref: https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-Your-First-ROS2-Package.html if [ $(arch) == "aarch64" ]; then @@ -26,7 +36,20 @@ if [ ! -f $ROS2_WS/install/setup.bash ]; then fi echo "Workspace built." fi +# Source gazebo environment +{PLACEHOLDER_MULTILINE} +# Ref: https://classic.gazebosim.org/tutorials?tut=ros2_installing&cat=connect_ros#InstallGazebo +if [ $(arch) == "x86_64" ]; then + source /usr/share/gazebo/setup.bash +fi # TODO: Source other workspace environments as underlay {PLACEHOLDER_MULTILINE} +# Set Isaac Sim environment variables +# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#running-isaac-sim +# Ref: https://github.com/NVIDIA-Omniverse/IsaacSim-dockerfiles/blob/e3c09375c2d110b39c3fab3611352870aa3ce6ee/Dockerfile.2023.1.0-ubuntu22.04#L49-L53 +export OMNI_USER=admin +export OMNI_PASS=admin +export OMNI_KIT_ACCEPT_EULA=YES # Source workspace environment source $ROS2_WS/install/setup.bash +echo "Successfully built workspace and configured environment variables." diff --git a/tests/diff_base/docker/Dockerfile b/tests/diff_base/docker/Dockerfile index 6c9c8594..a9242ee3 100644 --- a/tests/diff_base/docker/Dockerfile +++ b/tests/diff_base/docker/Dockerfile @@ -25,7 +25,7 @@ RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloa RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ apt-get update && apt-get upgrade -y \ && rm -rf /var/lib/apt/lists/* -{PLACEHOLDER_MULTILINE} + # Install sudo and create a user with sudo privileges # Ref: https://stackoverflow.com/a/65434659 RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ @@ -57,12 +57,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ python3-pip \ && rm -rf /var/lib/apt/lists/* -# Install custom tools +# Install GUI debugging tools +# - `x11-apps` and `x11-utils` for `xeyes` and `xdpyinfo` +# Ref: https://packages.debian.org/sid/x11-apps +# Ref: https://packages.debian.org/sid/x11-utils +# - `mesa-utils` for `glxgears` and `glxinfo` +# Ref: https://wiki.debian.org/Mesa +# - `vulkan-tools` for `vkcube` and `vulkaninfo` +# Ref: https://docs.vulkan.org/tutorial/latest/02_Development_environment.html#_vulkan_packages +# Ref: https://gitlab.com/nvidia/container-images/vulkan/-/blob/master/docker/Dockerfile.ubuntu RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ apt-get update && apt-get install -y \ - git-extras \ + x11-apps x11-utils \ + mesa-utils \ + libgl1 vulkan-tools \ && rm -rf /var/lib/apt/lists/* +# Setup the required capabilities for the container runtime +# Ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#driver-capabilities +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=all + +# Install Vulkan config files +# Ref: https://gitlab.com/nvidia/container-images/vulkan +RUN cat > /etc/vulkan/icd.d/nvidia_icd.json < /dev/null && pwd)" cd $SCRIPT_DIR +# export IGNORED_WORKSPACES="temp_ws tmp_ws" # Loop through all Python files in the current directory for script in *.py; do echo "Running $script..." diff --git a/vlp_ws/docker/.bashrc b/vlp_ws/docker/.bashrc index d8352e3e..9e7767a4 100644 --- a/vlp_ws/docker/.bashrc +++ b/vlp_ws/docker/.bashrc @@ -1,3 +1,12 @@ +# Setup paths in `~/.profile` to allow unified environment variable across login/non-login shells +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/bin" ] ; then + PATH="$HOME/bin:$PATH" +fi +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/.local/bin" ] ; then + PATH="$HOME/.local/bin:$PATH" +fi # Source global ROS2 environment source /opt/ros/$ROS_DISTRO/setup.bash # Optionally perform apt update if it has not been executed yet @@ -9,13 +18,14 @@ fi if [ ! -d $HOME/.ros/rosdep/sources.cache ]; then echo "rosdep update has not been executed yet. Running rosdep update..." rosdep update + cd $ROS2_WS + # Ref: https://docs.ros.org/en/humble/Tutorials/Intermediate/Rosdep.html + rosdep install --from-paths src --ignore-src -y -r fi # Optionally build the workspace if it has not been built yet if [ ! -f $ROS2_WS/install/setup.bash ]; then echo "Workspace has not been built yet. Building workspace..." cd $ROS2_WS - # Ref: https://docs.ros.org/en/humble/Tutorials/Intermediate/Rosdep.html - rosdep install --from-paths src --ignore-src -y -r # TODO: If command `arch` outputs `aarch64`, consider adding `--packages-ignore ` to ignore x86 packages # Ref: https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-Your-First-ROS2-Package.html if [ $(arch) == "aarch64" ]; then @@ -25,6 +35,18 @@ if [ ! -f $ROS2_WS/install/setup.bash ]; then fi echo "Workspace built." fi +# Source gazebo environment +# Ref: https://classic.gazebosim.org/tutorials?tut=ros2_installing&cat=connect_ros#InstallGazebo +if [ $(arch) == "x86_64" ]; then + source /usr/share/gazebo/setup.bash +fi # TODO: Source other workspace environments as underlay +# Set Isaac Sim environment variables +# Ref: https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_python.html#running-isaac-sim +# Ref: https://github.com/NVIDIA-Omniverse/IsaacSim-dockerfiles/blob/e3c09375c2d110b39c3fab3611352870aa3ce6ee/Dockerfile.2023.1.0-ubuntu22.04#L49-L53 +export OMNI_USER=admin +export OMNI_PASS=admin +export OMNI_KIT_ACCEPT_EULA=YES # Source workspace environment source $ROS2_WS/install/setup.bash +echo "Successfully built workspace and configured environment variables." diff --git a/vlp_ws/docker/Dockerfile b/vlp_ws/docker/Dockerfile index 485e0a3b..f9ed65c2 100644 --- a/vlp_ws/docker/Dockerfile +++ b/vlp_ws/docker/Dockerfile @@ -59,12 +59,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ python3-pip \ && rm -rf /var/lib/apt/lists/* -# Install custom tools +# Install GUI debugging tools +# - `x11-apps` and `x11-utils` for `xeyes` and `xdpyinfo` +# Ref: https://packages.debian.org/sid/x11-apps +# Ref: https://packages.debian.org/sid/x11-utils +# - `mesa-utils` for `glxgears` and `glxinfo` +# Ref: https://wiki.debian.org/Mesa +# - `vulkan-tools` for `vkcube` and `vulkaninfo` +# Ref: https://docs.vulkan.org/tutorial/latest/02_Development_environment.html#_vulkan_packages +# Ref: https://gitlab.com/nvidia/container-images/vulkan/-/blob/master/docker/Dockerfile.ubuntu RUN --mount=type=cache,target=/var/cache/apt,sharing=private \ apt-get update && apt-get install -y \ - git-extras \ + x11-apps x11-utils \ + mesa-utils \ + libgl1 vulkan-tools \ && rm -rf /var/lib/apt/lists/* +# Setup the required capabilities for the container runtime +# Ref: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#driver-capabilities +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=all + +# Install Vulkan config files +# Ref: https://gitlab.com/nvidia/container-images/vulkan +RUN cat > /etc/vulkan/icd.d/nvidia_icd.json <