forked from ctu-mrs/uvdar_core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
507 lines (400 loc) · 10.8 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
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
cmake_minimum_required(VERSION 3.5)
project(uvdar_core)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(-Wall)
add_definitions(-Wextra)
add_definitions(-fno-omit-frame-pointer)
# add_definitions(-O0)
if(NOT MRS_ENABLE_TESTING)
message(WARNING "relwithdebinfo profile detected, building with -O3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3")
endif()
if(COVERAGE)
message(WARNING "building with --coverage, the performance might be limited")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
endif()
set(CATKIN_DEPENDENCIES
cv_bridge
image_transport
message_generation
message_runtime
mrs_lib
mrs_modules_msgs
mrs_msgs
nodelet
roscpp
sensor_msgs
std_msgs
)
set(LIBRARIES
UvdarCore_OCamCalib
UvdarCore_ht4dbt
UvdarCore_ami
UvdarCore_extendedSearch
UvdarCore_uv_led_detect_fast
UvdarCore_uv_led_detect_adaptive
UvdarCore_frequency_classifier
UvdarCore_color_selector
UvdarCore_UVDARDetector
UvdarCore_unscented
UvdarCore_UVDARBlinkProcessor
UvdarCore_UVDARBluefoxEmulator
UvdarCore_compute_lib
)
set(EXECUTABLES
uvdar_rx_node
uvdar_tx_node
new_uvdar_rx_node
uvdar_led_manager_node
uvdar_filter_node
uvdar_pose_calculator_node
)
find_package(catkin REQUIRED COMPONENTS
${CATKIN_DEPENDENCIES}
)
find_package(Eigen3 REQUIRED)
set(Eigen_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS})
set(Eigen_LIBRARIES ${Eigen_LIBRARIES})
find_package(OpenCV REQUIRED HINTS /usr/local/lib)
set(OpenGL_GL_PREFERENCE "LEGACY")
find_package(OpenGL REQUIRED)
# find_package(LIBGBM REQUIRED)
# # pkg_check_modules(PC_LIBGBM gbm)
# find_path(LIBGBM_INCLUDE_DIRS
# NAMES gbm.h
# HINTS ${PC_LIBGBM_INCLUDE_DIRS} ${PC_LIBGBM_INCUDEDIR}
# )
find_library(LGBM libgbm.so REQUIRED)
find_library(LEGL libEGL.so REQUIRED)
find_library(LGL libGL.so REQUIRED)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGBM DEFAULT_MSG LIBGBM_LIBRARIES)
mark_as_advanced(LIBGBM_INCLUDE_DIRS LIBGBM_LIBRARIES)
add_service_files(
FILES
SetLedMessage.srv
SetInts.srv
# SetIntIndex.srv
# SetLedState.srv
)
add_message_files(DIRECTORY msg FILES
FrequencySet.msg
USM.msg
RecMsg.msg
DefaultMsg.msg
AMIDataForLogging.msg
AMISeqVariables.msg
AMIAllSequences.msg
AMISeqPoint.msg
ImagePointsWithFloatStamped.msg
Point2DWithFloat.msg
Int32MultiArrayStamped.msg
AdaptiveDataForLogging.msg
ROIAdaptiveData.msg
)
generate_messages(DEPENDENCIES
mrs_msgs
std_msgs
sensor_msgs
# uvdar_gazebo_plugin
)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS ${CATKIN_DEPENDENCIES}
LIBRARIES ${LIBRARIES}
DEPENDS Eigen
)
include_directories(
include
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${OpenGL_INCLUDE_DIRS}
${LIBGBM_INCLUDE_DIRS}
)
## | ---------------------- uvdar rx node --------------------- |
add_executable(uvdar_rx_node
src/uvdar_rx.cpp
)
target_link_libraries(uvdar_rx_node
${catkin_LIBRARIES}
)
add_dependencies(uvdar_rx_node
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
## | ---------------------- uvdar tx node --------------------- |
add_executable(uvdar_tx_node
src/uvdar_tx.cpp
)
target_link_libraries(uvdar_tx_node
${catkin_LIBRARIES}
)
add_dependencies(uvdar_tx_node
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
## | -------------------- new uvdar rx node ------------------- |
add_executable(new_uvdar_rx_node
src/new_uvdar_rx.cpp
)
target_link_libraries(new_uvdar_rx_node
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
UvdarCore_ht4dbt
)
add_dependencies(new_uvdar_rx_node
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
## | ------------------------ OCamCalib ----------------------- |
add_library(UvdarCore_OCamCalib
include/OCamCalib/ocam_functions.cpp
)
target_link_libraries(UvdarCore_OCamCalib
${catkin_LIBRARIES}
)
add_dependencies(UvdarCore_OCamCalib
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_compile_options(UvdarCore_OCamCalib PRIVATE
-Wno-unused-variable
-Wno-unused-result
)
## | ------------------------- UvdarCore_ht4dbt ------------------------- |
add_library(UvdarCore_ht4dbt
include/ht4dbt/ht4d.cpp
include/ht4dbt/ht4d_cpu.cpp
include/ht4dbt/ht4d_cpu.cpp
)
add_dependencies(UvdarCore_ht4dbt
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(UvdarCore_ht4dbt
${catkin_LIBRARIES}
UvdarCore_compute_lib
)
## | -------------------------- UvdarCore_ami -------------------------- |
add_library(UvdarCore_ami
include/ami/ami.cpp
)
add_dependencies(UvdarCore_ami
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(UvdarCore_ami
${catkin_LIBRARIES}
)
## | --------------------- extended Search -------------------- |
add_library(UvdarCore_extendedSearch
include/ami/ami_extended_search.cpp
)
add_dependencies(UvdarCore_extendedSearch
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(UvdarCore_extendedSearch
${catkin_LIBRARIES}
)
## | ------------------- uv led detect fast ------------------- |
add_library(UvdarCore_uv_led_detect_fast
include/detect/uv_led_detect_fast_cpu.cpp
include/detect/uv_led_detect_fast_gpu.cpp
)
add_dependencies(UvdarCore_uv_led_detect_fast
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(UvdarCore_uv_led_detect_fast
debug
${OpenCV_LIBRARIES}
${catkin_LIBRARIES}
UvdarCore_compute_lib
)
## | ------------------ uv led detect adaptive ------------------ |
add_library(UvdarCore_uv_led_detect_adaptive
include/detect/uv_led_detect_adaptive.cpp
)
add_dependencies(UvdarCore_uv_led_detect_adaptive
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(UvdarCore_uv_led_detect_adaptive
debug
${OpenCV_LIBRARIES}
${catkin_LIBRARIES}
)
## | ------------------ frequency classifier ------------------ |
add_library(UvdarCore_frequency_classifier
include/frequency_classifier/frequency_classifier.cpp
)
add_dependencies(UvdarCore_frequency_classifier
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(UvdarCore_frequency_classifier
debug
${OpenCV_LIBRARIES}
${catkin_LIBRARIES}
)
## | --------------------- color selector --------------------- |
add_library(UvdarCore_color_selector
include/color_selector/color_selector.cpp
)
add_dependencies(UvdarCore_color_selector
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(UvdarCore_color_selector
debug
${OpenCV_LIBRARIES}
${catkin_LIBRARIES}
)
## | --------------------- compute lib --------------------- |
add_library(UvdarCore_compute_lib
include/compute_lib/compute_lib.c
include/compute_lib/queue.c
include/compute_lib/gl32_utils.c
)
add_dependencies(UvdarCore_compute_lib
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(UvdarCore_compute_lib
debug
${OpenGL_LIBRARIES}
${LIBGBM_LIBRARIES}
${catkin_LIBRARIES}
${LGBM}
${LEGL}
${LGL}
)
## | --------------------- uvdar detector --------------------- |
add_library(UvdarCore_UVDARDetector
src/detector.cpp
)
add_dependencies(UvdarCore_UVDARDetector
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(UvdarCore_UVDARDetector
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
UvdarCore_uv_led_detect_fast
UvdarCore_uv_led_detect_adaptive
)
## | ------------------------ UvdarCore_unscented ----------------------- |
add_library(UvdarCore_unscented
include/unscented/unscented.cpp
)
add_dependencies(UvdarCore_unscented
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(UvdarCore_unscented
${catkin_LIBRARIES}
)
## | ------------------ uvdar blnk processor ------------------ |
add_library(UvdarCore_UVDARBlinkProcessor
src/blink_processor.cpp
)
add_dependencies(UvdarCore_UVDARBlinkProcessor
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(UvdarCore_UVDARBlinkProcessor
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
UvdarCore_ht4dbt
UvdarCore_frequency_classifier
UvdarCore_ami
UvdarCore_extendedSearch
UvdarCore_color_selector
)
## | --------------- uvdar pose calculator node --------------- |
add_executable(uvdar_pose_calculator_node
src/pose_calculator.cpp
)
add_dependencies(uvdar_pose_calculator_node
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(uvdar_pose_calculator_node
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
${EIGEN3_LIBRARIES}
UvdarCore_OCamCalib
UvdarCore_unscented
UvdarCore_color_selector
UvdarCore_frequency_classifier
)
## | -------------------- uvdar filter node ------------------- |
add_executable(uvdar_filter_node
src/filter.cpp
)
add_dependencies(uvdar_filter_node
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(uvdar_filter_node
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
${EIGEN3_LIBRARIES}
)
## | ----------------- uvdar bluefox emulator ----------------- |
add_library(UvdarCore_UVDARBluefoxEmulator
src/bluefox_emulator.cpp
)
add_dependencies(UvdarCore_UVDARBluefoxEmulator
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(UvdarCore_UVDARBluefoxEmulator
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
${EIGEN3_LIBRARIES}
UvdarCore_OCamCalib
)
## | ----------------- uvdar led manager node ----------------- |
add_executable(uvdar_led_manager_node
src/led_manager.cpp
)
add_dependencies(uvdar_led_manager_node
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(uvdar_led_manager_node
${catkin_LIBRARIES}
)
## --------------------------------------------------------------
## | Install |
## --------------------------------------------------------------
install(TARGETS ${LIBRARIES}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)
install(TARGETS ${EXECUTABLES}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY msg srv
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY launch config rviz
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY scripts/
USE_SOURCE_PERMISSIONS
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY scripts
USE_SOURCE_PERMISSIONS
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(FILES nodelets.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)