From 0d31fbe957f0893fb174d0aa82c13bd90368a329 Mon Sep 17 00:00:00 2001 From: Loy van Beek Date: Sat, 21 Dec 2024 16:35:17 +0100 Subject: [PATCH] Build Zenoh in a separate workspace --- docker/robot/Dockerfile | 16 +++++++++++++--- docker/robot/entrypoint.sh | 3 +++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docker/robot/Dockerfile b/docker/robot/Dockerfile index 1433bbc..7b3a7be 100644 --- a/docker/robot/Dockerfile +++ b/docker/robot/Dockerfile @@ -30,9 +30,6 @@ RUN apt update -qq && apt install -y --no-install-recommends \ tmux \ && rm -rf /var/lib/apt/lists/* -RUN mkdir -p /root/ros2_ws/src -WORKDIR /root/ros2_ws/src - # install ROS additional packages needed for application RUN apt update -qq && apt install -y --no-install-recommends \ ros-${ROS_DISTRO}-xacro \ @@ -41,8 +38,21 @@ RUN apt update -qq && apt install -y --no-install-recommends \ # Install rmw_zenoh # Latest version as of writing + +RUN mkdir -p /root/zenoh_ws/src +WORKDIR /root/zenoh_ws/src RUN git clone https://github.com/ros2/rmw_zenoh.git && cd rmw_zenoh && git reset --hard dd82e84 && cd .. +WORKDIR /root/zenoh_ws +RUN /bin/bash -c "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 --event-handlers console_cohesion+\ + && rm -rf /var/lib/apt/lists/*" + +RUN mkdir -p /root/ros2_ws/src +WORKDIR /root/ros2_ws/src + COPY ./neato_description /root/ros2_ws/src/neato_description COPY ./neato_ros2_python /root/ros2_ws/src/neato_ros2_python COPY ./neato_bringup /root/ros2_ws/src/neato_bringup diff --git a/docker/robot/entrypoint.sh b/docker/robot/entrypoint.sh index 8bf90ac..0e8b4e4 100755 --- a/docker/robot/entrypoint.sh +++ b/docker/robot/entrypoint.sh @@ -4,6 +4,9 @@ # Source ROS 2 source /opt/ros/${ROS_DISTRO}/setup.bash +# Source the Zenoh workspace, if built +source /root/zenoh_ws/install/setup.bash + # Source the overlay workspace, if built source /root/ros2_ws/install/setup.bash