-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
346 lines (313 loc) · 7.22 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
cmake_minimum_required(VERSION 3.10.2)
project(cabin_nav)
add_compile_options(-std=c++11 -Wall)
find_package(catkin REQUIRED COMPONENTS
tf
rospy
roscpp
std_msgs
sensor_msgs
geometry_msgs
visualization_msgs
cv_bridge
roslib
interactive_markers
geometry_common
yaml_common
)
find_package(OpenCV REQUIRED)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS
tf
std_msgs
sensor_msgs
geometry_msgs
visualization_msgs
cv_bridge
geometry_common
yaml_common
roslib
interactive_markers
)
include_directories(
include
${catkin_INCLUDE_DIRS}
)
# ===============
# UTILITY LIBRARY
# ===============
add_library(utilities
src/utils/utils.cpp
src/structs/trajectory_point.cpp
)
target_link_libraries(utilities
${catkin_LIBRARIES}
)
add_library(mpc
src/mpc/model.cpp
src/mpc/optimiser.cpp
)
target_link_libraries(mpc
${catkin_LIBRARIES}
utilities
)
add_library(initial_guess_utils
src/utils/initial_guess_utils.cpp
)
target_link_libraries(initial_guess_utils
${catkin_LIBRARIES}
utilities
)
add_library(aruco_marker_utils
src/utils/aruco_marker_utils.cpp
)
target_link_libraries(aruco_marker_utils
${OpenCV_LIBRARIES}
)
add_library(geometric_planner
src/utils/geometric_planner.cpp
src/utils/lattice_search_utils.cpp
src/structs/occupancy_grid.cpp
src/structs/lattice.cpp
)
target_link_libraries(geometric_planner
${catkin_LIBRARIES}
utilities
)
add_library(semantic_map
src/semantic_map/semantic_map.cpp
src/semantic_map/area.cpp
src/semantic_map/connection.cpp
src/semantic_map/topology_node.cpp
src/semantic_map/topology_connection.cpp
)
target_link_libraries(semantic_map
${catkin_LIBRARIES}
utilities
)
add_library(context_data
src/structs/context_data.cpp
)
target_link_libraries(context_data
${catkin_LIBRARIES}
utilities
semantic_map
)
add_library(obstacle_tracker
src/utils/obstacle_tracker.cpp
)
target_link_libraries(obstacle_tracker
${catkin_LIBRARIES}
utilities
)
add_library(voronoi_calculator
src/utils/voronoi_calculator.cpp
)
target_link_libraries(voronoi_calculator
${catkin_LIBRARIES}
utilities
)
# ===================
# BEHAVIOR LIBRARIES
# ===================
macro(add_behavior_lib NAME LIBS)
add_library(${NAME}_behavior
src/behavior/${NAME}_behavior.cpp
)
target_link_libraries(${NAME}_behavior
${catkin_LIBRARIES}
${LIBS}
)
endmacro()
add_library(behavior
src/behavior/behavior.cpp
)
target_link_libraries(behavior
${catkin_LIBRARIES}
mpc
utilities
context_data
)
add_behavior_lib("standstill" "behavior")
add_behavior_lib("joypad" "behavior")
add_behavior_lib("ptp" "behavior;obstacle_tracker;geometric_planner;initial_guess_utils")
add_behavior_lib("ptp_occ_grid" "ptp_behavior;voronoi_calculator")
add_behavior_lib("recovery_ptp" "ptp_behavior")
add_behavior_lib("corridor" "behavior;geometric_planner;initial_guess_utils")
add_behavior_lib("junction" "behavior;initial_guess_utils")
add_behavior_lib("door" "behavior")
add_behavior_lib("open_area" "behavior")
# ================
# ACTION LIBRARIES
# ================
macro(add_action_lib NAME LIBS)
add_library(${NAME}_action
src/action/${NAME}_action.cpp
src/action/action.cpp
)
target_link_libraries(${NAME}_action
${catkin_LIBRARIES}
${LIBS}
)
endmacro()
add_action_lib("goto" "behavior")
# ===============
# INPUT LIBRARIES
# ===============
macro(add_input_lib NAME LIBS)
add_library(${NAME}_input
src/input/${NAME}_input.cpp
src/input/${NAME}_input_data.cpp
)
target_link_libraries(${NAME}_input
${catkin_LIBRARIES}
${LIBS}
)
endmacro()
add_input_lib("velocity" "utilities")
add_input_lib("localisation" "utilities")
add_input_lib("joypad" "utilities")
add_input_lib("laser" "utilities")
add_input_lib("pointcloud" "utilities")
add_input_lib("image" "utilities")
add_input_lib("semantic_map" "utilities;semantic_map")
add_library(occupancy_grid_map_input
src/input/occupancy_grid_map_input.cpp
src/input/occupancy_grid_map_input_data.cpp
src/structs/occupancy_grid.cpp
)
target_link_libraries(occupancy_grid_map_input
${catkin_LIBRARIES}
utilities
)
# ===============
# OUTPUT LIBRARIES
# ===============
macro(add_output_lib NAME LIBS)
add_library(${NAME}_output
src/output/${NAME}_output.cpp
src/output/${NAME}_output_data.cpp
)
target_link_libraries(${NAME}_output
${catkin_LIBRARIES}
${LIBS}
)
endmacro()
add_output_lib("cmd_vel" "utilities")
add_output_lib("visualization_marker" "utilities")
# =====================
# CABIN NAVIGATOR LIBRARY
# =====================
add_library(cabin_navigator
SHARED
src/cabin_navigator.cpp
src/task/task_manager.cpp
src/task/task_planner.cpp
src/behavior/behavior_factory.cpp
src/action/action_factory.cpp
)
target_link_libraries(cabin_navigator
${catkin_LIBRARIES}
yaml-cpp
utilities
semantic_map
# actions
goto_action
# behaviors
behavior
standstill_behavior
joypad_behavior
ptp_behavior
ptp_occ_grid_behavior
corridor_behavior
junction_behavior
door_behavior
open_area_behavior
recovery_ptp_behavior
# inputs
velocity_input
localisation_input
joypad_input
laser_input
pointcloud_input
image_input
occupancy_grid_map_input
semantic_map_input
# outputs
cmd_vel_output
visualization_marker_output
)
# =====================
# INPUT MANAGER LIBRARY
# =====================
add_library(input_manager
src/input/input_manager.cpp
src/input/input_factory.cpp
)
target_link_libraries(input_manager
${catkin_LIBRARIES}
utilities
velocity_input
localisation_input
joypad_input
laser_input
pointcloud_input
image_input
occupancy_grid_map_input
semantic_map_input
)
# ======================
# OUTPUT MANAGER LIBRARY
# ======================
add_library(output_manager
src/output/output_manager.cpp
src/output/output_factory.cpp
)
target_link_libraries(output_manager
${catkin_LIBRARIES}
utilities
cmd_vel_output
visualization_marker_output
)
# ==========
# EXECUTABLE
# ==========
add_executable(cabin_navigator_ros
src/cabin_navigator_ros.cpp
src/main.cpp
)
target_link_libraries(cabin_navigator_ros
${catkin_LIBRARIES}
cabin_navigator
input_manager
output_manager
)
add_executable(semantic_map_editor
src/utils/semantic_map_editor.cpp
)
target_link_libraries(semantic_map_editor
${catkin_LIBRARIES}
utilities
semantic_map
)
# =====
# TESTS
# =====
if (CATKIN_ENABLE_TESTING)
add_subdirectory(test)
endif ()
# =======
# INSTALL
# =======
install(TARGETS cabin_navigator cabin_navigator_ros semantic_map_editor
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
install(DIRECTORY config launch scripts
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)