Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fgiaimo committed Aug 3, 2015
2 parents 8f109fc + 029084e commit e9b1e78
Show file tree
Hide file tree
Showing 6 changed files with 387 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ CaroloCup-CameraPlayback
*~
.depend
data
build*
58 changes: 58 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# CaroloCup-CameraPlayback - 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.

CMAKE_MINIMUM_REQUIRED (VERSION 2.8)

PROJECT (CaroloCup-CameraPlayback)

###########################################################################
# Set the search path for .cmake files.
SET (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake.Modules" ${CMAKE_MODULE_PATH})

###########################################################################
# Find OpenDaVINCI.
FIND_PACKAGE (OpenDaVINCI REQUIRED)

###########################################################################
# Find OpenCV.
SET(OpenCV_DIR "/usr")
FIND_PACKAGE (OpenCV REQUIRED)

###########################################################################
# Set linking libraries to successfully link test suites and binaries.
SET (LIBRARIES ${OPENDAVINCI_LIBRARIES} ${OpenCV_LIBS})

###########################################################################
# Set header files from OpenDaVINCI.
INCLUDE_DIRECTORIES (${OPENDAVINCI_INCLUDE_DIRS}/opendavinci)
# Set header files from OpenCV.
INCLUDE_DIRECTORIES (${OpenCV_INCLUDE_DIR})
# Set include directory.
INCLUDE_DIRECTORIES(include)

###############################################################################
# Build this project.
ADD_EXECUTABLE (CaroloCup-CameraPlayback "CaroloCup-CameraPlayback.cpp")
TARGET_LINK_LIBRARIES (CaroloCup-CameraPlayback ${LIBRARIES})

###############################################################################
# Install this project.
INSTALL(TARGETS CaroloCup-CameraPlayback RUNTIME DESTINATION bin COMPONENT software)

16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

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

FROM seresearch/opendavinci-ubuntu-amd64:latest
MAINTAINER Christian Berger "[email protected]"
Expand All @@ -35,8 +35,20 @@ RUN apt-get -y install libopencv-dev
RUN apt-get clean
RUN apt-get autoremove

RUN apt-get update -y
RUN apt-get upgrade -y

RUN apt-get install -y wget

RUN wget -O - -q http://opendavinci.cse.chalmers.se/opendavinci.cse.chalmers.se.gpg.key | apt-key add -
RUN echo "deb http://opendavinci.cse.chalmers.se/ubuntu/ trusty main" >> /etc/apt/sources.list

RUN apt-get update -y

RUN apt-get install -y opendavinci-odlib

# 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
ADD build/CaroloCup-CameraPlayback /CaroloCup-CameraPlayback

54 changes: 22 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,41 +1,31 @@
PREFIX=/usr
CXX=g++
RM=rm -f
INCLUDES=-I$(PREFIX)/include/opendavinci
CPPFLAGS=-Wall $(INCLUDES)
LDLIBS=-L$(PREFIX)/lib/ -lopendavinci -lpthread -lopencv_core -lopencv_highgui
# Makefile - Makefile to create a Docker image.
# Copyright (C) 2015 Christian Berger
#
# 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.

BIN=CaroloCup-CameraPlayback
SRCS=CaroloCup-CameraPlayback.cpp
OBJS=$(subst .cpp,.o,$(SRCS))

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

all: $(BIN)

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

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

depend: .depend

.depend: $(SRCS)
rm -f ./.depend
$(CXX) $(CPPFLAGS) -MM $^>>./.depend;

clean:
$(RM) $(OBJS)

dist-clean: clean
$(RM) $(BUILDLOG)
$(RM) $(BIN)
$(RM) *~ .depend
docker-tag-latest:
docker tag -f $(shell tail -1 $(BUILDLOG) | cut -f3 -d" ") $(REPOSITORY)/$(PRODUCT):latest

include .depend
push:
docker push $(REPOSITORY)/$(PRODUCT):$(VERSION) && docker push $(REPOSITORY)/$(PRODUCT):latest

7 changes: 6 additions & 1 deletion README.rst → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ you can run it as follows::

$ ./CaroloCup-CameraPlayback myRecording.rec

If you have the corresponding ground truth data at hand,
just specify the .csv file as additional parameter::

$ ./CaroloCup-CameraPlayback myRecording.rec myRecording.csv

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
Expand All @@ -32,5 +37,5 @@ 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
$ docker run -ti -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v ${PWD}/data:/opt/data seresearch/carolocup-cameraplayback:latest /CaroloCup-CameraPlayback /opt/data/myRecording.rec /opt/data/myRecording.csv

Loading

0 comments on commit e9b1e78

Please sign in to comment.