forked from neemoh/ATAR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
353 lines (294 loc) · 10.2 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
cmake_minimum_required(VERSION 2.8.3)
project(atar)
#set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_STANDARD 14)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
sensor_msgs
tf_conversions
cv_bridge
image_transport
# message_generation
geometry_msgs
custom_msgs
custom_conversions
active_constraints)
#find_package(OpenCV 3 REQUIRED)
#add_service_files(
# FILES
# CalculateStereoCamsTransfromFromTopics.srv)
#add_message_files(
# FILES
# TaskState.msg
#)
#generate_messages(
# DEPENDENCIES
# geometry_msgs
#)
catkin_package(CATKIN_DEPENDS
message_runtime
cv_bridge
image_transport
sensor_msgs
custom_conversions)
find_package(OpenCV REQUIRED)
find_package(Boost REQUIRED)
find_package(Bullet REQUIRED)
include_directories(
include/
${catkin_INCLUDE_DIRS}
${BULLET_INCLUDE_DIR})
SUBDIRS( src/ar_core/LoadObjGL/VHACD)
##########################################################################
# Build Client and Service Nodes
##########################################################################
# %Tag(SRVCLIENT)%
#add_executable(calculate_stereo_cams_transform_from_topics
# src/utils/CalculateStereoCamsTransfromFromTopicsServer.cpp
# )
#target_link_libraries(calculate_stereo_cams_transform_from_topics
# ${catkin_LIBRARIES}
# )
#add_dependencies(calculate_stereo_cams_transform_from_topics
# teleop_vision_gencpp
# )
#
#add_executable(intrinsic_calib
# src/deprecated/intrinsic_calibration.cpp
# )
##########################################################################
# Build Calibration nodes
##########################################################################
add_executable(extrinsic_calib_charuco
src/extrinsic_calib_aruco/main_extrinsic_charuco.cpp
src/ar_core/IntrinsicCalibrationCharuco.cpp
src/ar_core/IntrinsicCalibrationCharuco.h)
target_link_libraries(extrinsic_calib_charuco
${catkin_LIBRARIES})
add_executable(create_aruco_board
src/utils/create_aruco_board.cpp)
add_executable(create_charuco_board
src/utils/create_charuco_board.cpp)
set(aruco_executables create_aruco_board create_charuco_board)
foreach (_ex ${aruco_executables})
target_link_libraries(
${_ex}
${OpenCV_LIBRARIES}
)
endforeach ()
add_executable(arm_to_world_calibration
src/arm_to_world_calibration/main_arm_to_world.cpp
src/arm_to_world_calibration/ArmToWorldCalibration.cpp
src/arm_to_world_calibration/ArmToWorldCalibration.h)
target_link_libraries(arm_to_world_calibration
${catkin_LIBRARIES}
${OpenCV_LIBRARIES})
add_library(ExtrinsicCalibArucoNodelet
src/extrinsic_calib_aruco/ExtrinsicArucoNodelet.cpp
src/extrinsic_calib_aruco/BoardDetector.cpp)
target_link_libraries(ExtrinsicCalibArucoNodelet
${catkin_LIBRARIES})
##########################################################################
# Build Common Nodes
##########################################################################
add_executable(
stereo_image_view
src/stereo_image_view/main_stereo_image_view.cpp)
add_executable(
stereo_image_split
src/stereo_image_view/main_stereo_image_split_TEMPORARY.cpp)
add_executable(stereo_usb_cam_publisher
src/stereo_usb_cam_publisher/main_stereo_usb_cam_publisher.cpp)
add_executable(
teleop_dummy_dvrk
src/teleop_dummy/main_teleop_dummy_dvrk.cpp)
add_executable(
teleop_dummy_sigma
src/teleop_dummy/main_teleop_dummy_sigma.cpp)
set(executables
stereo_image_view
stereo_image_split
stereo_usb_cam_publisher
teleop_dummy_dvrk
teleop_dummy_sigma
)
foreach (_ex ${executables})
target_link_libraries(
${_ex}
${OpenCV_LIBRARIES}
${catkin_LIBRARIES})
endforeach ()
##########################################################################
# AR CORE
##########################################################################
if(POLICY CMP0025)
cmake_policy(SET CMP0025 NEW) # CMake 3.0
endif()
if(POLICY CMP0053)
cmake_policy(SET CMP0053 NEW) # CMake 3.1
endif()
SET(GCC_COVERAGE_COMPILE_FLAGS "-fopenmp")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" )
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkCommonDataModel
vtkFiltersCore
vtkFiltersModeling
vtkFiltersTexture
vtkIOXML
vtkInteractionStyle
vtkRendering${VTK_RENDERING_BACKEND}
vtkImagingGeneral
vtkInteractionWidgets
vtkIOGeometry)
include(${VTK_USE_FILE})
add_library(LoadObjGL
src/ar_core/LoadObjGL/LoadMeshFromObj.h
src/ar_core/LoadObjGL/LoadMeshFromObj.cpp
src/ar_core/LoadObjGL/Wavefront2GLInstanceGraphicsShape.cpp
src/ar_core/LoadObjGL/Wavefront2GLInstanceGraphicsShape.cpp
src/ar_core/LoadObjGL/tiny_obj_loader.cpp
src/ar_core/LoadObjGL/tiny_obj_loader.cpp
src/ar_core/LoadObjGL/GLInstanceGraphicsShape.h
src/ar_core/LoadObjGL/VHACDGen.cpp
src/ar_core/LoadObjGL/VHACDGen.h)
target_link_libraries(
LoadObjGL
VHACD_local
BulletDynamics
BulletCollision
LinearMath
Bullet3Common)
# Assume all files that start with "Task" are to be added
file(GLOB tasks_src "src/ar_core/tasks/Task*.cpp")
file(GLOB tasks_h "src/ar_core/tasks/Task*.h")
add_executable(
ar_core
src/ar_core/main_ar.cpp
src/ar_core/RenderingCamera.cpp
src/ar_core/RenderingCamera.h
src/ar_core/Rendering.cpp
src/ar_core/Rendering.h
src/ar_core/TaskHandler.cpp
src/ar_core/TaskHandler.h
src/arm_to_world_calibration/ArmToWorldCalibration.cpp
src/arm_to_world_calibration/ArmToWorldCalibration.h
src/ar_core/ControlEvents.h
src/ar_core/BulletVTKMotionState.h
src/ar_core/SimObject.cpp
src/ar_core/SimObject.h
src/ar_core/SimTask.cpp
src/ar_core/SimTask.h
${tasks_src}
${tasks_h}
src/ar_core/SimSoftObject.cpp
src/ar_core/SimSoftObject.h
src/ar_core/SimFiveLinkGripper.cpp
src/ar_core/SimFiveLinkGripper.h
src/ar_core/SimMechanism.h
src/ar_core/SimForceps.cpp
src/ar_core/SimForceps.h
src/ar_core/SimGripperLarge.cpp
src/ar_core/SimGripperLarge.h
src/ar_core/Colors.hpp
src/ar_core/VTKConversions.h
src/ar_core/VTKConversions.cpp
src/ar_core/Manipulator.cpp
src/ar_core/Manipulator.h
src/ar_core/ManipulatorToWorldCalibration.cpp
src/ar_core/ManipulatorToWorldCalibration.h
src/ar_core/AugmentedCamera.cpp
src/ar_core/AugmentedCamera.h
src/ar_core/IntrinsicCalibrationCharuco.cpp
src/ar_core/IntrinsicCalibrationCharuco.h
src/ar_core/SimDrawPath.cpp
src/ar_core/SimDrawPath.h
)
target_link_libraries(
ar_core
${OpenCV_LIBRARIES}
${VTK_LIBRARIES}
${catkin_LIBRARIES}
BulletDynamics
BulletCollision
LinearMath
LoadObjGL
BulletSoftBody
pthread)
##########################################################################
# GUI node
##########################################################################
find_package(Qt5Widgets)
find_package(Qt5Core REQUIRED)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(PROJECT_INCLUDE_DIR src/gui/include)
set (gui_hdr
${PROJECT_INCLUDE_DIR}/mainwindow.hpp
${PROJECT_INCLUDE_DIR}/cvimagewidget.h)
set (gui_src
src/gui/mainwindow.cpp
src/gui/RosBridge.cpp
src/gui/SteadyHandPerfEval.h
src/gui/SteadyHandPerfEval.cpp)
qt5_wrap_cpp(gui_hdr_moc ${gui_hdr})
qt5_wrap_ui (gui_ui_moc src/gui/mainwindow.ui)
include_directories (${PROJECT_SOURCE_DIR})
include_directories (${PROJECT_BINARY_DIR})
include_directories (${PROJECT_INCLUDE_DIR})
add_library (gui_libs SHARED
${gui_src}
${gui_hdr_moc}
${gui_ui_moc})
target_link_libraries (gui_libs
Qt5::Widgets
${OpenCV_LIBRARIES}
${catkin_LIBRARIES})
add_executable(gui src/gui/main_gui.cpp)
target_link_libraries (gui
${catkin_LIBRARIES}
gui_libs)
##########################################################################
# Install Targets
##########################################################################
install(TARGETS
ExtrinsicCalibArucoNodelet
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
##########################################################################
# FlyCapture SDK
##########################################################################
#option(WITH_FlyCapture "Enable support for the FlyCapture SDK" OFF)
#
#if (WITH_FlyCapture)
# # Find the Flycapture include files and libraries
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} /usr/src/flycapture)
#
# find_package(Flycapture2)
# if (FLYCAPTURE2_FOUND)
# MESSAGE("FLYCAPTURE2 found.")
# include_directories(${FLYCAPTURE2_INCLUDE_DIR})
#
# add_executable(camera_capture_flea3
# src/camera_capture_flea3/main_camera_capture_flea3.cpp
# src/camera_capture_flea3/Fla3Camera.cpp
# src/camera_capture_flea3/Fla3Camera.h
# )
# target_link_libraries(camera_capture_flea3
# ${FLYCAPTURE2_LIBRARIES}
# )
# target_link_libraries(camera_capture_flea3
# ${OpenCV_LIBRARIES}
# ${catkin_LIBRARIES}
# arucoUtils
# )
# endif (FLYCAPTURE2_FOUND)
#endif (WITH_FlyCapture)