From 7c3f7066d44655ab175d8e44b66357980cf71376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ellensohn?= Date: Wed, 9 Aug 2023 16:33:46 +0200 Subject: [PATCH] update layers --- controller_startup.sh | 29 ---------------------- docker/Dockerfile | 55 +++++++++++++++++++---------------------- localization_startup.sh | 28 --------------------- 3 files changed, 25 insertions(+), 87 deletions(-) delete mode 100644 controller_startup.sh delete mode 100644 localization_startup.sh diff --git a/controller_startup.sh b/controller_startup.sh deleted file mode 100644 index abc593c..0000000 --- a/controller_startup.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# Basic entrypoint for ROS / Colcon Docker containers - -# Source ROS 2 -source /opt/ros/${ROS_DISTRO}/setup.bash -echo "Sourced ROS 2 ${ROS_DISTRO}" - -# Source the base workspace, if built -if [ -f ${UNDERLAY_WS}/install/setup.bash ] -then - source ${UNDERLAY_WS}/install/setup.bash - #export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:$(ros2 pkg prefix turtlebot3_gazebo)/share/turtlebot3_gazebo/models - echo "Sourced Bot Mini base workspace" -fi - -# Source the overlay workspace, if built -if [ -f /overlay_ws/install/setup.bash ] -then - source /overlay_ws/install/setup.bash - #export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:$(ros2 pkg prefix tb3_worlds)/share/tb3_worlds/models - echo "Sourced Bot Mini overlay workspace" -fi - -# Start Robot ROS2 Nodes -ros2 launch bot_mini_bringup robot_controller.launch.py priority:=80 cpu-affinity:=4 lock-memory-size:=100 config-child-threads:=True & -ros2 launch bot_mini_bringup robot_twist_mux.launch.py & -ros2 launch bot_mini_bringup robot_joy_teleop.launch.py - -wait \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index 831eb0f..cfa3926 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -30,12 +30,12 @@ RUN echo "Hardware platform is: $(uname -m)" RUN uname -a RUN if [ "$(uname -m)" = "x86_64" ]; then \ - echo "Copying files for linux/amd64"; \ - mv dependencies.amd64.repos dependencies.repos; \ - else \ - echo "Copying files for linux/arm64"; \ - mv dependencies.arm64.repos dependencies.repos; \ - fi + echo "Copying files for linux/amd64"; \ + mv dependencies.amd64.repos dependencies.repos; \ + else \ + echo "Copying files for linux/arm64"; \ + mv dependencies.arm64.repos dependencies.repos; \ + fi #RUN vcs import < dependencies.repos RUN vcs import < dependencies.repos; @@ -43,16 +43,17 @@ RUN vcs import < dependencies.repos; # Build the base Colcon workspace, installing dependencies first. WORKDIR /rmp_ws RUN source /opt/ros/${ROS_DISTRO}/setup.bash \ - && apt-get update -y \ - && rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y \ - && colcon build --symlink-install \ - && rm -rf /var/lib/apt/lists/* + && apt-get update -y \ + && rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y -# Use Cyclone DDS as middleware +RUN source /opt/ros/${ROS_DISTRO}/setup.bash \ + && colcon build --symlink-install + +# Use Cyclone DDS as middleware and install xacro RUN apt-get update && apt-get install -y --no-install-recommends \ - ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \ - ros-${ROS_DISTRO}-xacro \ - && rm -rf /var/lib/apt/lists/* + ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \ + ros-${ROS_DISTRO}-xacro \ + && rm -rf /var/lib/apt/lists/* ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp @@ -62,7 +63,7 @@ ENV UNDERLAY_WS=${UNDERLAY_WS} # Overlay Image for RMP Control # ########################################### FROM base AS overlay - + # Create an overlay Colcon workspace RUN mkdir -p /overlay_ws/src WORKDIR /overlay_ws/src @@ -74,21 +75,17 @@ WORKDIR /overlay_ws RUN echo "update overlay" RUN source /rmp_ws/install/setup.bash \ - && colcon build --symlink-install \ - && apt-get update \ - && rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y \ - && rm -rf /var/lib/apt/lists/* + && apt-get update \ + && rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y \ + && rm -rf /var/lib/apt/lists/* + +RUN source /rmp_ws/install/setup.bash \ + && colcon build --symlink-install # Set up the entrypoint COPY ./docker/entrypoint.sh / RUN chmod +x /entrypoint.sh -COPY ./controller_startup.sh / -RUN chmod +x /controller_startup.sh - -COPY ./localization_startup.sh / -RUN chmod +x /localization_startup.sh - ENTRYPOINT [ "/entrypoint.sh" ] ########################################### @@ -98,11 +95,9 @@ FROM overlay AS guis # Install additional GUI tools RUN source /rmp_ws/install/setup.bash \ - && colcon build --symlink-install \ - && apt-get update \ - && apt-get install -y --no-install-recommends ros-${ROS_DISTRO}-rviz2 \ - && rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y \ - && rm -rf /var/lib/apt/lists/* + && apt-get update \ + && apt-get install -y --no-install-recommends ros-${ROS_DISTRO}-rviz2 \ + && rm -rf /var/lib/apt/lists/* # Set up the entrypoint ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/localization_startup.sh b/localization_startup.sh deleted file mode 100644 index 5f6475a..0000000 --- a/localization_startup.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# Basic entrypoint for ROS / Colcon Docker containers - -# Source ROS 2 -source /opt/ros/${ROS_DISTRO}/setup.bash -echo "Sourced ROS 2 ${ROS_DISTRO}" - -# Source the base workspace, if built -if [ -f ${UNDERLAY_WS}/install/setup.bash ] -then - source ${UNDERLAY_WS}/install/setup.bash - #export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:$(ros2 pkg prefix turtlebot3_gazebo)/share/turtlebot3_gazebo/models - echo "Sourced Bot Mini base workspace" -fi - -# Source the overlay workspace, if built -if [ -f /overlay_ws/install/setup.bash ] -then - source /overlay_ws/install/setup.bash - #export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:$(ros2 pkg prefix tb3_worlds)/share/tb3_worlds/models - echo "Sourced Bot Mini overlay workspace" -fi - -# Start Robot ROS2 Nodes -ros2 launch bot_mini_bringup robot_lidar.launch.py & -ros2 launch bot_mini_bringup robot_localization.launch.py - -wait \ No newline at end of file