-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists.txt
164 lines (144 loc) · 4.18 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
cmake_minimum_required(VERSION 3.5)
project(cslam_visualization)
# 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()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(std_srvs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(nav2_msgs REQUIRED)
find_package(stereo_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(image_transport REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_eigen REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(pcl_ros REQUIRED)
find_package(pcl_msgs REQUIRED)
find_package(perception_pcl REQUIRED)
find_package(laser_geometry REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(message_filters REQUIRED)
find_package(class_loader REQUIRED)
find_package(image_geometry REQUIRED)
find_package(rtabmap_ros 0.20.18 REQUIRED)
find_package(RTABMap 0.20.18 REQUIRED)
# Find GTSAM
find_package(GTSAM CONFIG REQUIRED)
# kinetic issue, rtabmap now requires at least c++11
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
set(CMAKE_CXX_STANDARD 14)
find_package(PCL 1.7
REQUIRED QUIET COMPONENTS
common
io
kdtree
search
surface
filters
registration
sample_consensus
segmentation
) #This crashes idl generation if all components are found?! see https://github.com/ros2/rosidl/issues/402#issuecomment-565586908
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
${RTABMap_INCLUDE_DIRS}
${rtabmap_ros_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${GTSAM_INCLUDE_DIR}
)
# libraries
SET(Libraries
pcl_conversions
cv_bridge
rclcpp
rclcpp_components
sensor_msgs
std_msgs
nav_msgs
nav2_msgs
geometry_msgs
image_transport
tf2
tf2_eigen
tf2_ros
laser_geometry
message_filters
class_loader
visualization_msgs
image_geometry
stereo_msgs
tf2_geometry_msgs
pcl_ros
pcl_msgs
perception_pcl
RTABMap
rtabmap_ros
)
find_package(cslam_common_interfaces REQUIRED)
find_package(cslam_common_interfaces REQUIRED)
# add_executable(pose_graph_manager
# src/back_end/decentralized_pgo.cpp
# src/back_end/pose_graph_manager_node.cpp
# src/back_end/gtsam_utils.cpp)
# add_dependencies(pose_graph_manager
# pose_graph_manager
# ${${PROJECT_NAME}_EXPORTED_TARGETS})
# ament_target_dependencies(pose_graph_manager
# ${Libraries}
# cslam_common_interfaces cslam_common_interfaces)
# target_link_libraries(pose_graph_manager gtsam)
# set_target_properties(pose_graph_manager
# PROPERTIES OUTPUT_NAME "pose_graph_manager")
# Only required when using messages built from the same package
# https://index.ros.org/doc/ros2/Tutorials/Rosidl-Tutorial/
get_default_rmw_implementation(rmw_implementation)
find_package("${rmw_implementation}" REQUIRED)
get_rmw_typesupport(typesupport_impls "${rmw_implementation}" LANGUAGE "cpp")
## Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION include/${PROJECT_NAME}
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
)
install(DIRECTORY
launch
config
DESTINATION share/${PROJECT_NAME}/
)
# Install nodes
# install(
# TARGETS map_manager pose_graph_manager
# DESTINATION lib/${PROJECT_NAME}
# )
# Install Python modules
ament_python_install_package(${PROJECT_NAME})
install(PROGRAMS
cslam_visualization/visualization_node.py
DESTINATION lib/${PROJECT_NAME})
ament_package()