add makefile for easy uploading and running on the robot

This commit is contained in:
Wojciech Kwolek 2021-04-30 13:48:36 +00:00
parent 26e182a855
commit bfa763adb5
3 changed files with 32 additions and 9 deletions

3
.gitignore vendored
View File

@ -51,3 +51,6 @@ qtcreator-*
# Catkin custom files
CATKIN_IGNORE
*.code-workspace
.uploaded

View File

@ -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 <your-package-list-here> \
# #
# # 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

20
Makefile Normal file
View File

@ -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