-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
executable file
·222 lines (194 loc) · 5.32 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
cmake_minimum_required(VERSION 3.8)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
set(CMAKE_BUILD_TYPE "RELEASE")
set(CMAKE_CXX_STANDARD 17)
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ldl -lbfd")
project(active_mapping LANGUAGES CXX)
######################### Packages #########################
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
roslib
std_msgs
message_filters
tf
tf_conversions
message_generation
octomap_msgs
octomap_ros
actionlib
actionlib_msgs
lkh_tsp_solver
backward_ros
costmap_2d
base_local_planner
eigen_conversions
livox_ros_driver
geometry_msgs
visualization_msgs
tf2
genmsg
dynamic_reconfigure
sensor_msgs
nav_msgs
)
find_package(octomap REQUIRED)
find_package(PCL REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Boost COMPONENTS serialization system filesystem thread program_options date_time regex timer chrono)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
find_package(Glog REQUIRED)
find_package(cmake_modules REQUIRED)
########################### Action ################################
add_action_files(
DIRECTORY action
FILES SensorAngleUpdate.action
)
########################### Service ################################
add_service_files(
FILES
disp_ray.srv
insert_point_cloud.srv
get_world_representation.srv
save_octomap.srv
aster_query.srv
)
generate_messages(
DEPENDENCIES
std_msgs
geometry_msgs
sensor_msgs
octomap_msgs
actionlib_msgs
nav_msgs
visualization_msgs
actionlib_msgs
)
catkin_package(
INCLUDE_DIRS include ${Eigen_INCLUDE_DIRS} ${OCTOMAP_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}
LIBRARIES active_mapping ${OCTOMAP_LIBRARIES} ${PROJECT_NAME}_world_representation ${PROJECT_NAME}_utils
CATKIN_DEPENDS message_runtime roscpp geometry_msgs visualization_msgs tf rospy std_msgs lkh_tsp_solver
)
set(Eigen_INCLUDE_DIRS "/usr/include/eigen3")
include_directories(
include
include/active_mapping
${catkin_INCLUDE_DIRS}
${Eigen_INCLUDE_DIRS}
${OCTOMAP_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
###########
## libs ##
###########
add_library(${PROJECT_NAME}_movements
src/active_mapping/movements/geometry_pose.cpp)
target_link_libraries(${PROJECT_NAME}_movements
${catkin_LIBRARIES}
)
add_library(${PROJECT_NAME}_utils
src/active_mapping/utils/octomap_utils.cpp
src/active_mapping/utils/rviz_utils.cpp
src/active_mapping/utils/tictoc.cpp
src/active_mapping/utils/bounding_box.cpp
src/active_mapping/utils/math_utils.cpp
)
target_link_libraries(${PROJECT_NAME}_utils
${OCTOMAP_LIBRARIES}
${PCL_LIBRARIES}
${catkin_LIBRARIES}
)
add_library(${PROJECT_NAME}_controller
src/active_mapping/controller/gazebo_gimbal_controller.cpp
)
target_link_libraries(${PROJECT_NAME}_controller
${catkin_LIBRARIES}
${PROJECT_NAME}_utils
)
add_library(${PROJECT_NAME}_world_representation
src/active_mapping/world_representation/ig_tree.cpp
src/active_mapping/world_representation/world_representation.cpp
)
target_link_libraries(${PROJECT_NAME}_world_representation
${OCTOMAP_LIBRARIES}
${OpenCV_LIBS}
${PROJECT_NAME}_utils
${PCL_LIBRARIES}
)
add_library(${PROJECT_NAME}_sample_viewpoints
src/active_mapping/view_space/sample_viewpoints.cpp
)
target_link_libraries(${PROJECT_NAME}_sample_viewpoints
${catkin_LIBRARIES}
${OCTOMAP_LIBRARIES}
${PROJECT_NAME}_world_representation
${PCL_LIBRARIES}
)
add_library(gridastar
src/gridastar/AStar2.cpp
include/gridastar/AStar2.h
)
add_library(${PROJECT_NAME}_view_space
src/active_mapping/view_space/view.cpp
src/active_mapping/view_space/frontier_view_space_finder.cpp
src/active_mapping/view_space/frontier.cpp
)
add_library(${PROJECT_NAME}
src/active_mapping/active_mapping.cpp
)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
${PROJECT_NAME}_movements
${PROJECT_NAME}_view_space
${PROJECT_NAME}_utils
${PROJECT_NAME}_world_representation
${PROJECT_NAME}_controller
${PROJECT_NAME}_sample_viewpoints
)
#############
## Apps ##
#############
########### active_mapping_task #########
add_executable(${PROJECT_NAME}_task
src/apps/active_mapping_task.cpp
)
target_link_libraries(${PROJECT_NAME}_task
${PROJECT_NAME}
bfd
)
####### odom_to_tf_node #######
add_executable(odom_to_tf_node
src/apps/odom_to_tf_node.cpp
)
target_link_libraries(odom_to_tf_node
${catkin_LIBRARIES}
${PROJECT_NAME}_utils
)
####### livox_custom_msg_converter #######
add_executable(livox_custom_msg_converter
src/apps/livox_custom_msg_converter.cpp
)
target_link_libraries(livox_custom_msg_converter
${catkin_LIBRARIES}
)
install(
TARGETS
${PROJECT_NAME}_movements
${PROJECT_NAME}_view_space
${PROJECT_NAME}_utils
${PROJECT_NAME}_world_representation
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)
install(DIRECTORY include/active_mapping/world_representation
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
PATTERN ".svn" EXCLUDE)