Skip to content

Commit

Permalink
* Added creating Docker image to Makefile
Browse files Browse the repository at this point in the history
* Added documentation
  • Loading branch information
chrberger committed Jun 20, 2015
1 parent 303205a commit 8ab9d72
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ CaroloCup-CameraPlayback
*.o
*~
.depend
data
42 changes: 42 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Dockerfile to create a Docker image wrapping the simple
# application realized with OpenDaVINCI to playback
# recordings captured from our CaroloCup miniature cars.
#
# Copyright (C) 2015 Hugo Andrade, Christian Berger, Federico Giaimo.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

# Author: Christian Berger
# Date: 2015-06-25

FROM seresearch/opendavinci-ubuntu-amd64:latest
MAINTAINER Christian Berger "[email protected]"

RUN apt-get update -y

# Set the env variable DEBIAN_FRONTEND to noninteractive
ENV DEBIAN_FRONTEND noninteractive

# Installing killall
RUN apt-get -y install libopencv-dev

RUN apt-get clean
RUN apt-get autoremove

# Set locale (fix the locale warnings)
RUN localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 || :

ADD CaroloCup-CameraPlayback /CaroloCup-CameraPlayback

11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@ BIN=CaroloCup-CameraPlayback
SRCS=CaroloCup-CameraPlayback.cpp
OBJS=$(subst .cpp,.o,$(SRCS))

# Make variables to create the Docker image.
PRODUCT=carolocup-cameraplayback
VERSION=v1
REPOSITORY=seresearch
BUILDLOG=build.log

all: $(BIN)

$(BIN): $(OBJS)
$(CXX) -o $(BIN) $(OBJS) $(LDLIBS)

docker: $(BIN)
docker build -t $(REPOSITORY)/$(PRODUCT):$(VERSION) . | tee $(BUILDLOG) || exit 1

depend: .depend

.depend: $(SRCS)
Expand All @@ -23,7 +32,9 @@ clean:
$(RM) $(OBJS)

dist-clean: clean
$(RM) $(BUILDLOG)
$(RM) $(BIN)
$(RM) *~ .depend

include .depend

33 changes: 33 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
Playing back recordings from our CaroloCup miniature car
========================================================

This application allows you to play back recordings that
we recorded using our experimental miniature car. The car
is competing in the international competition "CaroloCup"
(http://www.carolocup.de).

To playback a recording file that contains data captured
on our experimental car like the video stream and more data,
simply clone this repository and run make all.

To compile the source file, you need to install the
OpenDaVINCI libraries (cf. http://opendavinci.readthedocs.org)
and OpenCV.

Once you will have compiled the source file successfully,
you can run it as follows::

$ ./CaroloCup-CameraPlayback myRecording.rec

Alternatively, you can also use our Docker image where
we provide a ready-to-use binary image. As our image
opens a window to play back the video data, you need to
allow it accessing your X server::

$ xhost +

Then, you can simply run our image (Docker will pull it
for you automatically). The following command assumes that
you have a folder named ``data`` where the *.rec files
are located to be mapped into the Docker container on
its execution::
$ docker run -ti -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v ${PWD}/data:/opt/data seresearch/carolocup-cameraplayback:v1 /CaroloCup-CameraPlayback /opt/data/myRecording.rec

0 comments on commit 8ab9d72

Please sign in to comment.