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

add valgrind debug

parent 2b8b819f
No related branches found
No related tags found
No related merge requests found
include ../ar_sandbox_lib/dep.mk
API_PATH=../ar_sandbox_lib
CFLAGS=-std=c++11 -Wall -Wextra -g
CCP=g++
all: app
app: app.o
$(CCP) $^ -o $@ -L$(API_PATH)/build -lsandbox $(DEP_SANDBOX)
%.o: %.cpp
$(CCP) $(CFLAGS) -I$(API_PATH)/inc -c $< -o $@
all:
$(MAKE) -C app
run:
./app
$(MAKE) run -C app
setup:
$(API_PATH)/app/SandboxSetup/SandboxSetup
debug:
$(MAKE) debug -C app
clean:
rm -f *.o app
$(MAKE) clean -C app
include ../../ar_sandbox_lib/dep.mk
API_PATH=../../ar_sandbox_lib
CFLAGS=-std=c++11 -Wall -Wextra -g
CCP=g++
all: app
app: app.o
$(CCP) $^ -o $@ -L$(API_PATH)/build -lsandbox $(DEP_SANDBOX)
%.o: %.cpp
$(CCP) $(CFLAGS) -I$(API_PATH)/inc -c $< -o $@
run:
./app
debug:
$(shell cd ../valgrind_profiles && valgrind --tool=callgrind --dump-instr=yes --simulate-cache=yes --collect-jumps=yes --collect-atstart=no --instr-atstart=no ../app/app)
clean:
rm -f *.o app
#include "app.h"
#include <valgrind/callgrind.h>
Sandbox sandbox;
void (*apps[1])() = {showLevel};
int main(int argc, char *argv[])
{
if(sandbox.loadConfig()){
if(sandbox.loadConfigFrom("../sandbox_conf.yaml")){
std::cout << "Failed to load the configuration" << std::endl;
return 1;
}
......@@ -35,17 +35,55 @@ void showLevel(){
cv::namedWindow(windowName, CV_WINDOW_NORMAL);
cv::setWindowProperty(windowName, CV_WND_PROP_FULLSCREEN, CV_WINDOW_FULLSCREEN);
//
// Debug
//
/*
sandbox.captureFrame();
cv::Mat depth = sandbox.getDepthFrame();
cv::Mat colored = colorizeDepth(depth, top, sandboxHeight);
cv::Mat res;
cv::cvtColor(colored, res, CV_BGR2RGB);
CALLGRIND_START_INSTRUMENTATION;
CALLGRIND_TOGGLE_COLLECT;
res = sandbox.adjustProjection(res);
CALLGRIND_TOGGLE_COLLECT;
CALLGRIND_STOP_INSTRUMENTATION;
cv::imshow(windowName, res);
*/
//
// Default
//
do{
sandbox.captureFrame();
cv::Mat depth = sandbox.getDepthFrame();
cv::Mat colored = colorizeDepth(depth, top, sandboxHeight);
cv::Mat res;
cv::cvtColor(colored, res, CV_BGR2RGB);
res = sandbox.adjustProjection(res);
cv::imshow(windowName, res);
} while (cv::waitKey(10) != ESCAPE_CHAR);
//
// End
//
cv::destroyAllWindows();
}
......
#ifndef MY_APPS_H
#define MY_APPS_H
#include "../ar_sandbox_lib/inc/sandbox.h"
#include <sandbox.h>
#include <opencv2/opencv.hpp>
#define ESCAPE_CHAR 27
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment