Skip to content
Snippets Groups Projects
Commit 27dccb24 authored by simon.fanetti's avatar simon.fanetti
Browse files

change structure

parent edbf95c3
Branches
No related tags found
No related merge requests found
......@@ -2,7 +2,6 @@ include src/common.mk
include dep.mk
OBJSALL=$(shell find src -name '*.o')
SETUPAPP=SandboxSetupApp
LIBNAME=libsandbox
LIB_MINOR_VERS=0.0
......@@ -14,7 +13,7 @@ all:
$(MAKE) -C src
$(MAKE) pack -C .
$(MAKE) link -C .
$(MAKE) app -C .
$(MAKE) -C app
pack:
gcc -shared -Wl,-soname,$(LIB_FULL_NAME) -o $(LIB_FULL_NAME) $(OBJSALL)
......@@ -23,14 +22,8 @@ link:
-ln -s $(LIB_FULL_NAME) $(LIBNAME).so.$(LIB_MAJOR_VERS)
-ln -s $(LIB_FULL_NAME) $(LIBNAME).so
app: $(SETUPAPP).o $(LIBNAME).so
g++ $< -o $(SETUPAPP) -L. -lsandbox $(DEP_SANDBOX)
$(SETUPAPP).o: $(SETUPAPP).cpp
$(CCP) $(CFLAGS) -I./includes -c $< -o $@
clean:
-rm -f *.o *.so*
-rm $(SETUPAPP)
$(MAKE) clean -C src
$(MAKE) clean -C app
#!/bin/bash
# Library Sandbox
## Usable script for now
## LD_LIBRARY_PATH must contain dir's path to libsandbox.so
## Do the cmd in your terminal
## Before launching your application
- LD_LIBRARY_PATH must contain dir's path to libsandbox.so
- Enter this command in the terminal where you are using your application
REALTIVE_PATH_TO_SO=../ar_sandbox_lib && \
export LD_LIBRARY_PATH=$(pwd)/$REALTIVE_PATH_TO_SO
include ../src/common.mk
include ../dep.mk
SETUPAPP=SandboxSetupApp
LIB_PATH=..
app: $(SETUPAPP).o
g++ $< -o $(SETUPAPP) -L$(LIB_PATH) -lsandbox $(DEP_SANDBOX)
$(SETUPAPP).o: $(SETUPAPP).cpp
$(CCP) $(CFLAGS) -I$(LIB_PATH)/inc -c $< -o $@
clean:
-rm -f *.o
-rm $(SETUPAPP)
#include "includes/sandboxSetup.h"
#include "../inc/sandboxSetup.h"
int main(){
......
File moved
File moved
File moved
File moved
#ifndef CONTROLLER_H
#define CONTROLLER_H
#ifndef SANDBOX_H
#define SANDBOX_H
#include <opencv2/opencv.hpp>
#include "camera.h"
......@@ -8,7 +8,7 @@
#include "borderedit.h"
#include "sandboxConfig.h"
class Controller
class Sandbox
{
private:
static const int ESCAPE_CHAR = 27;
......@@ -21,7 +21,7 @@ class Controller
void showImage(cv::Mat* image, char *windowName);
public:
Controller();
Sandbox();
cv::Mat getRGBFrame();
cv::Mat getDepthFrame();
cv::Mat* adjustProjection(cv::Mat* frame);
......
File moved
File moved
#ifndef BORDERFINDER_H
#define BORDERFINDER_H
#include <opencv2/opencv.hpp>
class BorderFinder
{
private:
// helper function:
// finds a cosine of angle between vectors
// from pt0->pt1 and from pt0->pt2
double angle(cv::Point pt1, cv::Point pt2, cv::Point pt0);
cv::Mat frameImage;
cv::Rect rotateRect(cv::Rect rect, int heightPercentage, int widthPercetange);
public:
float calculDistance(float point1[], float point2[]);
BorderFinder(cv::Mat frame);
bool find(cv::Rect &rect);
};
#endif
\ No newline at end of file
#ifndef LOG_H
#define LOG_H
#define LOG_NONE 0x0
#define LOG_DEBUG 0x1
#define LOG_WARNING 0x2
#define LOG_ERROR 0x4
extern int log_level;
void error(char*msg);
void mylog(int log_level, const char *format,...);
#endif /* LOG_H */
\ No newline at end of file
......@@ -2,21 +2,34 @@
#define SANDBOX_H
#include <opencv2/opencv.hpp>
#include "controller.h"
#include "camera.h"
#include "beamerProjection.h"
#include "beamer.h"
#include "borderedit.h"
#include "sandboxConfig.h"
class Sandbox
{
private:
Controller controller;
static const int ESCAPE_CHAR = 27;
char *defaultConfigFilePath = (char *)"./sandbox_conf.yaml";
char *defaultWindowsName = (char*) "ShowApp";
BeamerProjection projection;
Camera camera;
Beamer beamer;
void initWindowsFullScreen(char *windowName);
void showImage(cv::Mat* image, char *windowName);
public:
Sandbox();
cv::Mat getRGBFrame();
cv::Mat getDepthFrame();
cv::Mat* adjustProjection(cv::Mat* frame);
void initWindowsFullScreen();
void showImage(cv::Mat* image);
int loadConfig();
int loadConfigFrom(char *path);
void initWindowsFullScreen();
};
#endif
......@@ -4,8 +4,9 @@ SRCS:=$(wildcard *.cpp)
OBJS:=$(SRCS:%.cpp=%.o)
all:
$(MAKE) -C core
$(MAKE) build -C .
$(MAKE) -C components
$(MAKE) -C tools
$(MAKE) -C lib
build: $(OBJS)
......@@ -14,4 +15,6 @@ build: $(OBJS)
clean:
-rm -f *.o
$(MAKE) clean -C core
$(MAKE) clean -C components
$(MAKE) clean -C tools
$(MAKE) clean -C lib
include ../../common.mk
include ../common.mk
SRCS=$(wildcard *.cpp)
OBJS=$(SRCS:%.cpp=%.o)
......
#include "../../../includes/beamer.h"
#include "../../inc/beamer.h"
using namespace cv;
using namespace std;
......
#include "../../../includes/beamerProjection.h"
#include "../../inc/beamerProjection.h"
using namespace cv;
using namespace std;
......
#include "../../../includes/camera.h"
#include "../../inc/camera.h"
using namespace cv;
Camera::Camera() {
......
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment