From 6b201ff66907e7ec9f3a7615ee9648a5f8b597d9 Mon Sep 17 00:00:00 2001 From: HanielUlises Date: Mon, 28 Sep 2026 10:31:06 -0600 Subject: [PATCH] Run the two-site survey from a Docker image --- .dockerignore | 5 +++++ Dockerfile | 49 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 14 +++++++++++++ docker/entrypoint.sh | 6 ++++++ 4 files changed, 74 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100755 docker/entrypoint.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..0ff4a523 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.git +log +build +install +**/__pycache__ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..4a8872d7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,49 @@ +# eplansys on ROS 2 Humble, with the two-site survey as its default command. +# +# docker build -t eplansys . +# docker run --rm eplansys +# docker run --rm eplansys ros2 launch eplansys_demo survey_sites_launch.py north:=clean parallel:=true +# +# The planner (del-planner) and the grounder (plank) are built from the commits +# dependency_repos.repos pins, so the image plans exactly as the release does. + +FROM ros:humble + +SHELL ["/bin/bash", "-c"] +ENV DEBIAN_FRONTEND=noninteractive + +# libfl-dev is popf's and libboost-filesystem-dev is plank's; neither project +# has a rosdep key that would bring them in. +RUN apt-get update && apt-get install -y --no-install-recommends \ + libfl-dev libboost-filesystem-dev python3-vcstool ros-humble-behaviortree-cpp \ + && rm -rf /var/lib/apt/lists/* + +# behaviortree_cpp 4.9.1 installs its library under lib/x86_64-linux-gnu while +# its exported CMake check looks in lib/ alone; see epistemic-humble.yaml. +RUN if [ -f /opt/ros/humble/lib/x86_64-linux-gnu/libbehaviortree_cpp.so ] && \ + [ ! -e /opt/ros/humble/lib/libbehaviortree_cpp.so ]; then \ + ln -s x86_64-linux-gnu/libbehaviortree_cpp.so /opt/ros/humble/lib/libbehaviortree_cpp.so; \ + fi + +WORKDIR /eplansys_ws + +# Dependencies first, so that a change to eplansys does not fetch them again. +COPY dependency_repos.repos /tmp/dependency_repos.repos +RUN mkdir -p src && vcs import src < /tmp/dependency_repos.repos + +COPY . src/eplansys + +RUN apt-get update && rosdep update --rosdistro humble \ + && rosdep install --from-paths src --ignore-src -y --rosdistro humble --skip-keys plank \ + && rm -rf /var/lib/apt/lists/* + +# plank is named because nothing declares a build dependency on it: the +# grounder runs it as a subprocess and finds it on PATH. +RUN source /opt/ros/humble/setup.bash \ + && colcon build --packages-up-to eplansys_demo plank \ + --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF \ + && rm -rf build log + +COPY docker/entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] +CMD ["ros2", "launch", "eplansys_demo", "survey_sites_launch.py"] diff --git a/README.md b/README.md index 3461a77a..f3fa1f74 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,20 @@ into the Kripke model the planner searches over is done by Alessandro Burigana and Francesco Fabiano, which `plansys2_epddl_grounder` builds and runs for you. +## Trying it + +The image builds the workspace on ROS 2 Humble, with the planner and the +grounder at the commits this release pins, and runs the two-site survey: two +scouts, two sites, and a policy that branches on what each one finds. + +```bash +docker build -t eplansys . +docker run --rm eplansys +docker run --rm eplansys ros2 launch eplansys_demo survey_sites_launch.py north:=clean parallel:=true +``` + +The mission prints its elapsed time and exits when the goal holds. + We want to invite you to contribute to this Open Source project! **Documentation: [eplansys.github.io/eplansys](https://eplansys.github.io/eplansys)** diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100755 index 00000000..39baec13 --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Source the distribution and the workspace, then run what was asked. +set -e +source /opt/ros/humble/setup.bash +source /eplansys_ws/install/setup.bash +exec "$@"