diff --git a/Makefile b/Makefile index 2eb971e2db8fd921fbe2f1d8a8667da39eba70da..aed3072e4fdef71f4dc369655b3e350bb063a43e 100644 --- a/Makefile +++ b/Makefile @@ -1,29 +1,20 @@ include src/common.mk -SRCS=$(wildcard ./*.cpp) -OBJS=$(SRCS:%.cpp=%.o) -OBJSALL=$(shell find . -name '*.o') +OBJSALL=$(shell find src -name '*.o') + LIBNAME=libsandbox LIB_MINOR_VERS=0.0 LIB_MAJOR_VERS=1 LIB_VERS=$(LIB_MAJOR_VERS).$(LIB_MINOR_VERS) LIB_FULL_NAME=$(LIBNAME).so.$(LIB_VERS) -path=$(shell pwd) -ld_libs=$(shell echo $$LD_LIBRARY_PATH) all: $(MAKE) -C src - $(MAKE) build -C . $(MAKE) pack -C . $(MAKE) link -C . -build: $(OBJS) - -%.o: %.cpp - $(CCP) -c $(CFLAGS) $< -o $@ - pack: - gcc -shared -Wl,-soname,$(LIB_FULL_NAME) -o $(LIB_FULL_NAME) $(OBJSALL) $(OPENCVFLAG) $(CAMERAFLAG) + gcc -shared -Wl,-soname,$(LIB_FULL_NAME) -o $(LIB_FULL_NAME) $(OBJSALL) link: -ln -s $(LIB_FULL_NAME) $(LIBNAME).so.$(LIB_MAJOR_VERS) diff --git a/app_tools/beamer_config.sh b/app_tools/beamer_config.sh deleted file mode 100755 index 9e02401a2ee1216c68c8c207de718010a4157360..0000000000000000000000000000000000000000 --- a/app_tools/beamer_config.sh +++ /dev/null @@ -1,7 +0,0 @@ -SCREEN=DVI-D-0 -SCN_RES=1920x1080 -BEAMER=HDMI-0 -BM_RES=1400x1050 - -xrandr --output $SCREEN --rate 60 --mode $SCN_RES --fb $SCN_RES --panning $SCN_RES* \ - --output $BEAMER --mode $BM_RES --same-as $SCREEN > /dev/null diff --git a/dep.mk b/dep.mk new file mode 100644 index 0000000000000000000000000000000000000000..192ea9c92694ddea8431a9d52b24c68c5f8fd05d --- /dev/null +++ b/dep.mk @@ -0,0 +1,3 @@ +OPENCVFLAG=`pkg-config --libs --cflags opencv` +CAMERAFLAG=-lrealsense2 +DEP_SANDBOX=$(OPENCVFLAG) $(CAMERAFLAG) \ No newline at end of file diff --git a/export.sh b/export.sh index 3a1d7cc5c8cf4d8df9d7b1f7e33fa7bf60f7e870..218b4d4466dd2e1d3c9bf661953078cfdf5d7ae2 100644 --- a/export.sh +++ b/export.sh @@ -1,4 +1,3 @@ #!/bin/bash -export LD_LIBRARY_PATH=$(pwd) && \ -make link +export LD_LIBRARY_PATH=$(pwd) diff --git a/includes/controller.h b/includes/controller.h index b37c8f01adc6134107498936c7f0b1c8e74bb1e6..501b656f4b663cd83012207a0e5eecb36d946362 100644 --- a/includes/controller.h +++ b/includes/controller.h @@ -34,12 +34,12 @@ class Controller Beamer beamer; void createWindowsFullScreen(char *windowName); void showImage(cv::Mat* image, char *windowName); - bool readSandboxPosition(std::vector<cv::Point> &rectPoints); - void writeSandboxPosition(std::vector<cv::Point> rectPoints); + //bool readSandboxPosition(std::vector<cv::Point> &rectPoints); + //void writeSandboxPosition(std::vector<cv::Point> rectPoints); double toDegrees(double radians); void sanboxBorder(); - void sandboxBorderLoad(); - bool configFilesFound(); + //void sandboxBorderLoad(); + //bool configFilesFound(); }; diff --git a/includes/sandbox_setup.h b/includes/sandbox_setup.h index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..19caddc8c4153853d7c236d6f4253f51367e7d26 100644 --- a/includes/sandbox_setup.h +++ b/includes/sandbox_setup.h @@ -0,0 +1,4 @@ +#ifndef SANDBOX_SETUP_H +#define SANDBOX_SETUP_H + +#endif diff --git a/sandbox_setup.cpp b/sandbox_setup.cpp deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/Makefile b/src/Makefile index 4e098e6b88e68789b2e6f61215bd1e04ddb874e9..6347fd1e81572ba4b74bd1c0e7f61431d7d1efe2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,18 +4,14 @@ SRCS:=$(wildcard *.cpp) OBJS:=$(SRCS:%.cpp=%.o) all: - $(MAKE) -C components - #$(MAKE) -C tools + $(MAKE) -C lib $(MAKE) build -C . build: $(OBJS) %.o: %.cpp - g++ $(CFLAGS) -c $< -o $@ + $(CCP) -c $(CFLAGS) $< -o $@ clean: -rm -f *.o - $(MAKE) clean -C components - #$(MAKE) clean -C tools - - + $(MAKE) clean -C lib diff --git a/src/common.mk b/src/common.mk index dab528a8f90bc07db54e163df53bb33361a28683..6f95981371b428ef5068397631c4ba270443949e 100644 --- a/src/common.mk +++ b/src/common.mk @@ -1,4 +1,2 @@ CCP=g++ CFLAGS=-std=c++11 -Wall -Wextra -g -Ilib -fPIC -OPENCVFLAG=`pkg-config --libs --cflags opencv` -CAMERAFLAG=-lrealsense2 diff --git a/config/.gitkeep b/src/config/.gitkeep similarity index 100% rename from config/.gitkeep rename to src/config/.gitkeep diff --git a/config/beamer.dat b/src/config/beamer.dat similarity index 100% rename from config/beamer.dat rename to src/config/beamer.dat diff --git a/config/distance.dat b/src/config/distance.dat similarity index 100% rename from config/distance.dat rename to src/config/distance.dat diff --git a/config/matrixe.dat b/src/config/matrixe.dat similarity index 100% rename from config/matrixe.dat rename to src/config/matrixe.dat diff --git a/config/sandbox.dat b/src/config/sandbox.dat similarity index 100% rename from config/sandbox.dat rename to src/config/sandbox.dat diff --git a/src/lib/Makefile b/src/lib/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..caad237c0536988d90049e5a46c554bd4139deb7 --- /dev/null +++ b/src/lib/Makefile @@ -0,0 +1,21 @@ +include ../common.mk + +SRCS:=$(wildcard *.cpp) +OBJS:=$(SRCS:%.cpp=%.o) + +all: + $(MAKE) -C components + $(MAKE) -C tools + $(MAKE) build -C . + +build: $(OBJS) + +%.o: %.cpp + g++ $(CFLAGS) -c $< -o $@ + +clean: + -rm -f *.o + $(MAKE) clean -C components + $(MAKE) clean -C tools + + diff --git a/src/components/Makefile b/src/lib/components/Makefile similarity index 73% rename from src/components/Makefile rename to src/lib/components/Makefile index 174f235eb1e5d34ebb3058546eff6edde37d7772..c621ec261d64dead6bf551778b303c676a0485ac 100644 --- a/src/components/Makefile +++ b/src/lib/components/Makefile @@ -1,8 +1,7 @@ -include ../common.mk +include ../../common.mk SRCS=$(wildcard *.cpp) OBJS=$(SRCS:%.cpp=%.o) -CAMERAFLAG=-lrealsense2 build: $(OBJS) diff --git a/src/components/beamer.cpp b/src/lib/components/beamer.cpp similarity index 99% rename from src/components/beamer.cpp rename to src/lib/components/beamer.cpp index d953e6c3dd040aea0e37fa0f04b4734d3c292a49..7001fb338c1a2d56e2d5fba4adff7c4162976d49 100644 --- a/src/components/beamer.cpp +++ b/src/lib/components/beamer.cpp @@ -1,4 +1,4 @@ -#include "../../includes/beamer.h" +#include "../../../includes/beamer.h" using namespace cv; using namespace std; diff --git a/src/components/calibrate.cpp b/src/lib/components/calibrate.cpp similarity index 97% rename from src/components/calibrate.cpp rename to src/lib/components/calibrate.cpp index 3b5935fae76af3a5ac11d1443c1a1c12a44ebd70..e68003ed8f43059e9cdec8bc9e6abf78b7fba570 100644 --- a/src/components/calibrate.cpp +++ b/src/lib/components/calibrate.cpp @@ -1,5 +1,5 @@ -#include "../../includes/calibrate.h" -#include "../../includes/camera.h" +#include "../../../includes/calibrate.h" +#include "../../../includes/camera.h" using namespace cv; using namespace std; diff --git a/src/components/camera.cpp b/src/lib/components/camera.cpp similarity index 99% rename from src/components/camera.cpp rename to src/lib/components/camera.cpp index 423fae0ba754f09cbc02059f070497c0085efa54..ce694e1dd7bb908241bec2f8702698d412bf03af 100644 --- a/src/components/camera.cpp +++ b/src/lib/components/camera.cpp @@ -1,4 +1,4 @@ -#include "../../includes/camera.h" +#include "../../../includes/camera.h" using namespace cv; Camera::Camera() {} diff --git a/src/controller.cpp b/src/lib/controller.cpp similarity index 99% rename from src/controller.cpp rename to src/lib/controller.cpp index 1a9e6bb41b1289d36d70cde276602bbece4551e2..bc2f8183aa551fe9ccb3e7330cefd117e5636c1c 100644 --- a/src/controller.cpp +++ b/src/lib/controller.cpp @@ -1,4 +1,4 @@ -#include "../includes/controller.h" +#include "../../includes/controller.h" #include <numeric> #include <fstream> #include <string> @@ -15,7 +15,7 @@ Controller::Controller(){ // Matching cross under beamer routine beamer.findBeamer(camera); }else{ - sandboxBorderLoad(); + //sandboxBorderLoad(); //beamer.findBeamerLoad(camera); } // Set full screen parameter for show function diff --git a/src/tools/Makefile b/src/lib/tools/Makefile similarity index 63% rename from src/tools/Makefile rename to src/lib/tools/Makefile index c10d9b51d30dea0eafde411868b5748da6df95ae..a422e9b1db9a31b453e794bb8484b18a5a8834b6 100644 --- a/src/tools/Makefile +++ b/src/lib/tools/Makefile @@ -1,4 +1,4 @@ -include ../common.mk +include ../../common.mk SRCS_C=$(wildcard *.c) OBJS_C=$(SRCS_C:%.c=%.o) @@ -8,10 +8,10 @@ OBJS_CPP=$(SRCS_CPP:%.cpp=%.o) build: $(OBJS_C) $(OBJS_CPP) %.o: %.cpp - g++ $(CFLAGS) $(OPENCVFLAG) -c $< -o $@ + g++ $(CFLAGS) -c $< -o $@ %.o: %.c - gcc -Wall -Wextra -std=gnu11 -c $< -o $@ + gcc -Wall -Wextra -std=gnu11 -fPIC -c $< -o $@ clean: -rm -f *.o diff --git a/src/tools/borderedit.cpp b/src/lib/tools/borderedit.cpp similarity index 97% rename from src/tools/borderedit.cpp rename to src/lib/tools/borderedit.cpp index 0dba3fcb46409162f493ab1d53e0b2a2f10124bc..4878927feecd844dbaac76d344df75f8729f000e 100644 --- a/src/tools/borderedit.cpp +++ b/src/lib/tools/borderedit.cpp @@ -1,5 +1,5 @@ #include <algorithm> -#include "../../includes/borderedit.h" +#include "../../../includes/borderedit.h" using namespace std; using namespace cv; diff --git a/src/tools/borderfinder.cpp b/src/lib/tools/borderfinder.cpp similarity index 98% rename from src/tools/borderfinder.cpp rename to src/lib/tools/borderfinder.cpp index ba800000ba760434250d39c33cbd98ab6f4c602f..c2cb5bbbbb70c8a5ed47ef7405c992635dc50841 100644 --- a/src/tools/borderfinder.cpp +++ b/src/lib/tools/borderfinder.cpp @@ -1,5 +1,5 @@ #include <algorithm> -#include "../../includes/borderfinder.h" +#include "../../../includes/borderfinder.h" using namespace std; using namespace cv; diff --git a/src/tools/log.c b/src/lib/tools/log.c similarity index 97% rename from src/tools/log.c rename to src/lib/tools/log.c index 6c7cab54967cf5b899ccad02764e62f0644b4b07..f7f435239995b29e5e564d937a318be6f6613516 100644 --- a/src/tools/log.c +++ b/src/lib/tools/log.c @@ -3,7 +3,7 @@ #include <unistd.h> #include <strings.h> #include <stdarg.h> -#include "../../includes/log.h" +#include "../../../includes/log.h" diff --git a/sandbox.cpp b/src/sandbox.cpp similarity index 97% rename from sandbox.cpp rename to src/sandbox.cpp index 48d31dab64b7eae75b0702dfac14477e32d35c30..040ccfe2c6f611bcb0f16df0014fed8ac6c6aa91 100644 --- a/sandbox.cpp +++ b/src/sandbox.cpp @@ -1,4 +1,4 @@ -#include "includes/sandbox.h" +#include "../includes/sandbox.h" Sandbox::Sandbox(){ //controller = Controller(); diff --git a/src/sandbox_setup.cpp b/src/sandbox_setup.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7ada7536ea38c8cf00cd64be96a031922bddb803 --- /dev/null +++ b/src/sandbox_setup.cpp @@ -0,0 +1 @@ +#include "../includes/sandbox_setup.h"