-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
405 lines (368 loc) · 11.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
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
cmake_minimum_required(VERSION 3.5)
project(kortex_motion_planning)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(NOT PINOCCHIO_LIB_DIRS)
set(PINOCCHIO_LIB_DIRS
"${PROJECT_SOURCE_DIR}/../../devel/lib"
)
endif()
SET(KORTEX_CONFIG_DIR
"${PROJECT_SOURCE_DIR}/config"
)
add_definitions(-DKORTEX_CONFIG_DIR="${KORTEX_CONFIG_DIR}")
find_package(catkin REQUIRED COMPONENTS
roscpp
roslib
std_msgs
geometry_msgs
moveit_core
# moveit_ros_planning
moveit_ros_planning_interface
std_srvs
tesseract_monitoring
tesseract_rosutils
message_generation
)
find_package(pinocchio REQUIRED)
find_package(descartes_light REQUIRED)
find_package(tesseract_command_language REQUIRED)
find_package(tesseract_task_composer REQUIRED)
find_package(tesseract_kinematics REQUIRED)
find_package(Qt5 REQUIRED Widgets)
find_package(QCustomPlot REQUIRED)
# find_package(LAPACK REQUIRED) # Requried for ikfast
include_directories(include ${catkin_INCLUDE_DIRS})
include_directories(include ${PROJECT_SOURCE_DIR}/src)
include_directories(include ${PROJECT_SOURCE_DIR}/../ros_kortex/kortex_api/include/client)
include_directories(include ${PROJECT_SOURCE_DIR}/../ros_kortex/kortex_api/include/client_stubs)
include_directories(include ${PROJECT_SOURCE_DIR}/../ros_kortex/kortex_api/include/messages)
include_directories(include ${PROJECT_SOURCE_DIR}/../ros_kortex/kortex_api/include/common)
include_directories(${QCustomPlot_INCLUDE_DIRS})
include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${pinocchio_INCLUDE_DIRS}
)
link_directories(
${pinocchio_LIBRARY_DIRS}
)
add_message_files(
FILES
JointPositions.msg
)
add_service_files(
FILES
GenerateKortexMotionPlan.srv
ExecuteMotionPlan.srv
GenerateKortexJointMotionPlan.srv
KortexSimpleJmpe.srv
KortexSimpleCmpe.srv
SendGripperCommand.srv
GetUtensil.srv
UprightSkewerAction.srv
)
generate_messages(
DEPENDENCIES
std_msgs
sensor_msgs
geometry_msgs
trajectory_msgs
)
catkin_package(
CATKIN_DEPENDS message_runtime
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS
moveit_core
moveit_ros_planning_interface
)
#####################################
########## FUNCTIONAL PART ##########
#####################################
# Gripper command
add_executable(gripper_command
src/utilities/gripper_command.cpp
)
add_dependencies(gripper_command
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(gripper_command
${catkin_LIBRARIES}
)
# Planning server
add_executable(${PROJECT_NAME}_node
src/planning_server.cpp
)
target_link_libraries(
${PROJECT_NAME}_node
${catkin_LIBRARIES}
tesseract::tesseract_environment
tesseract::tesseract_command_language
tesseract::tesseract_task_composer
tesseract::tesseract_motion_planners_core
tesseract::tesseract_motion_planners_simple
tesseract::tesseract_motion_planners_ompl
tesseract::tesseract_motion_planners_trajopt
tesseract::tesseract_motion_planners_descartes
tesseract::tesseract_time_parameterization_isp
)
target_include_directories(${PROJECT_NAME}_node PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)
target_include_directories(${PROJECT_NAME}_node SYSTEM PRIVATE
${catkin_INCLUDE_DIRS}
)
# Joint space planning server
add_executable(kortex_joint_motion_planning_node
src/joint_space_planning_server.cpp
)
target_link_libraries(
kortex_joint_motion_planning_node
${catkin_LIBRARIES}
tesseract::tesseract_environment
tesseract::tesseract_command_language
tesseract::tesseract_task_composer
tesseract::tesseract_motion_planners_core
tesseract::tesseract_motion_planners_simple
tesseract::tesseract_motion_planners_ompl
tesseract::tesseract_motion_planners_trajopt
tesseract::tesseract_motion_planners_descartes
tesseract::tesseract_time_parameterization_isp
)
target_include_directories(kortex_joint_motion_planning_node PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)
target_include_directories(kortex_joint_motion_planning_node SYSTEM PRIVATE
${catkin_INCLUDE_DIRS}
)
# Motion widget for joint widget
add_executable(kortex_joint_motion_widget_node
src/joint_main.cpp
)
target_link_libraries(
kortex_joint_motion_widget_node
${catkin_LIBRARIES}
tesseract::tesseract_environment
tesseract::tesseract_command_language
tesseract::tesseract_task_composer
tesseract::tesseract_motion_planners_core
tesseract::tesseract_motion_planners_simple
tesseract::tesseract_motion_planners_ompl
tesseract::tesseract_motion_planners_trajopt
tesseract::tesseract_motion_planners_descartes
tesseract::tesseract_time_parameterization_isp
)
target_include_directories(kortex_joint_motion_widget_node PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)
target_include_directories(kortex_joint_motion_widget_node SYSTEM PRIVATE
${catkin_INCLUDE_DIRS}
)
# Planning server new
add_executable(${PROJECT_NAME}_new_node
src/planning_server_new.cpp)
target_link_libraries(
${PROJECT_NAME}_new_node
${catkin_LIBRARIES} # add this line to use ros properly
tesseract::tesseract_environment
tesseract::tesseract_command_language
tesseract::tesseract_task_composer
tesseract::tesseract_motion_planners_core
tesseract::tesseract_motion_planners_simple
tesseract::tesseract_motion_planners_ompl
tesseract::tesseract_motion_planners_trajopt
tesseract::tesseract_motion_planners_descartes
tesseract::tesseract_time_parameterization_isp
)
target_include_directories(${PROJECT_NAME}_new_node PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
) # to use headers from tesseract packages
target_include_directories(${PROJECT_NAME}_new_node SYSTEM PRIVATE
${catkin_INCLUDE_DIRS}
) # to use headers from tesseract packages
# Motion executor
add_executable(kortex_motion_execution_node src/motion_execution.cpp)
target_link_libraries(
kortex_motion_execution_node
${catkin_LIBRARIES} # add this line to use ros properly
tesseract::tesseract_environment
tesseract::tesseract_command_language
tesseract::tesseract_task_composer
tesseract::tesseract_motion_planners_core
tesseract::tesseract_motion_planners_simple
tesseract::tesseract_motion_planners_ompl
tesseract::tesseract_motion_planners_trajopt
tesseract::tesseract_motion_planners_descartes
tesseract::tesseract_time_parameterization_isp)
target_include_directories(kortex_motion_execution_node PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
) # to use headers from tesseract packages
target_include_directories(kortex_motion_execution_node SYSTEM PRIVATE
${catkin_INCLUDE_DIRS}
) # to use headers from tesseract packages
# Motion widget
add_executable(kortex_motion_widget_node
src/main.cpp
)
target_link_libraries(
kortex_motion_widget_node
${catkin_LIBRARIES}
tesseract::tesseract_environment
tesseract::tesseract_command_language
tesseract::tesseract_task_composer
tesseract::tesseract_motion_planners_core
tesseract::tesseract_motion_planners_simple
tesseract::tesseract_motion_planners_ompl
tesseract::tesseract_motion_planners_trajopt
tesseract::tesseract_motion_planners_descartes
tesseract::tesseract_time_parameterization_isp
)
target_include_directories(kortex_motion_widget_node PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)
target_include_directories(kortex_motion_widget_node SYSTEM PRIVATE
${catkin_INCLUDE_DIRS}
)
message("Pinocchio include dirs: ${pinocchio_INCLUDE_DIRS}")
# /home/zing/mealAssistiveRobot/sla_ws/devel/include
message("Pinocchio library dirs: ${pinocchio_LIBRARY_DIRS}")
# none
# collision detection
link_directories(${PINOCCHIO_LIB_DIRS}) # libpinocchio
add_executable(collision_detection
src/collision_detection/collision_detection.cpp
src/utilities/ros_utilities.cpp
)
target_link_libraries(
collision_detection
${catkin_LIBRARIES} # add this line to use ros properly
pinocchio
Qt5::Widgets
${QCustomPlot_LIBRARIES}
)
# joint torque visualization
add_executable(joint_torque_visualization
src/utilities/joint_torque_visualization.cpp
)
target_link_libraries(
joint_torque_visualization
${catkin_LIBRARIES} # add this line to use ros properly
Qt5::Widgets
${QCustomPlot_LIBRARIES}
)
# collision detection visualization
link_directories(${PINOCCHIO_LIB_DIRS}) # libpinocchio
add_executable(collision_detection_visualization
src/collision_detection/collision_detection_visualization.cpp
)
target_link_libraries(
collision_detection_visualization
${catkin_LIBRARIES} # add this line to use ros properly
Qt5::Widgets
${QCustomPlot_LIBRARIES}
pinocchio
)
# simple cmpe
add_executable(simple_jcmpe
src/simple_jcmpe.cpp
src/simple_mpe.cpp
src/utilities/ros_utilities.cpp
)
target_link_libraries(simple_jcmpe
${catkin_LIBRARIES}
)
add_dependencies(simple_jcmpe
${catkin_EXPORTED_TARGETS}
)
# get utensil action
add_executable(get_utensil_action
src/get_utensil_action.cpp
src/simple_mpe.cpp
src/utilities/ros_utilities.cpp
)
target_link_libraries(get_utensil_action
${catkin_LIBRARIES}
)
add_dependencies(get_utensil_action
${catkin_EXPORTED_TARGETS}
)
# get state
add_executable(get_state
src/utilities/get_state.cpp
)
target_link_libraries(get_state
${catkin_LIBRARIES}
)
add_dependencies(get_state
${catkin_EXPORTED_TARGETS}
)
# wrench sensing
add_executable(wrench_feedback
src/wrench_sensing.cpp
)
target_link_libraries(wrench_feedback
${catkin_LIBRARIES}
)
add_dependencies(wrench_feedback
${catkin_EXPORTED_TARGETS}
)
#####################################
########## FOR UNCLEAR USE ##########
#####################################
# Plugin Library
add_library(${PROJECT_NAME}_plugins SHARED
src/motoman_hc10_ikfast_plugin.cpp
)
target_link_libraries(${PROJECT_NAME}_plugins PUBLIC
${LAPACK_LIBRARIES}
tesseract::tesseract_common
tesseract::tesseract_kinematics_ikfast
)
target_include_directories(${PROJECT_NAME}_plugins SYSTEM PUBLIC
${LAPACK_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
)
# Install the executable
install(TARGETS ${PROJECT_NAME}_node
DESTINATION lib/${PROJECT_NAME})
# Install the library
install(TARGETS ${PROJECT_NAME}_plugins EXPORT
${PROJECT_NAME}-targets DESTINATION lib)
install(DIRECTORY config launch DESTINATION share/${PROJECT_NAME}/)
add_library(${PROJECT_NAME}
src/gen3_motion_planner.cpp
include/kortex_motion_planning/planner_profiles.hpp
)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
tesseract::tesseract_environment
tesseract::tesseract_command_language
tesseract::tesseract_task_composer
tesseract::tesseract_motion_planners_core
tesseract::tesseract_motion_planners_simple
tesseract::tesseract_motion_planners_ompl
tesseract::tesseract_motion_planners_trajopt
tesseract::tesseract_motion_planners_descartes
tesseract::tesseract_time_parameterization_isp
)
install(
TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)
install(
DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)