Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ar_sandbox_app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AR_Sandbox
ar_sandbox_app
Commits
c18de7e4
Commit
c18de7e4
authored
4 years ago
by
simon.fanetti
Browse files
Options
Downloads
Patches
Plain Diff
add valgrind debug
parent
2b8b819f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
Makefile
+7
-10
7 additions, 10 deletions
Makefile
app/Makefile
+22
-0
22 additions, 0 deletions
app/Makefile
app/app.cpp
+41
-3
41 additions, 3 deletions
app/app.cpp
app/app.h
+1
-1
1 addition, 1 deletion
app/app.h
valgrind_profiles/callgrind.out.21305
+70377
-0
70377 additions, 0 deletions
valgrind_profiles/callgrind.out.21305
with
70448 additions
and
14 deletions
Makefile
+
7
−
10
View file @
c18de7e4
include
../ar_sandbox_lib/dep.mk
API_PATH
=
../ar_sandbox_lib
API_PATH
=
../ar_sandbox_lib
CFLAGS
=
-std
=
c++11
-Wall
-Wextra
-g
CFLAGS
=
-std
=
c++11
-Wall
-Wextra
-g
CCP
=
g++
CCP
=
g++
all
:
app
all
:
$(
MAKE
)
-C
app
app
:
app.o
$(
CCP
)
$^
-o
$@
-L
$(
API_PATH
)
/build
-lsandbox
$(
DEP_SANDBOX
)
%.o
:
%.cpp
$(
CCP
)
$(
CFLAGS
)
-I
$(
API_PATH
)
/inc
-c
$<
-o
$@
run
:
run
:
./
app
$(
MAKE
)
run
-C
app
setup
:
setup
:
$(
API_PATH
)
/app/SandboxSetup/SandboxSetup
$(
API_PATH
)
/app/SandboxSetup/SandboxSetup
debug
:
$(
MAKE
)
debug
-C
app
clean
:
clean
:
rm
-f
*
.o
app
$(
MAKE
)
clean
-C
app
This diff is collapsed.
Click to expand it.
app/Makefile
0 → 100644
+
22
−
0
View file @
c18de7e4
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
This diff is collapsed.
Click to expand it.
app.cpp
→
app/
app.cpp
+
41
−
3
View file @
c18de7e4
#include
"app.h"
#include
"app.h"
#include
<valgrind/callgrind.h>
Sandbox
sandbox
;
Sandbox
sandbox
;
void
(
*
apps
[
1
])()
=
{
showLevel
};
void
(
*
apps
[
1
])()
=
{
showLevel
};
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
if
(
sandbox
.
loadConfig
(
)){
if
(
sandbox
.
loadConfig
From
(
"../sandbox_conf.yaml"
)){
std
::
cout
<<
"Failed to load the configuration"
<<
std
::
endl
;
std
::
cout
<<
"Failed to load the configuration"
<<
std
::
endl
;
return
1
;
return
1
;
}
}
...
@@ -35,17 +35,55 @@ void showLevel(){
...
@@ -35,17 +35,55 @@ void showLevel(){
cv
::
namedWindow
(
windowName
,
CV_WINDOW_NORMAL
);
cv
::
namedWindow
(
windowName
,
CV_WINDOW_NORMAL
);
cv
::
setWindowProperty
(
windowName
,
CV_WND_PROP_FULLSCREEN
,
CV_WINDOW_FULLSCREEN
);
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
{
do
{
sandbox
.
captureFrame
();
cv
::
Mat
depth
=
sandbox
.
getDepthFrame
();
cv
::
Mat
depth
=
sandbox
.
getDepthFrame
();
cv
::
Mat
colored
=
colorizeDepth
(
depth
,
top
,
sandboxHeight
);
cv
::
Mat
colored
=
colorizeDepth
(
depth
,
top
,
sandboxHeight
);
cv
::
Mat
res
;
cv
::
Mat
res
;
cv
::
cvtColor
(
colored
,
res
,
CV_BGR2RGB
);
cv
::
cvtColor
(
colored
,
res
,
CV_BGR2RGB
);
res
=
sandbox
.
adjustProjection
(
res
);
res
=
sandbox
.
adjustProjection
(
res
);
cv
::
imshow
(
windowName
,
res
);
cv
::
imshow
(
windowName
,
res
);
}
while
(
cv
::
waitKey
(
10
)
!=
ESCAPE_CHAR
);
}
while
(
cv
::
waitKey
(
10
)
!=
ESCAPE_CHAR
);
//
// End
//
cv
::
destroyAllWindows
();
cv
::
destroyAllWindows
();
}
}
...
...
This diff is collapsed.
Click to expand it.
app.h
→
app/
app.h
+
1
−
1
View file @
c18de7e4
#ifndef MY_APPS_H
#ifndef MY_APPS_H
#define MY_APPS_H
#define MY_APPS_H
#include
"../ar_sandbox_lib/inc/
sandbox.h
"
#include
<
sandbox.h
>
#include
<opencv2/opencv.hpp>
#include
<opencv2/opencv.hpp>
#define ESCAPE_CHAR 27
#define ESCAPE_CHAR 27
...
...
This diff is collapsed.
Click to expand it.
valgrind_profiles/callgrind.out.21305
0 → 100644
+
70377
−
0
View file @
c18de7e4
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment