From 0a20a51d1c4bd847262d06efcf1493aa573dcb09 Mon Sep 17 00:00:00 2001 From: Mohamed Abdelaziz Date: Sun, 10 Sep 2023 23:47:43 +0200 Subject: [PATCH] run command after starting the container --- Dockerfile | 5 ++++- ros_entrypoint.sh | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 539dc3d..73b70ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,7 @@ RUN source /opt/ros/$ROS_DISTRO/setup.bash && \ # Copy ros_entrypoint.sh COPY --chmod=0755 ros_entrypoint.sh /ros_entrypoint.sh -ENTRYPOINT [ "/ros_entrypoint.sh" ] \ No newline at end of file +ENTRYPOINT [ "/ros_entrypoint.sh" ] + +RUN mkdir /output +WORKDIR /output \ No newline at end of file diff --git a/ros_entrypoint.sh b/ros_entrypoint.sh index 289796c..709df25 100644 --- a/ros_entrypoint.sh +++ b/ros_entrypoint.sh @@ -6,5 +6,15 @@ source "/opt/ros/$ROS_DISTRO/setup.bash" source "/colcon_ws/install/setup.bash" exec "$@" -# run help -ros2 autodoc -h +# run ros2autodoc +if [[ -z "$package_name" ]]; then + if [[ -z "$node_name" ]]; then + echo "No nodes are provided. Exiting container." + else + ros2 autodoc $node_name + fi +elif [[ -z "$node_name" ]]; then + echo "No nodes are provided. Exiting container." +else + ros2 autodoc $node_name --package-name $package_name +fi