Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only module branch #9

Open
wants to merge 18 commits into
base: module
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 1 addition & 48 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,48 +1 @@
.codes/*
.cmake/*

build/*

cmake-build-release/*
cmake-build-debug/*

materials/*.bin
materials/*.pcd
*bin
*pcd

.idea/
.vscode/

# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
.vscode/
26 changes: 0 additions & 26 deletions 3rdparty/find_dependencies.cmake

This file was deleted.

18 changes: 0 additions & 18 deletions 3rdparty/pmc/LICENSE

This file was deleted.

44 changes: 0 additions & 44 deletions 3rdparty/pmc/pmc.cmake

This file was deleted.

145 changes: 70 additions & 75 deletions CMakeLists.txt
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,82 +1,77 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.10)
project(quatro)

set(CMAKE_CXX_STANDARD 17)

if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif ()

find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
geometry_msgs
message_generation
sensor_msgs
nav_msgs
pcl_ros
cv_bridge
)

find_package(OpenCV REQUIRED)
find_package(OpenCV REQUIRED QUIET)
find_package(OpenMP)
find_package(PCL 1.8 REQUIRED)
find_package(Boost 1.54 REQUIRED)
find_package(Eigen3 3.2 QUIET REQUIRED NO_MODULE)
find_package(catkin QUIET)

add_message_files(
FILES
cloud_info.msg
)

generate_messages(
DEPENDENCIES
geometry_msgs
std_msgs
nav_msgs
)

catkin_package(
INCLUDE_DIRS
LIBRARIES
CATKIN_DEPENDS roscpp rospy std_msgs
### set compiler
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++17 -fexceptions -g -ggdb")
include(FindOpenMP) #The best way to set proper compiler settings for using OpenMP in all platforms
if(OPENMP_FOUND) #The best way to set proper compiler settings for using OpenMP in all platforms
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
else(OPENMP_FOUND)
message("ERROR: OpenMP could not be found.")
endif(OPENMP_FOUND)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall ${CMAKE_CXX_FLAGS}")

### get packages
find_package(Eigen3 REQUIRED)
find_package(PCL REQUIRED)
find_package(teaserpp REQUIRED)
if(PCL_FOUND)
message(WARNING "PCL_VER: ${PCL_VERSION}, and PCL_DIR: ${PCL_INCLUDE_DIRS}")
endif()
if(Eigen3_FOUND)
message(WARNING "EIGEN_VER: ${EIGEN3_VERSION_STRING}, and Eigen DIR: ${EIGEN3_INCLUDE_DIR}")
endif()
if(teaserpp_FOUND)
message(WARNING "teaserpp found")
endif()

#### for tbb
option(QUATRO_TBB "Enable TBB support" ON)
if(QUATRO_TBB)
message(WARNING "Quatro with TBB")
list(APPEND CMAKE_MODULE_PATH /usr/local/include /usr/include)
find_library(TBB_LIBRARY tbb HINTS /usr/lib /usr/local/lib)
message(WARNING "TBB FOUND, ${TBB_LIBRARY}")
add_definitions(-DTBB_EN)
include(ProcessorCount)
ProcessorCount(N)
message(WARNING "Processer number: ${N}")
if(N GREATER 4)
add_definitions(-DTBB_PROC_NUM=${N})
else()
add_definitions(-DTBB_PROC_NUM=1)
endif()
endif()

#### for debug output
if(QUATRO_DEBUG)
add_definitions(-DQUATRO_DEBUG)
endif()

### output as catkin package
find_package(catkin REQUIRED)
catkin_package( #this automatically adds/installs the results of build
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
)

### get packages' headers
include_directories(
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
include
include
${EIGEN3_INCLUDE_DIR}
${PCL_INCLUDE_DIRS}
)

include(3rdparty/find_dependencies.cmake)

file(DOWNLOAD https://urserver.kaist.ac.kr/publicdata/quatro/000540.bin ${CMAKE_CURRENT_LIST_DIR}/materials/000540.bin)
file(DOWNLOAD https://urserver.kaist.ac.kr/publicdata/quatro/001319.bin ${CMAKE_CURRENT_LIST_DIR}/materials/001319.bin)

if (OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif ()



####### Executable #######
set(teaser_src
src/graph.cc
src/teaser_utils/feature_matcher.cc
src/teaser_utils/fpfh.cc
)

add_executable(run_example examples/run_global_registration.cpp ${teaser_src})

target_link_libraries(run_example
PUBLIC
${PCL_LIBRARY_DIRS}
${catkin_LIBRARIES}
stdc++fs
pmc::pmc
)
###########
## Build ##
###########
### main
add_library(${PROJECT_NAME} src/fpfh.cc src/matcher.cc src/quatro_module.cc)
if (QUATRO_TBB)
target_link_libraries(${PROJECT_NAME} ${OpenMP_LIBS} ${EIGEN3_LIBS} ${PCL_LIBRARIES} teaserpp::teaser_registration teaserpp::teaser_io ${TBB_LIBRARY})
else()
target_link_libraries(${PROJECT_NAME} ${OpenMP_LIBS} ${EIGEN3_LIBS} ${PCL_LIBRARIES} teaserpp::teaser_registration teaserpp::teaser_io)
endif()
Loading