Skip to content

Commit 9208f06

Browse files
author
Manuel Stoiber
committed
feat(M3T): first version
1 parent 826f07b commit 9208f06

231 files changed

Lines changed: 114767 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

M3T/.clang-format

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: Google
4+
AccessModifierOffset: -1
5+
AlignAfterOpenBracket: Align
6+
AlignEscapedNewlines: Left
7+
AlignOperands: true
8+
AlignTrailingComments: true
9+
AllowAllConstructorInitializersOnNextLine: true
10+
AllowAllParametersOfDeclarationOnNextLine: true
11+
AllowShortBlocksOnASingleLine: Never
12+
AllowShortCaseLabelsOnASingleLine: false
13+
AllowShortFunctionsOnASingleLine: All
14+
AllowShortIfStatementsOnASingleLine: true
15+
AllowShortLoopsOnASingleLine: true
16+
AlwaysBreakAfterDefinitionReturnType: None
17+
AlwaysBreakAfterReturnType: None
18+
AlwaysBreakBeforeMultilineStrings: true
19+
AlwaysBreakTemplateDeclarations: Yes
20+
BinPackArguments: true
21+
BinPackParameters: true
22+
BraceWrapping:
23+
AfterClass: false
24+
AfterControlStatement: Never
25+
AfterEnum: false
26+
AfterFunction: false
27+
AfterNamespace: false
28+
AfterObjCDeclaration: false
29+
AfterStruct: false
30+
AfterUnion: false
31+
AfterExternBlock: false
32+
BeforeCatch: false
33+
BeforeElse: false
34+
IndentBraces: false
35+
SplitEmptyFunction: true
36+
SplitEmptyRecord: true
37+
SplitEmptyNamespace: true
38+
BreakBeforeBinaryOperators: None
39+
BreakBeforeBraces: Attach
40+
BreakBeforeInheritanceComma: false
41+
BreakInheritanceList: BeforeColon
42+
BreakBeforeTernaryOperators: true
43+
BreakConstructorInitializersBeforeComma: false
44+
BreakConstructorInitializers: BeforeColon
45+
BreakAfterJavaFieldAnnotations: false
46+
BreakStringLiterals: true
47+
ColumnLimit: 80
48+
CommentPragmas: '^ IWYU pragma:'
49+
CompactNamespaces: false
50+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
51+
ConstructorInitializerIndentWidth: 4
52+
ContinuationIndentWidth: 4
53+
Cpp11BracedListStyle: true
54+
DerivePointerAlignment: true
55+
DisableFormat: false
56+
ExperimentalAutoDetectBinPacking: false
57+
FixNamespaceComments: true
58+
ForEachMacros:
59+
- foreach
60+
- Q_FOREACH
61+
- BOOST_FOREACH
62+
IncludeBlocks: Preserve
63+
IncludeCategories:
64+
- Regex: '^<ext/.*\.h>'
65+
Priority: 2
66+
- Regex: '^<.*\.h>'
67+
Priority: 1
68+
- Regex: '^<.*'
69+
Priority: 2
70+
- Regex: '.*'
71+
Priority: 3
72+
IncludeIsMainRegex: '([-_](test|unittest))?$'
73+
IndentCaseLabels: true
74+
IndentPPDirectives: None
75+
IndentWidth: 2
76+
IndentWrappedFunctionNames: false
77+
JavaScriptQuotes: Leave
78+
JavaScriptWrapImports: true
79+
KeepEmptyLinesAtTheStartOfBlocks: false
80+
MacroBlockBegin: ''
81+
MacroBlockEnd: ''
82+
MaxEmptyLinesToKeep: 1
83+
NamespaceIndentation: None
84+
ObjCBinPackProtocolList: Never
85+
ObjCBlockIndentWidth: 2
86+
ObjCSpaceAfterProperty: false
87+
ObjCSpaceBeforeProtocolList: true
88+
PenaltyBreakAssignment: 2
89+
PenaltyBreakBeforeFirstCallParameter: 1
90+
PenaltyBreakComment: 300
91+
PenaltyBreakFirstLessLess: 120
92+
PenaltyBreakString: 1000
93+
PenaltyBreakTemplateDeclaration: 10
94+
PenaltyExcessCharacter: 1000000
95+
PenaltyReturnTypeOnItsOwnLine: 200
96+
PointerAlignment: Left
97+
RawStringFormats:
98+
- Language: Cpp
99+
Delimiters:
100+
- cc
101+
- CC
102+
- cpp
103+
- Cpp
104+
- CPP
105+
- 'c++'
106+
- 'C++'
107+
CanonicalDelimiter: ''
108+
BasedOnStyle: google
109+
- Language: TextProto
110+
Delimiters:
111+
- pb
112+
- PB
113+
- proto
114+
- PROTO
115+
EnclosingFunctions:
116+
- EqualsProto
117+
- EquivToProto
118+
- PARSE_PARTIAL_TEXT_PROTO
119+
- PARSE_TEST_PROTO
120+
- PARSE_TEXT_PROTO
121+
- ParseTextOrDie
122+
- ParseTextProtoOrDie
123+
CanonicalDelimiter: ''
124+
BasedOnStyle: google
125+
ReflowComments: true
126+
SortIncludes: true
127+
SortUsingDeclarations: true
128+
SpaceAfterCStyleCast: false
129+
SpaceAfterLogicalNot: false
130+
SpaceAfterTemplateKeyword: true
131+
SpaceBeforeAssignmentOperators: true
132+
SpaceBeforeCpp11BracedList: false
133+
SpaceBeforeCtorInitializerColon: true
134+
SpaceBeforeInheritanceColon: true
135+
SpaceBeforeParens: ControlStatements
136+
SpaceBeforeRangeBasedForLoopColon: true
137+
SpaceInEmptyParentheses: false
138+
SpacesBeforeTrailingComments: 2
139+
SpacesInAngles: false
140+
SpacesInContainerLiterals: true
141+
SpacesInCStyleCastParentheses: false
142+
SpacesInParentheses: false
143+
SpacesInSquareBrackets: false
144+
Standard: Auto
145+
TabWidth: 8
146+
UseTab: Never
147+
...
148+

M3T/.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
/*/
3+
*.asv
4+
doc/html
5+
!/include/
6+
!/src/
7+
!/third_party/
8+
!/test/
9+
!/examples/
10+
!/data/
11+
!/doc/
12+
!.gitignore
13+
!CMakeLists.txt
14+
!readme.md
15+
!.clang-format

M3T/CMakeLists.txt

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
3+
# A Multi-Body Multi-Modality Multi-Camera 3D Tracker (M3T)
4+
# =============================================================================
5+
project(M3T)
6+
7+
8+
# Options
9+
# =============================================================================
10+
option(USE_AZURE_KINECT "Use Azure Kinect" ON)
11+
option(USE_REALSENSE "Use RealSense D435" ON)
12+
option(USE_GTEST "Use gtest" ON)
13+
14+
15+
# Libraries
16+
# =============================================================================
17+
18+
# Build static on Windows
19+
if (WIN32)
20+
set(GLEW_STATIC true)
21+
set(OpenCV_STATIC true)
22+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
23+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -MTd")
24+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -MT")
25+
endif ()
26+
27+
# Used libraries
28+
find_package(Eigen3 3.3.2 REQUIRED)
29+
find_package(GLEW REQUIRED)
30+
if (UNIX)
31+
set(OpenGL_GL_PREFERENCE LEGACY)
32+
endif ()
33+
find_package(OpenGL REQUIRED)
34+
find_package(glfw3 3.1.2 REQUIRED)
35+
find_package(OpenCV 4.3.0 REQUIRED COMPONENTS core imgproc highgui imgcodecs calib3d features2d xfeatures2d OPTIONAL_COMPONENTS cudafeatures2d)
36+
37+
if (USE_AZURE_KINECT)
38+
find_package(k4a 1.3.0 REQUIRED)
39+
endif ()
40+
41+
if (USE_REALSENSE)
42+
find_package(realsense2 REQUIRED)
43+
endif ()
44+
45+
find_package(OpenMP)
46+
if (OPENMP_FOUND)
47+
if (WIN32)
48+
set(CMAKE_CXX_FLAGS_RELEASE
49+
"${CMAKE_CXX_FLAGS_RELEASE} -openmp:experimental")
50+
set(CMAKE_C_FLAGS_RELEASE
51+
"${CMAKE_C_FLAGS_RELEASE} ${OpenMP_C_FLAGS}")
52+
set(CMAKE_CXX_FLAGS_RELEASE
53+
"${CMAKE_CXX_FLAGS_RELEASE} ${OpenMP_CXX_FLAGS}")
54+
set(CMAKE_EXE_LINKER_FLAGS
55+
"${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
56+
else ()
57+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
58+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
59+
set(CMAKE_EXE_LINKER_FLAGS
60+
"${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
61+
endIf ()
62+
endif ()
63+
64+
65+
# Compiler Settings
66+
# =============================================================================
67+
68+
# Default settings
69+
set(CMAKE_CXX_STANDARD 17)
70+
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
71+
include(CheckCXXCompilerFlag)
72+
check_cxx_compiler_flag(-march HAS_MARCH)
73+
check_cxx_compiler_flag(-mtune HAS_MTUNE)
74+
if (HAS_MARCH)
75+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
76+
endif ()
77+
if (HAS_MTUNE)
78+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=native")
79+
endif ()
80+
81+
# Debug settings
82+
check_cxx_compiler_flag(-ggdb HAS_GGDB)
83+
check_cxx_compiler_flag(-Z7 HAS_Z7)
84+
check_cxx_compiler_flag(-ftrapv HAS_FTRAPV)
85+
check_cxx_compiler_flag(-Od HAS_OD)
86+
if (HAS_GGDB)
87+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb")
88+
elseif (HAS_Z7)
89+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Z7")
90+
endif ()
91+
if (HAS_FTRAPV)
92+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ftrapv")
93+
endif ()
94+
if (HAS_OD)
95+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Od")
96+
endif ()
97+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
98+
99+
# Release settings
100+
check_cxx_compiler_flag(-Ob3 HAS_OB3)
101+
check_cxx_compiler_flag(-O3 HAS_O3)
102+
check_cxx_compiler_flag(-Ob2 HAS_OB2)
103+
check_cxx_compiler_flag(-O2 HAS_O2)
104+
if (HAS_OB3)
105+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ob3")
106+
elseif (HAS_O3)
107+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
108+
elseif (HAS_OB2)
109+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ob2")
110+
elseif (HAS_O2)
111+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
112+
endif ()
113+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
114+
115+
116+
# Definitions
117+
# =============================================================================
118+
if (USE_AZURE_KINECT)
119+
add_definitions( -DUSE_AZURE_KINECT=TRUE )
120+
endif ()
121+
if (USE_REALSENSE)
122+
add_definitions( -DUSE_REALSENSE=TRUE )
123+
endif ()
124+
if(OpenCV_CUDA_VERSION)
125+
add_definitions( -DUSE_CUDA=TRUE )
126+
endif ()
127+
if (USE_GTEST)
128+
add_definitions( -DUSE_GTEST=TRUE )
129+
endif ()
130+
131+
132+
# Directories
133+
# =============================================================================
134+
add_subdirectory(src)
135+
add_subdirectory(test)
136+
add_subdirectory(examples)
137+
add_subdirectory(doc)

M3T/data/_body/default_body.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
%YAML:1.2
2+
geometry_path: "INFER_FROM_NAME"
3+
geometry_unit_in_meter: 1.0
4+
geometry_counterclockwise: 1
5+
geometry_enable_culling: 1
6+
geometry2body_pose: !!opencv-matrix
7+
rows: 4
8+
cols: 4
9+
dt: d
10+
data: [ 1., 0, 0, 0,
11+
0, 1., 0, 0,
12+
0, 0, 1., -0.006,
13+
0, 0, 0, 1. ]
14+
body_id: 150
15+
region_id: 150

0 commit comments

Comments
 (0)