-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
367 lines (308 loc) · 12.5 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
cmake_minimum_required(VERSION 2.8.3)
project(gazebo_plugins)
find_package(catkin REQUIRED COMPONENTS
message_generation
gazebo_msgs
roscpp
rospy
nodelet
angles
std_srvs
geometry_msgs
sensor_msgs
nav_msgs
urdf
tf
tf2_ros
dynamic_reconfigure
driver_base
rosgraph_msgs
trajectory_msgs
image_transport
rosconsole
cv_bridge
polled_camera
diagnostic_updater
camera_info_manager
std_msgs
)
include (FindPkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(XML libxml-2.0)
pkg_check_modules(OGRE OGRE)
pkg_check_modules(OGRE-Terrain OGRE-Terrain)
pkg_check_modules(OGRE-Paging OGRE-Paging)
else()
message(FATAL_ERROR "pkg-config is required; please install it")
endif()
# Depend on system install of Gazebo and SDFormat
find_package(gazebo REQUIRED)
find_package(Boost REQUIRED COMPONENTS thread)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")
execute_process(COMMAND
pkg-config --variable=plugindir OGRE
OUTPUT_VARIABLE OGRE_PLUGIN_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
catkin_python_setup()
generate_dynamic_reconfigure_options(
cfg/CameraSynchronizer.cfg
cfg/GazeboRosCamera.cfg
cfg/GazeboRosOpenniKinect.cfg
cfg/Hokuyo.cfg
)
include_directories(include
${Boost_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
${GAZEBO_INCLUDE_DIRS}
${OGRE_INCLUDE_DIRS}
${OGRE-Terrain_INCLUDE_DIRS}
${OGRE-Paging_INCLUDE_DIRS}
)
link_directories(
${GAZEBO_LIBRARY_DIRS}
${OGRE_LIBRARY_DIRS}
${OGRE-Terrain_LIBRARY_DIRS}
${OGRE-Paging_LIBRARY_DIRS}
${catkin_LIBRARY_DIRS}
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")
if (NOT GAZEBO_VERSION VERSION_LESS 6.0)
catkin_package( INCLUDE_DIRS include LIBRARIES gazebo_ros_elevator)
endif()
if (NOT GAZEBO_VERSION VERSION_LESS 7.3)
catkin_package(INCLUDE_DIRS include LIBRARIES gazebo_ros_harness)
endif()
catkin_package(
INCLUDE_DIRS include
LIBRARIES
vision_reconfigure
gazebo_ros_utils
gazebo_ros_camera_utils
gazebo_ros_camera
gazebo_ros_multicamera
gazebo_ros_depth_camera
gazebo_ros_openni_kinect
gazebo_ros_gpu_laser
gazebo_ros_laser
gazebo_ros_block_laser
gazebo_ros_p3d
gazebo_ros_imu
gazebo_ros_f3d
gazebo_ros_ft_sensor
gazebo_ros_bumper
gazebo_ros_template
gazebo_ros_projector
gazebo_ros_prosilica
gazebo_ros_force
gazebo_ros_joint_trajectory
gazebo_ros_joint_state_publisher
gazebo_ros_joint_pose_trajectory
gazebo_ros_diff_drive
gazebo_ros_tricycle_drive
gazebo_ros_skid_steer_drive
gazebo_ros_video
gazebo_ros_planar_move
CATKIN_DEPENDS
message_generation
gazebo_msgs
roscpp
rospy
nodelet
angles
std_srvs
geometry_msgs
sensor_msgs
nav_msgs
urdf
tf
tf2_ros
dynamic_reconfigure
driver_base
rosgraph_msgs
trajectory_msgs
image_transport
rosconsole
camera_info_manager
std_msgs
DEPENDS
gazebo
SDF
)
add_dependencies(${PROJECT_NAME}_gencfg ${catkin_EXPORTED_TARGETS})
## Executables
add_executable(hokuyo_node src/hokuyo_node.cpp)
add_dependencies(hokuyo_node ${PROJECT_NAME}_gencfg)
target_link_libraries(hokuyo_node
${catkin_LIBRARIES}
)
add_library(gazebo_ros_utils src/gazebo_ros_utils.cpp)
target_link_libraries(gazebo_ros_utils ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(vision_reconfigure src/vision_reconfigure.cpp)
add_dependencies(vision_reconfigure ${PROJECT_NAME}_gencfg)
target_link_libraries(vision_reconfigure ${catkin_LIBRARIES})
add_executable(camera_synchronizer src/camera_synchronizer.cpp)
add_dependencies(camera_synchronizer ${PROJECT_NAME}_gencfg)
target_link_libraries(camera_synchronizer vision_reconfigure ${catkin_LIBRARIES})
add_executable(pub_joint_trajectory_test test/pub_joint_trajectory_test.cpp)
target_link_libraries(pub_joint_trajectory_test ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_dependencies(pub_joint_trajectory_test ${catkin_EXPORTED_TARGETS}) # don't build until gazebo_msgs is done
add_definitions(-fPIC) # what is this for?
## Plugins
add_library(gazebo_ros_camera_utils src/gazebo_ros_camera_utils.cpp)
add_dependencies(gazebo_ros_camera_utils ${PROJECT_NAME}_gencfg)
target_link_libraries(gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(MultiCameraPlugin src/MultiCameraPlugin.cpp)
target_link_libraries(MultiCameraPlugin ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_camera src/gazebo_ros_camera.cpp)
add_dependencies(gazebo_ros_camera ${PROJECT_NAME}_gencfg)
target_link_libraries(gazebo_ros_camera gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} CameraPlugin ${catkin_LIBRARIES})
if (NOT GAZEBO_VERSION VERSION_LESS 6.0)
add_library(gazebo_ros_elevator src/gazebo_ros_elevator.cpp)
add_dependencies(gazebo_ros_elevator ${PROJECT_NAME}_gencfg)
target_link_libraries(gazebo_ros_elevator ${GAZEBO_LIBRARIES} ElevatorPlugin ${catkin_LIBRARIES})
endif()
add_library(gazebo_ros_multicamera src/gazebo_ros_multicamera.cpp)
add_dependencies(gazebo_ros_multicamera ${PROJECT_NAME}_gencfg)
target_link_libraries(gazebo_ros_multicamera gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} MultiCameraPlugin ${catkin_LIBRARIES})
add_library(gazebo_ros_depth_camera src/gazebo_ros_depth_camera.cpp)
add_dependencies(gazebo_ros_depth_camera ${PROJECT_NAME}_gencfg)
target_link_libraries(gazebo_ros_depth_camera gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} DepthCameraPlugin ${catkin_LIBRARIES})
add_library(gazebo_ros_openni_kinect src/gazebo_ros_openni_kinect.cpp)
add_dependencies(gazebo_ros_openni_kinect ${PROJECT_NAME}_gencfg)
target_link_libraries(gazebo_ros_openni_kinect gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} DepthCameraPlugin ${catkin_LIBRARIES})
add_library(gazebo_ros_gpu_laser src/gazebo_ros_gpu_laser.cpp)
target_link_libraries(gazebo_ros_gpu_laser ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES} GpuRayPlugin)
if (NOT GAZEBO_VERSION VERSION_LESS 7.3)
add_library(gazebo_ros_harness src/gazebo_ros_harness.cpp)
add_dependencies(gazebo_ros_harness ${catkin_EXPORTED_TARGETS})
target_link_libraries(gazebo_ros_harness ${GAZEBO_LIBRARIES}
${Boost_LIBRARIES} HarnessPlugin ${catkin_LIBRARIES})
endif()
add_library(gazebo_ros_laser src/gazebo_ros_laser.cpp)
target_link_libraries(gazebo_ros_laser ${GAZEBO_LIBRARIES} RayPlugin ${catkin_LIBRARIES})
add_library(gazebo_ros_block_laser src/gazebo_ros_block_laser.cpp)
target_link_libraries(gazebo_ros_block_laser ${GAZEBO_LIBRARIES} RayPlugin ${catkin_LIBRARIES})
add_library(gazebo_ros_p3d src/gazebo_ros_p3d.cpp)
target_link_libraries(gazebo_ros_p3d ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_imu src/gazebo_ros_imu.cpp)
target_link_libraries(gazebo_ros_imu ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_f3d src/gazebo_ros_f3d.cpp)
target_link_libraries(gazebo_ros_f3d ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_bumper src/gazebo_ros_bumper.cpp)
add_dependencies(gazebo_ros_bumper ${catkin_EXPORTED_TARGETS})
target_link_libraries(gazebo_ros_bumper ${GAZEBO_LIBRARIES} ${Boost_LIBRARIES} ContactPlugin ${catkin_LIBRARIES})
add_library(gazebo_ros_projector src/gazebo_ros_projector.cpp)
target_link_libraries(gazebo_ros_projector ${GAZEBO_LIBRARIES} ${Boost_LIBRARIES} ${catkin_LIBRARIES})
add_library(gazebo_ros_prosilica src/gazebo_ros_prosilica.cpp)
add_dependencies(gazebo_ros_prosilica ${PROJECT_NAME}_gencfg)
target_link_libraries(gazebo_ros_prosilica gazebo_ros_camera_utils ${GAZEBO_LIBRARIES} CameraPlugin ${catkin_LIBRARIES})
add_library(gazebo_ros_force src/gazebo_ros_force.cpp)
target_link_libraries(gazebo_ros_force ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_joint_trajectory src/gazebo_ros_joint_trajectory.cpp)
add_dependencies(gazebo_ros_joint_trajectory ${catkin_EXPORTED_TARGETS})
target_link_libraries(gazebo_ros_joint_trajectory ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_joint_state_publisher src/gazebo_ros_joint_state_publisher.cpp)
set_target_properties(gazebo_ros_joint_state_publisher PROPERTIES LINK_FLAGS "${ld_flags}")
set_target_properties(gazebo_ros_joint_state_publisher PROPERTIES COMPILE_FLAGS "${cxx_flags}")
add_dependencies(gazebo_ros_joint_state_publisher ${catkin_EXPORTED_TARGETS})
target_link_libraries(gazebo_ros_joint_state_publisher ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_joint_pose_trajectory src/gazebo_ros_joint_pose_trajectory.cpp)
add_dependencies(gazebo_ros_joint_pose_trajectory ${catkin_EXPORTED_TARGETS})
target_link_libraries(gazebo_ros_joint_pose_trajectory ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_diff_drive src/gazebo_ros_diff_drive.cpp)
target_link_libraries(gazebo_ros_diff_drive gazebo_ros_utils ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_tricycle_drive src/gazebo_ros_tricycle_drive.cpp)
target_link_libraries(gazebo_ros_tricycle_drive gazebo_ros_utils ${GAZEBO_LIBRARIES} ${Boost_LIBRARIES} ${catkin_LIBRARIES})
add_library(gazebo_ros_skid_steer_drive src/gazebo_ros_skid_steer_drive.cpp)
target_link_libraries(gazebo_ros_skid_steer_drive ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_video src/gazebo_ros_video.cpp)
target_link_libraries(gazebo_ros_video ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OGRE_LIBRARIES})
add_library(gazebo_ros_planar_move src/gazebo_ros_planar_move.cpp)
target_link_libraries(gazebo_ros_planar_move ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_hand_of_god src/gazebo_ros_hand_of_god.cpp)
set_target_properties(gazebo_ros_hand_of_god PROPERTIES LINK_FLAGS "${ld_flags}")
set_target_properties(gazebo_ros_hand_of_god PROPERTIES COMPILE_FLAGS "${cxx_flags}")
target_link_libraries(gazebo_ros_hand_of_god ${GAZEBO_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_ft_sensor src/gazebo_ros_ft_sensor.cpp)
target_link_libraries(gazebo_ros_ft_sensor ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(gazebo_ros_range src/gazebo_ros_range.cpp)
target_link_libraries(gazebo_ros_range ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES} ${Boost_LIBRARIES} RayPlugin)
##
## Add your new plugin here
##
## Template
add_library(gazebo_ros_template src/gazebo_ros_template.cpp)
target_link_libraries(gazebo_ros_template ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
install(TARGETS
hokuyo_node
vision_reconfigure
camera_synchronizer
gazebo_ros_utils
gazebo_ros_camera_utils
gazebo_ros_camera
gazebo_ros_multicamera
MultiCameraPlugin
gazebo_ros_depth_camera
gazebo_ros_openni_kinect
gazebo_ros_openni_kinect
gazebo_ros_laser
gazebo_ros_block_laser
gazebo_ros_p3d
gazebo_ros_imu
gazebo_ros_f3d
gazebo_ros_ft_sensor
gazebo_ros_bumper
gazebo_ros_hand_of_god
gazebo_ros_template
gazebo_ros_projector
gazebo_ros_prosilica
gazebo_ros_force
gazebo_ros_joint_trajectory
gazebo_ros_joint_state_publisher
gazebo_ros_joint_pose_trajectory
gazebo_ros_diff_drive
gazebo_ros_tricycle_drive
gazebo_ros_skid_steer_drive
gazebo_ros_video
gazebo_ros_planar_move
pub_joint_trajectory_test
gazebo_ros_gpu_laser
gazebo_ros_range
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
if (NOT GAZEBO_VERSION VERSION_LESS 6.0)
install(TARGETS gazebo_ros_elevator
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
endif()
if (NOT GAZEBO_VERSION VERSION_LESS 7.3)
install(TARGETS gazebo_ros_harness
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
endif()
install(DIRECTORY include/
DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
)
install(PROGRAMS scripts/set_wrench.py scripts/set_pose.py scripts/gazebo_model
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY Media
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY test
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
# Tests
if (CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
add_rostest_gtest(set_model_state-test
test/set_model_state_test/set_model_state_test.test
test/set_model_state_test/set_model_state_test.cpp)
add_rostest(test/range/range_plugin.test)
target_link_libraries(set_model_state-test ${catkin_LIBRARIES})
endif()