From eaa408ec1f1c96e06d0ee68c376ec779f40f2b5f Mon Sep 17 00:00:00 2001
From: quentin <quentin.leblanc@hesge.ch>
Date: Thu, 6 Mar 2025 19:49:19 +0100
Subject: [PATCH] everything runs and compile (on my computer)

---
 ar_cubes/Makefile              |  15 ++-
 ar_cubes/ar_cubes.cpp          |   2 +-
 dep.mk                         |   5 +
 display_levels/Makefile        |  12 +-
 test_perf/Makefile             |  15 ++-
 test_perf/output/durations.txt | 201 +++++++++++++++++++++++++++++++++
 6 files changed, 235 insertions(+), 15 deletions(-)
 create mode 100644 dep.mk
 create mode 100644 test_perf/output/durations.txt

diff --git a/ar_cubes/Makefile b/ar_cubes/Makefile
index ef5a92d..ed4514b 100644
--- a/ar_cubes/Makefile
+++ b/ar_cubes/Makefile
@@ -1,17 +1,22 @@
-include ../../../ar_sandbox_lib/dep.mk
-
-API_PATH=../../../ar_sandbox_lib
+API_PATH=../../ar_sandbox_lib
 CFLAGS=-std=c++11 -Wall -Wextra -g
 CCP=g++
 DBG_GPROF=-pg
 
+OPENCVFLAG=`pkg-config --libs --cflags opencv3`
+CAMERAFLAG=-lrealsense2
+YAMLFLAG=-I/usr/local/include -L/usr/local/lib -lyaml-cpp
+
+DEP_SANDBOX=$(OPENCVFLAG) $(CAMERAFLAG) $(YAMLFLAG)
+SANDBOX=-I/home/quentin/Documents/HEPIA/ar_sandbox_lib/inc -L/home/quentin/Documents/HEPIA/ar_sandbox_lib/build/ -lsandbox
+
 all: ar_cubes
 
 ar_cubes: ar_cubes.o
-	$(CCP) $^ -o $@ -L$(API_PATH)/build -lsandbox $(DEP_SANDBOX)
+	$(CCP) $^ -o $@ $(SANDBOX) $(DEP_SANDBOX)
 
 %.o: %.cpp
-	$(CCP) $(CFLAGS) -I$(API_PATH)/inc -c $< -o $@ 
+	$(CCP) $(CFLAGS) $(SANDBOX) $(DEP_SANDBOX) -c $< -o $@ 
 
 run:
 	./ar_cubes
diff --git a/ar_cubes/ar_cubes.cpp b/ar_cubes/ar_cubes.cpp
index 925a058..2ba9211 100644
--- a/ar_cubes/ar_cubes.cpp
+++ b/ar_cubes/ar_cubes.cpp
@@ -6,7 +6,7 @@ int main(){
     Sandbox sandbox;
     char *sandbox_conf_file = (char*)"../../sandbox_conf.yaml";
   
-    if(sandbox.loadConfigFrom(sandbox_conf_file)){
+    if(sandbox.loadConfig(sandbox_conf_file)){
         std::cout << "Failed to load the configuration" << std::endl;
         return 1;
     }
diff --git a/dep.mk b/dep.mk
new file mode 100644
index 0000000..3a9af19
--- /dev/null
+++ b/dep.mk
@@ -0,0 +1,5 @@
+OPENCVFLAG=`pkg-config --libs --cflags opencv3`
+CAMERAFLAG=-lrealsense2
+YAMLFLAG=-I/usr/local/include -L/usr/local/lib -lyaml-cpp
+
+DEP_SANDBOX=$(OPENCVFLAG) $(CAMERAFLAG) $(YAMLFLAG)
diff --git a/display_levels/Makefile b/display_levels/Makefile
index db52e1b..1723d3a 100644
--- a/display_levels/Makefile
+++ b/display_levels/Makefile
@@ -1,17 +1,21 @@
-include ../../ar_sandbox_lib/dep.mk
-
 API_PATH=../../ar_sandbox_lib
 CFLAGS=-std=c++11 -Wall -Wextra -g
 CCP=g++
 
+OPENCVFLAG=`pkg-config --libs --cflags opencv3`
+CAMERAFLAG=-lrealsense2
+YAMLFLAG=-I/usr/local/include -L/usr/local/lib -lyaml-cpp
+
+DEP_SANDBOX=$(OPENCVFLAG) $(CAMERAFLAG) $(YAMLFLAG)
+SANDBOX=-I/home/quentin/Documents/HEPIA/ar_sandbox_lib/inc -L/home/quentin/Documents/HEPIA/ar_sandbox_lib/build/ -lsandbox
 
 all: display_levels
 
 display_levels: display_levels.o
-	$(CCP) $^ -o $@ -L$(API_PATH)/build -lsandbox $(DEP_SANDBOX)
+	$(CCP) $^ -o $@ $(SANDBOX) $(DEP_SANDBOX)
 
 %.o: %.cpp
-	$(CCP) $(CFLAGS) -I$(API_PATH)/inc -c $< -o $@ 
+	$(CCP) $(CFLAGS) $(SANDBOX) $(DEP_SANDBOX) -c $< -o $@ 
 
 run:
 	./display_levels
diff --git a/test_perf/Makefile b/test_perf/Makefile
index 80b13e1..632eb36 100644
--- a/test_perf/Makefile
+++ b/test_perf/Makefile
@@ -1,18 +1,23 @@
-include ../../ar_sandbox_lib/dep.mk
-
-API_PATH=../../ar_sandbox_lib
+API_PATH=../../
 CFLAGS=-std=c++11 -Wall -Wextra -g
 CCP=g++
 
+OPENCVFLAG=`pkg-config --libs --cflags opencv3`
+CAMERAFLAG=-lrealsense2
+YAMLFLAG=-I/usr/local/include -L/usr/local/lib -lyaml-cpp
+
+DEP_SANDBOX=$(OPENCVFLAG) $(CAMERAFLAG) $(YAMLFLAG)
+SANDBOX=-I/home/quentin/Documents/HEPIA/ar_sandbox_lib/inc -L/home/quentin/Documents/HEPIA/ar_sandbox_lib/build/ -lsandbox
+
 .PHONY: run
 
 all: test
 
 test: test.o
-	$(CCP) $^ -o $@ -L$(API_PATH)/build -lsandbox $(DEP_SANDBOX)
+	$(CCP) $^ -o $@ $(SANDBOX) $(DEP_SANDBOX)
 
 %.o: %.cpp
-	$(CCP) $(CFLAGS) -I$(API_PATH)/inc -c $< -o $@ 
+	$(CCP) $(CFLAGS) $(SANDBOX) $(DEP_SANDBOX) -c $< -o $@ 
 
 run: 
 	./test
diff --git a/test_perf/output/durations.txt b/test_perf/output/durations.txt
new file mode 100644
index 0000000..ddb6029
--- /dev/null
+++ b/test_perf/output/durations.txt
@@ -0,0 +1,201 @@
+capture_frame_ms,get_depth_frame_ms,get_color_frame_ms,adjust_projection_ms
+27,1,0,102
+12,0,0,89
+11,0,1,88
+12,0,0,95
+12,0,0,90
+12,1,0,91
+11,1,0,89
+12,0,1,90
+12,0,0,89
+12,1,0,90
+11,0,0,90
+12,0,0,95
+11,0,0,95
+11,0,0,90
+11,0,0,92
+12,0,0,88
+12,0,0,87
+12,0,0,92
+12,0,0,93
+11,0,0,90
+12,0,0,92
+11,1,0,88
+12,0,0,92
+12,0,0,92
+12,1,0,89
+13,0,0,97
+12,1,0,91
+12,0,0,108
+12,0,0,93
+12,0,0,93
+12,0,0,97
+12,0,0,92
+11,1,0,92
+12,0,0,94
+12,0,1,92
+11,1,0,123
+11,0,1,86
+12,0,0,90
+12,0,0,93
+12,0,0,90
+12,0,0,88
+12,1,0,98
+12,0,0,103
+12,0,0,91
+13,0,0,91
+11,0,0,90
+13,0,0,90
+11,0,0,90
+12,0,0,94
+11,1,0,92
+14,0,0,99
+11,0,1,94
+11,0,0,89
+11,0,0,92
+11,0,0,93
+12,1,0,93
+12,0,0,98
+12,0,0,99
+12,0,0,90
+12,0,0,96
+12,0,0,96
+12,0,0,94
+11,0,0,98
+12,0,0,94
+12,0,0,91
+11,0,0,91
+12,0,0,90
+11,0,0,93
+11,0,0,90
+11,1,0,89
+11,1,0,89
+12,0,0,91
+12,0,0,99
+11,0,0,93
+11,0,0,89
+13,0,0,91
+11,1,0,98
+11,1,0,95
+12,0,0,91
+12,1,0,99
+12,0,0,94
+11,0,0,96
+12,0,0,98
+12,0,0,93
+12,0,0,89
+12,0,0,93
+12,0,0,94
+12,0,0,98
+11,0,0,100
+13,0,0,134
+11,0,0,87
+11,1,0,87
+11,0,0,89
+11,0,1,91
+12,0,0,98
+12,0,0,90
+11,0,1,92
+11,1,0,91
+12,0,0,92
+12,0,0,90
+13,0,0,90
+11,0,0,89
+11,0,1,96
+13,0,0,105
+11,1,0,91
+11,0,1,89
+11,1,0,92
+13,0,0,92
+13,0,0,88
+12,1,0,91
+12,0,0,91
+12,1,0,88
+12,0,0,93
+11,1,0,91
+11,1,0,89
+11,0,0,91
+11,1,0,90
+12,0,0,87
+12,0,0,107
+14,0,0,96
+12,0,0,92
+11,0,0,91
+12,0,0,89
+13,1,0,90
+11,1,0,90
+11,0,0,94
+11,1,0,94
+12,0,0,94
+12,0,0,87
+13,1,0,90
+11,0,0,88
+12,0,0,90
+11,0,0,88
+12,0,1,89
+11,0,0,94
+12,1,0,93
+12,1,0,89
+11,1,0,89
+11,0,0,92
+12,0,0,93
+11,0,0,94
+11,1,0,91
+12,0,0,121
+11,0,0,87
+11,0,0,90
+12,0,0,93
+12,0,0,91
+11,0,0,88
+12,0,0,90
+12,0,0,97
+11,0,1,90
+13,0,0,87
+12,0,0,95
+13,0,0,93
+11,1,0,91
+12,0,0,89
+11,1,0,94
+12,0,0,90
+11,1,0,91
+12,0,0,90
+12,0,0,95
+12,0,0,90
+13,0,0,91
+11,0,0,87
+12,1,0,99
+11,1,0,89
+11,1,0,91
+11,0,0,92
+11,0,0,93
+12,0,0,97
+12,0,0,90
+11,0,0,91
+11,0,0,89
+12,0,0,94
+11,1,0,90
+11,1,0,89
+11,0,1,93
+14,0,0,96
+12,0,0,96
+12,0,0,94
+16,0,1,97
+12,0,0,93
+11,0,0,90
+12,0,0,96
+11,1,0,90
+11,1,0,93
+11,0,0,89
+12,0,0,97
+11,1,0,91
+12,0,0,96
+12,0,0,90
+13,0,0,89
+11,0,1,91
+12,0,0,90
+11,1,0,92
+11,1,0,96
+11,0,0,93
+11,0,1,87
+11,0,1,95
+12,1,0,92
-- 
GitLab