-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
292 lines (256 loc) · 7.09 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
cmake_minimum_required(VERSION 3.8)
project(ergocub_navigation)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(lifecycle_msgs REQUIRED)
find_package(rclcpp_lifecycle REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(nav_2d_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(laser_geometry REQUIRED)
find_package(pcl_conversions REQUIRED)
FIND_PACKAGE(YARP COMPONENTS os sig dev REQUIRED)
find_package(PCL 1.2 REQUIRED)
find_package(pcl_ros REQUIRED)
find_package(nav2_common REQUIRED)
find_package(nav2_core REQUIRED)
find_package(nav2_costmap_2d REQUIRED)
find_package(nav2_util REQUIRED)
find_package(pluginlib REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(std_srvs REQUIRED)
find_package(tf2_kdl REQUIRED)
find_package(tf2_sensor_msgs REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
#include_directories(/opt/ros/humble/include/tf2_geometry_msgs)
#include_directories(/opt/ros/humble/include/tf2)
#include_directories(/opt/ros/humble/include/tf2_ros)
#include_directories(/opt/ros/humble/include/laser_geometry)
#include_directories(/opt/ros/humble/include/pcl_conversions)
#include_directories(include)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
include_directories(/opt/ros/iron/include/tf2_geometry_msgs)
include_directories(/opt/ros/iron/include/tf2)
include_directories(/opt/ros/iron/include/tf2_ros)
include_directories(/opt/ros/iron/include/laser_geometry)
include_directories(/opt/ros/iron/include/pcl_conversions)
include_directories(include)
add_subdirectory(interfaces)
#rosidl_generate_interfaces(${PROJECT_NAME}
# "srv/GetHumanExtremes.srv"
# DEPENDENCIES geometry_msgs
#)
add_executable(planner_trigger_server src/planner_trigger_server.cpp)
ament_target_dependencies(planner_trigger_server
"YARP"
"rclcpp"
"std_srvs"
"rclcpp_action"
)
add_executable(scan_filter src/ScanFilter.cpp)
ament_target_dependencies(scan_filter
"std_msgs"
"tf2_ros"
"tf2_msgs"
"rclcpp"
"rclcpp_lifecycle"
"laser_geometry"
"pcl_conversions"
"geometry_msgs"
"sensor_msgs"
"tf2_sensor_msgs"
"tf2_geometry_msgs"
)
target_link_libraries(scan_filter ${PCL_LIBRARIES})
add_executable(footsteps_viewer src/FootstepsViewer/main.cpp src/FootstepsViewer/FootstepsViewerYarp.cpp src/FootstepsViewer/FootstepsViewerRos.cpp)
ament_target_dependencies(footsteps_viewer
"YARP"
"rclcpp"
"nav_msgs"
"tf2_ros"
"tf2_msgs"
"tf2"
"nav2_util"
"nav_2d_msgs"
"visualization_msgs"
)
#add_executable(base_projector src/BaseProjector.cpp)
#ament_target_dependencies(base_projector
# "std_msgs"
# "tf2_ros"
# "tf2_msgs"
# "YARP"
# "rclcpp"
# "tf2_geometry_msgs"
#)
add_executable(odom_node src/OdomNode.cpp)
ament_target_dependencies(odom_node
"YARP"
"rclcpp"
"rclcpp_lifecycle"
"tf2_ros"
"tf2_msgs"
"tf2"
"tf2_kdl"
"nav_msgs"
"tf2_geometry_msgs"
)
#add_executable(path_converter src/PathConverter.cpp)
#ament_target_dependencies(path_converter
# "YARP"
# "rclcpp"
# "nav_msgs"
# "tf2_ros"
# "tf2_msgs"
# "tf2"
# "nav2_util"
# "nav_2d_msgs"
#)
add_executable(pointcloud_filter src/PointcloudFilter.cpp)
ament_target_dependencies(pointcloud_filter
"std_msgs"
"tf2_ros"
"tf2_msgs"
"rclcpp"
"pcl_conversions"
"geometry_msgs"
"sensor_msgs"
"rclcpp_lifecycle"
"tf2_ros"
"pcl_ros"
)
target_link_libraries(pointcloud_filter ${PCL_LIBRARIES})
add_executable(path_converter_v2 src/PathConverter_v2.cpp)
ament_target_dependencies(path_converter_v2
"YARP"
"rclcpp"
"nav_msgs"
"tf2_ros"
"tf2_msgs"
"tf2"
"nav2_util"
"rclcpp_lifecycle"
)
add_executable(phase_detector src/PhaseDetector.cpp src/MotorControl.cpp)
ament_target_dependencies(phase_detector
"YARP"
"rclcpp"
"nav_msgs"
"tf2_ros"
"tf2_msgs"
"tf2"
"sensor_msgs"
"rclcpp_lifecycle"
"tf2_geometry_msgs"
)
add_executable(human_pose_goal_generator src/HumanPoseGoalGenerator/main.cpp src/HumanPoseGoalGenerator/GoalGenerator.cpp
src/HumanPoseGoalGenerator/CommunicationWrapper.cpp)
ament_target_dependencies(human_pose_goal_generator
"YARP"
"rclcpp"
"rclcpp_lifecycle"
"nav_msgs"
"tf2_ros"
"tf2_msgs"
"tf2"
"nav2_util"
"nav_2d_msgs"
"visualization_msgs"
"nav2_costmap_2d"
"rclcpp_action"
)
set(dependencies
rclcpp
rclcpp_action
rclcpp_lifecycle
geometry_msgs
nav2_costmap_2d
pluginlib
nav2_msgs
nav_msgs
nav2_util
nav2_core
tf2
YARP
)
add_library(ergocub_local_human_avoidance_controller SHARED
src/LocalHumanAvoidance.cpp src/ControlInterface.cpp)
# prevent pluginlib from using boost
target_compile_definitions(ergocub_local_human_avoidance_controller PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
#rosidl_get_typesupport_target(ergocub_local_human_avoidance_controller ${PROJECT_NAME} "rosidl_typesupport_cpp")
ament_target_dependencies(ergocub_local_human_avoidance_controller
${dependencies}
)
install(DIRECTORY include/
DESTINATION include/
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
install(TARGETS
odom_node
planner_trigger_server
scan_filter
footsteps_viewer
pointcloud_filter
phase_detector
path_converter_v2
human_pose_goal_generator
ergocub_local_human_avoidance_controller
DESTINATION lib/${PROJECT_NAME})
# install the launch directory
install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}/
)
# install the maps directory
install(DIRECTORY
config/maps
DESTINATION share/${PROJECT_NAME}/
)
# install the param directory
install(DIRECTORY
config/param
DESTINATION share/${PROJECT_NAME}/
)
# install the RVIZ directory
install(DIRECTORY
config/rviz
DESTINATION share/${PROJECT_NAME}/
)
install(DIRECTORY include/
DESTINATION include/
)
install(FILES ergocub_local_human_avoidance_controller.xml
DESTINATION share/${PROJECT_NAME}
)
ament_export_include_directories(include)
#rosidl_get_typesupport_target(cpp_typesupport_target
# ${PROJECT_NAME} rosidl_typesupport_cpp)
#target_link_libraries(ergocub_local_human_avoidance_controller "${cpp_typesupport_target}")
ament_export_libraries(ergocub_local_human_avoidance_controller)
ament_export_dependencies(${dependencies})
#ament_export_dependencies(rosidl_default_runtime)
pluginlib_export_plugin_description_file(nav2_core ergocub_local_human_avoidance_controller.xml)
ament_package()