Skip to content

Commit 67cfc40

Browse files
committed
Merge branch 'main' into distance_calculation_visualisation
2 parents 478ebf2 + 03924e4 commit 67cfc40

File tree

73 files changed

+3502
-610
lines changed

Some content is hidden

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

73 files changed

+3502
-610
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,7 @@ cython_debug/
243243
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
244244
# and can be added to the global gitignore or merged into this file. For a more nuclear
245245
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
246-
#.idea/
246+
#.idea/
247+
248+
# egg-info
249+
*.egg-info/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@
1717
[submodule "deps/pybind11"]
1818
path = deps/pybind11
1919
url = https://github.com/pybind/pybind11.git
20+
[submodule "deps/submodule-cilantro"]
21+
path = deps/submodule-cilantro
22+
url = https://github.com/diffCheckOrg/submodule-cilantro.git

CMakeLists.txt

Lines changed: 33 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
77
include(external_tools)
88
include(options)
99

10+
# check that the -DCMAKE_BUILD_TYPE is set
11+
if(NOT CMAKE_BUILD_TYPE)
12+
message(STATUS "Setting build type to 'Release' as none was specified.")
13+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
14+
endif()
15+
1016
# do a submodule init if not done already
1117
execute_process(COMMAND git submodule update --init --recursive
1218
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
@@ -48,7 +54,7 @@ target_include_directories(${SHARED_LIB_NAME}
4854
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
4955
)
5056

51-
#set the MD_DynamicRelease flag for MSVC since we are compiling with /MD for py wrap
57+
#set the MD_DynamicRelease flag for MSVC since we are compiling with /MD for py wrap
5258
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
5359

5460

@@ -78,7 +84,7 @@ target_link_libraries(${SHARED_LIB_NAME} PUBLIC Open3D::Open3D)
7884
if(WIN32)
7985
get_target_property(open3d_type Open3D::Open3D TYPE)
8086
if(open3d_type STREQUAL "SHARED_LIBRARY")
81-
message(STATUS "Copying Open3D.dll to ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
87+
message(STATUS "Copying Open3D.dll to ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
8288
add_custom_command(TARGET ${SHARED_LIB_NAME} POST_BUILD
8389
COMMAND ${CMAKE_COMMAND} -E copy
8490
$<TARGET_FILE:Open3D::Open3D>
@@ -88,11 +94,15 @@ endif()
8894

8995
# Boost (header only) -----------------------------------------------------
9096
download_submodule_project(boost)
91-
target_link_directories(${SHARED_LIB_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/deps/boost/win/1_89/include/boost-1_85)
97+
target_include_directories(${SHARED_LIB_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/deps/boost/win/1_89/include/boost-1_85)
9298

9399
# CGAL (header-only) ------------------------------------------------------
94100
target_include_directories(${SHARED_LIB_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/deps/cgal/include)
95101

102+
# Cilantro (header-only) --------------------------------------------------
103+
download_submodule_project(cilantro)
104+
target_include_directories(${SHARED_LIB_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/deps/submodule-cilantro/include)
105+
96106
# loguru (header-only) ----------------------------------------------------
97107
download_submodule_project(loguru)
98108
add_subdirectory(deps/loguru)
@@ -146,55 +156,30 @@ if (BUILD_PYTHON_MODULE)
146156
$<TARGET_FILE:${PYBINDMODULE_NAME}>
147157
${PYPI_DIR}
148158
)
149-
150-
# get all the files -dlls in the bin directory and copy them one by one to the pypi directory
151-
message(STATUS "Copying dlls to ${TARGET_DLL_PYPI_DIR}")
152-
file(GLOB files ${CMAKE_BINARY_DIR}/bin/Release/*.dll)
153-
foreach(file ${files})
154-
message(STATUS "Copying ${file} to ${TARGET_DLL_PYPI_DIR}")
155-
add_custom_command(TARGET ${PYBINDMODULE_NAME} POST_BUILD
156-
COMMAND ${CMAKE_COMMAND} -E copy
157-
${file}
158-
${TARGET_DLL_PYPI_DIR}
159-
)
160-
endforeach()
159+
copy_dlls(${TARGET_DLL_PYPI_DIR} ${PYBINDMODULE_NAME})
161160

162161
endif()
163162

164163
#--------------------------------------------------------------------------
165164
# Tests
166165
#--------------------------------------------------------------------------
166+
include(CTest)
167+
enable_testing()
168+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/googletest)
169+
set(TESTS_OUT_DIR ${CMAKE_BINARY_DIR}/df_tests/)
170+
set(TEST_OUT_DIR_BINARY ${TESTS_OUT_DIR}/${CMAKE_BUILD_TYPE})
171+
172+
# add new test suites .cc here
173+
set(UNIT_TESTS df_test_suites)
174+
add_executable(${UNIT_TESTS}
175+
tests/unit_tests/DFPointCloudTest.cc
176+
tests/entryTest.cc
177+
)
178+
set_target_properties(${UNIT_TESTS} PROPERTIES
179+
RUNTIME_OUTPUT_DIRECTORY ${TESTS_OUT_DIR}
180+
)
181+
target_link_libraries(${UNIT_TESTS} gtest gtest_main)
182+
target_link_libraries(${UNIT_TESTS} ${SHARED_LIB_NAME})
167183

168-
# include(CTest)
169-
# enable_testing()
170-
# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/googletest)
171-
# set(TESTS_OUT_DIR ${CMAKE_BINARY_DIR}/tests/)
172-
173-
174-
# # Unit testing ------------------------------------------------------------
175-
# set(UNIT_TESTS unit_tests)
176-
# add_executable(${UNIT_TESTS} tests/unit_tests/DFPointCloudTest.cc)
177-
# set_target_properties(${UNIT_TESTS} PROPERTIES
178-
# RUNTIME_OUTPUT_DIRECTORY ${TESTS_OUT_DIR}
179-
# )
180-
181-
# target_link_libraries(${UNIT_TESTS} gtest gtest_main)
182-
# target_link_libraries(${UNIT_TESTS} ${SHARED_LIB_NAME})
183-
184-
# add_test(NAME ${UNIT_TESTS} COMMAND ${UNIT_TESTS})
185-
186-
# Integration testing -----------------------------------------------------
187-
# Component testing -------------------------------------------------------
188-
# etc ---------------------------------------------------------------------
189-
190-
# # TODO: a better way to copy the dlls to the tests directory for the tests
191-
# # get all the files -dlls in the bin directory and copy them one by one to tests dir
192-
# file(GLOB files ${CMAKE_BINARY_DIR}/bin/Release/*.dll)
193-
# foreach(file ${files})
194-
# message(STATUS "Copying ${file} to ${TESTS_OUT_DIR}")
195-
# add_custom_command(TARGET ${UNIT_TESTS} POST_BUILD
196-
# COMMAND ${CMAKE_COMMAND} -E copy
197-
# ${file}
198-
# ${TESTS_OUT_DIR}/Release
199-
# )
200-
# endforeach()
184+
add_test(NAME ${UNIT_TESTS} COMMAND ${UNIT_TESTS})
185+
copy_dlls(${TEST_OUT_DIR_BINARY} ${UNIT_TESTS})

CONTRIBUTING.md

Lines changed: 7 additions & 35 deletions

README.md

Lines changed: 6 additions & 20 deletions
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"class_name" : "PinholeCameraParameters",
3+
"extrinsic" :
4+
[
5+
0.78518600604290978,
6+
-0.4688467948733368,
7+
0.4045560762754441,
8+
0.0,
9+
-0.61432912235314374,
10+
-0.67201447960085037,
11+
0.41351695084435719,
12+
0.0,
13+
0.077991444038432445,
14+
-0.57321830234544802,
15+
-0.81568260525341763,
16+
0.0,
17+
1416.8243739322577,
18+
908.62300697364822,
19+
1063.1264987715035,
20+
1.0
21+
],
22+
"intrinsic" :
23+
{
24+
"height" : 800,
25+
"intrinsic_matrix" :
26+
[
27+
692.82032302755101,
28+
0.0,
29+
0.0,
30+
0.0,
31+
692.82032302755101,
32+
0.0,
33+
499.5,
34+
399.5,
35+
1.0
36+
],
37+
"width" : 1000
38+
},
39+
"version_major" : 1,
40+
"version_minor" : 0
41+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"class_name" : "PinholeCameraParameters",
3+
"extrinsic" :
4+
[
5+
0.76239913059926834,
6+
-0.422274821893041,
7+
0.49033818988192268,
8+
0.0,
9+
-0.54132130094127906,
10+
-0.00099240450767756894,
11+
0.8408152378974435,
12+
0.0,
13+
-0.35456849099817256,
14+
-0.90646731321570218,
15+
-0.22934296427574399,
16+
0.0,
17+
1550.6223360557265,
18+
197.24908733414611,
19+
336.92784140962624,
20+
1.0
21+
],
22+
"intrinsic" :
23+
{
24+
"height" : 800,
25+
"intrinsic_matrix" :
26+
[
27+
692.82032302755101,
28+
0.0,
29+
0.0,
30+
0.0,
31+
692.82032302755101,
32+
0.0,
33+
499.5,
34+
399.5,
35+
1.0
36+
],
37+
"width" : 1000
38+
},
39+
"version_major" : 1,
40+
"version_minor" : 0
41+
}
87.4 KB
40.4 KB

0 commit comments

Comments
 (0)