-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
215 lines (193 loc) · 6.64 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
cmake_minimum_required(VERSION 3.5)
project(co_lrio)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release)
endif()
# Find dependencies
find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclpy REQUIRED)
find_package(std_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(pcl_msgs REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_sensor_msgs REQUIRED)
find_package(tf2_eigen REQUIRED)
find_package(libstatistics_collector REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(OpenCV REQUIRED)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
find_package(PCL REQUIRED)
find_package(GTSAM REQUIRED)
find_package(Eigen REQUIRED)
# Include directories
include_directories(
include
include/third_parties
${EIGEN_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
# Defined message and service
set(msg_files
msg/OptimizationRequest.msg
msg/LoopClosure.msg
msg/OptimizationResponse.msg
srv/SaveFiles.srv
)
rosidl_generate_interfaces(${PROJECT_NAME}
${msg_files}
DEPENDENCIES std_msgs nav_msgs sensor_msgs geometry_msgs
)
# Maximum Clique Solver
add_library(fast_max_clique_finder
include/third_parties/fast_max-clique_finder/src/findClique.h
include/third_parties/fast_max-clique_finder/src/graphIO.h
include/third_parties/fast_max-clique_finder/src/findClique.cpp
include/third_parties/fast_max-clique_finder/src/findCliqueHeu.cpp
include/third_parties/fast_max-clique_finder/src/utils.cpp
include/third_parties/fast_max-clique_finder/src/graphIO.cpp
)
install(
TARGETS fast_max_clique_finder
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
# nabo library
add_library(nabo_lib
include/third_parties/nabo/nabo.h
include/third_parties/nabo/nabo.cpp
include/third_parties/nabo/nabo_private.h
include/third_parties/nabo/index_heap.h
include/third_parties/nabo/kdtree_opencl.cpp
include/third_parties/nabo/brute_force_cpu.cpp
include/third_parties/nabo/kdtree_cpu.cpp
)
install(
TARGETS nabo_lib
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
# geo graphic library
add_library(geographic_lib
include/third_parties/geo_graphic/Config.h
include/third_parties/geo_graphic/Constants.hpp
include/third_parties/geo_graphic/Geocentric.cpp
include/third_parties/geo_graphic/Geocentric.hpp
include/third_parties/geo_graphic/LocalCartesian.cpp
include/third_parties/geo_graphic/LocalCartesian.hpp
include/third_parties/geo_graphic/Math.cpp
include/third_parties/geo_graphic/Math.hpp
)
install(
TARGETS geographic_lib
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
# risam library
add_library(risam_lib
include/third_parties/risam/DoglegLineSearch.h
include/third_parties/risam/GraduatedFactor.cpp
include/third_parties/risam/GraduatedFactor.h
include/third_parties/risam/GraduatedKernel.cpp
include/third_parties/risam/GraduatedKernel.h
include/third_parties/risam/RISAM2.cpp
include/third_parties/risam/RISAM2.h
)
target_link_libraries(risam_lib PRIVATE gtsam)
install(
TARGETS risam_lib
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
# gicp library
add_library(gicp_lib
include/third_parties/nabo/nabo.h
include/third_parties/nabo/nabo.cpp
include/third_parties/nabo/nabo_private.h
include/third_parties/nabo/index_heap.h
include/third_parties/nabo/kdtree_opencl.cpp
include/third_parties/nabo/brute_force_cpu.cpp
include/third_parties/nabo/kdtree_cpu.cpp
include/third_parties/flann/flann.cpp
include/third_parties/flann/flann.h
include/third_parties/ikd_tree/ikd_Tree.h
include/third_parties/ikd_tree/ikd_Tree.cpp
include/third_parties/gicp/so3/so3.hpp
include/third_parties/gicp/impl/fast_gicp_impl.hpp
include/third_parties/gicp/impl/fast_vgicp_impl.hpp
include/third_parties/gicp/impl/lsq_registration_impl.hpp
include/third_parties/gicp/gicp_settings.hpp
include/third_parties/gicp/fast_vgicp_voxel.hpp
include/third_parties/gicp/fast_gicp.hpp
include/third_parties/gicp/fast_gicp.cpp
include/third_parties/gicp/fast_vgicp.hpp
include/third_parties/gicp/fast_vgicp.cpp
include/third_parties/gicp/lsq_registration.hpp
include/third_parties/gicp/lsq_registration.cpp
)
install(
TARGETS gicp_lib
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
# Lidar odometry
add_executable(${PROJECT_NAME}_lidar_odometry src/scanContextDescriptor.cpp src/lidarIrisDescriptor.cpp src/lidarOdometry.cpp)
ament_target_dependencies(${PROJECT_NAME}_lidar_odometry
rclcpp rclpy
std_msgs nav_msgs sensor_msgs geometry_msgs visualization_msgs pcl_msgs
tf2 tf2_ros tf2_geometry_msgs tf2_eigen tf2_sensor_msgs
OpenCV PCL GTSAM Eigen)
target_link_libraries(${PROJECT_NAME}_lidar_odometry gtsam gtsam_unstable gicp_lib geographic_lib)
rosidl_target_interfaces(${PROJECT_NAME}_lidar_odometry ${PROJECT_NAME} "rosidl_typesupport_cpp")
# Concentrated mapping
add_executable(${PROJECT_NAME}_concentrated_mapping src/scanContextDescriptor.cpp src/lidarIrisDescriptor.cpp src/concentratedMapping.cpp)
ament_target_dependencies(${PROJECT_NAME}_concentrated_mapping
rclcpp rclpy
std_msgs nav_msgs sensor_msgs geometry_msgs visualization_msgs pcl_msgs
tf2 tf2_ros tf2_geometry_msgs tf2_eigen tf2_sensor_msgs
OpenCV PCL GTSAM Eigen)
target_link_libraries(${PROJECT_NAME}_concentrated_mapping gtsam risam_lib fast_max_clique_finder nabo_lib gicp_lib geographic_lib)
rosidl_target_interfaces(${PROJECT_NAME}_concentrated_mapping ${PROJECT_NAME} "rosidl_typesupport_cpp")
install(
DIRECTORY launch config
DESTINATION share/${PROJECT_NAME}/
)
install(
TARGETS ${PROJECT_NAME}_lidar_odometry
DESTINATION lib/${PROJECT_NAME}
)
install(
TARGETS ${PROJECT_NAME}_concentrated_mapping
DESTINATION lib/${PROJECT_NAME}
)
install(
DIRECTORY "include/"
DESTINATION include
)
ament_export_include_directories(include)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# uncomment the line when a copyright and license is not present in all source files
#set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# uncomment the line when this package is not in a git repo
#set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()