From bfa763adb59d6d1cb6fdb2e1de40f4d75a93d272 Mon Sep 17 00:00:00 2001 From: Wojciech Kwolek Date: Fri, 30 Apr 2021 13:48:36 +0000 Subject: [PATCH] add makefile for easy uploading and running on the robot --- .gitignore | 3 +++ Dockerfile.devcontainer | 18 +++++++++--------- Makefile | 20 ++++++++++++++++++++ 3 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index bc99fc9..28f69ef 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,6 @@ qtcreator-* # Catkin custom files CATKIN_IGNORE + +*.code-workspace +.uploaded \ No newline at end of file diff --git a/Dockerfile.devcontainer b/Dockerfile.devcontainer index 71f45fc..11d765c 100644 --- a/Dockerfile.devcontainer +++ b/Dockerfile.devcontainer @@ -2,15 +2,15 @@ FROM athackst/ros2:foxy-dev # ** [Optional] Uncomment this section to install additional packages. ** # -# ENV DEBIAN_FRONTEND=noninteractive -# RUN apt-get update \ -# && apt-get -y install --no-install-recommends \ -# # -# # Clean up -# && apt-get autoremove -y \ -# && apt-get clean -y \ -# && rm -rf /var/lib/apt/lists/* -# ENV DEBIAN_FRONTEND=dialog +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update \ + && apt-get -y install --no-install-recommends rsync \ + # + # Clean up + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* +ENV DEBIAN_FRONTEND=dialog # Set up auto-source of workspace for ros user diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3db77ce --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +.PHONY: build run upload + +SOURCES := $(wildcard src/ros2aria/src/*.cpp) +HEADERS := $(wildcard src/ros2aria/src/*.hpp) + +build/ros2aria/ros2aria: $(SOURCES) $(HEADERS) + colcon build + +build: build/ros2aria/ros2aria + +.uploaded: build/ros2aria/ros2aria + rsync -r build/ros2aria/ros2aria lab1_5@pionier6:~/ros2aria + touch .uploaded + +upload: .uploaded + +run: upload + ssh lab1_5@pionier6 -t -- docker run --rm --network=host -it --device /dev/ttyS0 -v /home/lab1_5:/ws irth7/ros2aria-dev /ws/ros2aria + +