-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
190 lines (151 loc) · 4.7 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
cmake_minimum_required(VERSION 3.5)
project(robotx_costmap_calculator)
#Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
#Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
include(cmake/robotx_costmap_calculator-extras.cmake)
# find dependencies
find_package(ament_cmake_auto REQUIRED)
find_package(grid_map_cmake_helpers REQUIRED)
ament_auto_find_build_dependencies()
find_package(pcl_conversions REQUIRED)
find_package(PCL REQUIRED)
find_package(Eigen3 REQUIRED)
include_directories(
include
${PCL_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
)
link_directories(
${PCL_LIBRARY_DIRS}
${EIGEN3_LIBRARY_DIRS}
)
add_definitions(${PCL_DEFINITIONS})
ament_auto_add_library(costmap_calculator_component SHARED
src/costmap_calculator_component.cpp)
# add_library(costmap_calculator_component SHARED
# src/costmap_calculator_component.cpp
# )
target_compile_definitions(costmap_calculator_component
PRIVATE "COSTMAP_CALCULATOR_COMPONENT_BUILDING_DLL")
# ament_target_dependencies(costmap_calculator_component
# rclcpp
# rclcpp_components
# sensor_msgs
# grid_map_msgs
# grid_map_core
# grid_map_ros
# pcl_conversions
# geometry_msgs
# data_buffer
# geometry_msgs_data_buffer
# pcl_apps_msgs
# )
target_link_libraries(costmap_calculator_component
${PCL_LIBRARIES})
# add_executable(costmap_calculator_node
# src/costmap_calculator_node.cpp
# )
ament_auto_add_executable(costmap_calculator_node
src/costmap_calculator_node.cpp
)
rclcpp_components_register_nodes(costmap_calculator_component
"robotx_costmap_calculator::CostmapCalculatorComponent")
# target_link_libraries(costmap_calculator_node
# costmap_calculator_component)
# ament_target_dependencies(costmap_calculator_node
# rclcpp
# rclcpp_components
# sensor_msgs
# grid_map_core
# grid_map_msgs
# grid_map_ros
# pcl_conversions
# geometry_msgs
# data_buffer
# geometry_msgs_data_buffer
# pcl_apps_msgs
# )
ament_auto_add_library(costmap_to_polygon_component SHARED
src/costmap_to_polygon_component.cpp)
# add_library(costmap_to_polygon_component SHARED
# src/costmap_to_polygon_component.cpp
# )
target_compile_definitions(costmap_to_polygon_component
PRIVATE "COSTMAP_TO_POLYGON_COMPONENT_BUILDING_DLL")
# ament_target_dependencies(costmap_to_polygon_component
# rclcpp
# rclcpp_components
# grid_map_msgs
# grid_map_ros
# pcl_apps_msgs
# )
ament_auto_add_executable(costmap_to_polygon_node
src/costmap_to_polygon_node.cpp
)
# add_executable(costmap_to_polygon_node
# src/costmap_to_polygon_node.cpp
# )
# target_link_libraries(costmap_to_polygon_node
# costmap_to_polygon_component)
# ament_target_dependencies(costmap_to_polygon_node
# rclcpp
# rclcpp_components
# grid_map_msgs
# grid_map_ros
# pcl_apps_msgs)
rclcpp_components_register_nodes(costmap_to_polygon_component
"robotx_costmap_calculator::CostmapToPolygonComponent")
# costmap_filter_component
ament_auto_add_library(costmap_filter_component SHARED
src/costmap_filter_component.cpp)
target_compile_definitions(costmap_filter_component
PRIVATE "COSTMAP_FILTER_COMPONENT_BUILDING_DLL")
ament_auto_add_executable(costmap_filter_node
src/costmap_filter_node.cpp
)
rclcpp_components_register_nodes(costmap_filter_component
"robotx_costmap_calculator::CostmapFilterComponent")
# costmap_interpolation_component
ament_auto_add_library(costmap_interpolation_component SHARED
src/costmap_interpolation_component.cpp)
target_compile_definitions(costmap_interpolation_component
PRIVATE "COSTMAP_INTERPOLATION_COMPONENT_BUILDING_DLL")
ament_auto_add_executable(costmap_interpolation_node
src/costmap_interpolation_node.cpp
)
rclcpp_components_register_nodes(costmap_interpolation_component
"robotx_costmap_calculator::CostmapInterpolationComponent")
# workaround to allow deprecated header to build on both galactic and humble
if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
target_compile_definitions(costmap_calculator_component PUBLIC
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
target_compile_definitions(costmap_calculator_node PUBLIC
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()
foreach(target ${target_list})
target_compile_options(${target} PRIVATE "SHELL:--param gcc-min-expand=1")
target_compile_options(${target} PRIVATE "SHELL:--param gcc-min-heapsize=32768")
endforeach()
install(
DIRECTORY "include/"
DESTINATION include
)
install(DIRECTORY config launch
DESTINATION share/${PROJECT_NAME}
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
ament_auto_package()