From 361840971379a317073343d86f42b74758411531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ellensohn?= Date: Wed, 2 Aug 2023 16:58:57 +0200 Subject: [PATCH] update --- docker/Dockerfile | 6 ------ docker/entrypoint.sh | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 docker/entrypoint.sh diff --git a/docker/Dockerfile b/docker/Dockerfile index 2ea7e23..b757f88 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -62,12 +62,6 @@ RUN source /${UNDERLAY_WS}/install/setup.bash \ 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" ] ########################################### diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 0000000..c7d19f8 --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,23 @@ +#!/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 + echo "Sourced CPS 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 + echo "Sourced CPS BOt Mini Overlay workspace" +fi + +# Execute the command passed into this entrypoint +exec "$@" \ No newline at end of file