diff --git a/Dockerfile.hardware b/Dockerfile.hardware index e01c35b..dd40b9f 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -116,7 +116,9 @@ RUN apt-get update && apt-get install -y \ RUN echo $(cat /ros2_ws/src/rosbot/package.xml | grep '' | sed -r 's/.*([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') >> /version.txt -COPY ./ros_entrypoint.sh / +RUN sed -i '/test -f "\/ros2_ws\/install\/setup.bash" && source "\/ros2_ws\/install\/setup.bash"/a \ + ros2 run healthcheck_pkg healthcheck_node &' \ + /ros_entrypoint.sh COPY ./healthcheck.sh / HEALTHCHECK --interval=7s --timeout=2s --start-period=5s --retries=5 \ diff --git a/Dockerfile.simulation b/Dockerfile.simulation index a909d09..ba15d2e 100644 --- a/Dockerfile.simulation +++ b/Dockerfile.simulation @@ -66,7 +66,9 @@ RUN MYDISTRO=${PREFIX:-ros}; MYDISTRO=${MYDISTRO//-/} && \ RUN echo $(cat /ros2_ws/src/rosbot_gazebo/package.xml | grep '' | sed -r 's/.*([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') > /version.txt -COPY ./ros_entrypoint.sh / +RUN sed -i '/test -f "\/ros2_ws\/install\/setup.bash" && source "\/ros2_ws\/install\/setup.bash"/a \ + ros2 run healthcheck_pkg healthcheck_node &' \ + /ros_entrypoint.sh COPY ./healthcheck.sh / HEALTHCHECK --interval=7s --timeout=2s --start-period=5s --retries=5 \ diff --git a/ros_entrypoint.sh b/ros_entrypoint.sh deleted file mode 100755 index 0799449..0000000 --- a/ros_entrypoint.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -e - -# Run husarnet-dds singleshot and capture the output -output=$(husarnet-dds singleshot || true) -[[ "$HUSARNET_DDS_DEBUG" == "TRUE" ]] && echo "$output" - -# Setup ROS environment -source "/opt/ros/$ROS_DISTRO/setup.bash" -test -f "/ros2_ws/install/setup.bash" && source "/ros2_ws/install/setup.bash" - -# Run healthcheck in the background -ros2 run healthcheck_pkg healthcheck_node & - -# Execute additional commands -exec "$@"