-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
386 lines (309 loc) · 8.17 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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
cmake_minimum_required(VERSION 3.5)
project(mrs_pcl_tools)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_definitions(-O3)
add_definitions(-DCOMPILE_WITH_OUSTER)
# add_definitions(-g)
# disables anoying googletest warning
set(CATKIN_ENABLE_TESTING FALSE)
# disables anoying PCL warnings
set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS 1 CACHE INTERNAL "No dev warnings")
set(CATKIN_DEPENDENCIES
cmake_modules
dynamic_reconfigure
eigen_conversions
geometry_msgs
message_generation
message_runtime
mrs_lib
mrs_msgs
mrs_modules_msgs
nodelet
ouster_ros
pcl_conversions
pcl_ros
rosconsole
roscpp
sensor_msgs
std_msgs
visualization_msgs
)
find_package(PCL REQUIRED COMPONENTS
common
)
# Include Eigen3
find_package(Eigen3 REQUIRED)
set(Eigen_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS})
set(Eigen_LIBRARIES ${Eigen_LIBRARIES})
find_package(catkin REQUIRED COMPONENTS
${CATKIN_DEPENDENCIES}
)
add_service_files(DIRECTORY srv/registration FILES
SrvRegisterPointCloudByName.srv
SrvRegisterPointCloudOffline.srv
)
generate_dynamic_reconfigure_options(
cfg/pcl_filtration_dynparam.cfg
cfg/pcl2map_registration_dynparam.cfg
)
generate_messages(DEPENDENCIES
std_msgs
sensor_msgs
geometry_msgs
visualization_msgs mrs_msgs
)
###################################
## catkin specific configuration ##
###################################
set(LIBRARIES
MrsPclTools_PCLSupportLib
MrsPclTools_PCLFiltration
MrsPclTools_PCL2MapRegistration
MrsPclTools_GroundplaneDetector
MrsPclTools_RemoveBelowGroundFilter
MrsPclTools_PCLPublishCloudFileToNetwork
)
set(EXECUTABLES
estimate_cloud_to_cloud_drift
estimate_lidar_slam_drift
pcd_estimate_normals
concatenate_lidar_scans
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${LIBRARIES}
CATKIN_DEPENDS ${CATKIN_DEPENDENCIES}
DEPENDS Eigen
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
include
${catkin_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${Eigen_INCLUDE_DIRS}
${dynamic_reconfigure_PACKAGE_PATH}/cmake/cfgbuild.cmake
)
## Add link directories
link_directories(
${PCL_LIBRARY_DIRS}
)
# This causes adds the -march=native gcc flag that prevents ditributed compilation
add_definitions(
${PCL_DEFINITIONS}
)
## | ------------------------ Libraries ----------------------- |
# PCLSupportLib
add_library(MrsPclTools_PCLSupportLib
src/support.cpp
)
add_dependencies(MrsPclTools_PCLSupportLib
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_gencfg
)
target_link_libraries(MrsPclTools_PCLSupportLib
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${Eigen_LIBRARIES}
)
# PCLFiltration
add_library(MrsPclTools_PCLFiltration
src/PCLFiltration.cpp
src/groundplane_detector.cpp
src/remove_below_ground_filter.cpp
)
add_dependencies(MrsPclTools_PCLFiltration
mrs_pcl_tools_gencfg
mrs_pcl_tools_generate_messages
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_gencfg
)
target_link_libraries(
MrsPclTools_PCLFiltration
MrsPclTools_PCLSupportLib
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${Eigen_LIBRARIES}
)
target_include_directories(MrsPclTools_PCLFiltration SYSTEM PRIVATE
${PCL_INCLUDE_DIRS}
)
# PCL2MapRegistration
add_library(MrsPclTools_PCL2MapRegistration
src/PCL2MapRegistration.cpp
)
add_dependencies(MrsPclTools_PCL2MapRegistration
mrs_pcl_tools_gencfg
mrs_pcl_tools_generate_messages
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_gencfg
)
target_link_libraries(MrsPclTools_PCL2MapRegistration
MrsPclTools_PCLSupportLib
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${Eigen_LIBRARIES}
)
target_include_directories(MrsPclTools_PCL2MapRegistration
SYSTEM PRIVATE ${PCL_INCLUDE_DIRS}
)
# PCLPublishCloudFileToNetwork
add_library(MrsPclTools_PCLPublishCloudFileToNetwork
src/PCLPublishCloudFileToNetwork.cpp
)
add_dependencies(MrsPclTools_PCLPublishCloudFileToNetwork
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_gencfg
)
target_link_libraries(
MrsPclTools_PCLPublishCloudFileToNetwork
MrsPclTools_PCLSupportLib
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${Eigen_LIBRARIES}
)
target_include_directories(MrsPclTools_PCLPublishCloudFileToNetwork SYSTEM PRIVATE
${PCL_INCLUDE_DIRS}
)
# GroundplaneDetector
add_library(MrsPclTools_GroundplaneDetector
src/groundplane_detector.cpp
)
add_dependencies(MrsPclTools_GroundplaneDetector
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_gencfg
)
target_link_libraries(
MrsPclTools_GroundplaneDetector
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${Eigen_LIBRARIES}
)
target_include_directories(MrsPclTools_GroundplaneDetector SYSTEM PRIVATE
${PCL_INCLUDE_DIRS}
)
# RemoveBelowGroundFilter
add_library(MrsPclTools_RemoveBelowGroundFilter
src/remove_below_ground_filter.cpp
)
add_dependencies(MrsPclTools_RemoveBelowGroundFilter
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_gencfg
)
target_link_libraries(
MrsPclTools_RemoveBelowGroundFilter
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${Eigen_LIBRARIES}
)
target_include_directories(MrsPclTools_RemoveBelowGroundFilter SYSTEM PRIVATE
${PCL_INCLUDE_DIRS}
)
## | ----------------------- Executables ---------------------- |
add_executable(estimate_cloud_to_cloud_drift
src/executables/EstimateCloudToCloudDrift.cpp
)
add_dependencies(estimate_cloud_to_cloud_drift
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_gencfg
)
target_link_libraries(estimate_cloud_to_cloud_drift
MrsPclTools_PCLSupportLib
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${Eigen_LIBRARIES}
)
# estimate_lidar_slam_drift
add_executable(estimate_lidar_slam_drift
src/executables/EstimateLidarSlamDrift.cpp
)
add_dependencies(estimate_lidar_slam_drift
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_gencfg
)
target_link_libraries(estimate_lidar_slam_drift
MrsPclTools_PCLSupportLib
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${Eigen_LIBRARIES}
)
# pcd_estimate_normals
add_executable(pcd_estimate_normals
src/executables/PcdEstimateNormals.cpp
)
add_dependencies(pcd_estimate_normals
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_gencfg
)
target_link_libraries(pcd_estimate_normals
MrsPclTools_PCLSupportLib
${catkin_LIBRARIES}
${PCL_LIBRARIES}
)
# concatenate_lidar_scans
add_executable(concatenate_lidar_scans
src/executables/ConcatenateLidarScans.cpp
)
add_dependencies(concatenate_lidar_scans
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_gencfg
)
target_link_libraries(concatenate_lidar_scans
MrsPclTools_PCLSupportLib
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${Eigen_LIBRARIES}
)
# FreespacePointcloudCreator
add_library(FreespacePointcloudCreator
src/freespace_pointcloud_creator.cpp
)
add_dependencies(FreespacePointcloudCreator
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_gencfg
)
target_link_libraries(FreespacePointcloudCreator
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${Eigen_LIBRARIES}
)
target_include_directories(FreespacePointcloudCreator
SYSTEM PRIVATE ${PCL_INCLUDE_DIRS}
)
## --------------------------------------------------------------
## | Build |
## --------------------------------------------------------------
install(TARGETS ${LIBRARIES}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)
install(DIRECTORY include/mrs_pcl_tools/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
install(TARGETS ${EXECUTABLES}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY launch rviz config
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(FILES nodelets.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)