-
Notifications
You must be signed in to change notification settings - Fork 24
/
CMakeLists.txt
166 lines (141 loc) · 4.27 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
cmake_minimum_required(VERSION 3.0.2)
project(clic)
set(CMAKE_BUILD_TYPE "Release")
#set(CMAKE_CXX_FLAGS "-std=c++17")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -msse4.2")
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}")
endif()
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
sensor_msgs
geometry_msgs
nav_msgs
visualization_msgs
eigen_conversions
pcl_conversions
pcl_ros
cv_bridge
roslib
rosbag
tf
message_generation
)
find_package(Eigen3 REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(Ceres REQUIRED)
# find_package(Sophus REQUIRED) # sophus has been included in clic/src/sophus_lib
find_package(OpenCV REQUIRED)
# find_package(PkgConfig REQUIRED)
# pkg_check_modules(YAML_CPP REQUIRED yaml-cpp>=0.5)
## Generate messages in the 'msg' folder
add_message_files(
FILES
feature_cloud.msg
imu_array.msg
pose_array.msg
)
generate_messages(
DEPENDENCIES
std_msgs
sensor_msgs
)
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS src
# LIBRARIES clic
CATKIN_DEPENDS std_msgs
# DEPENDS system_lib
)
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
src
${catkin_INCLUDE_DIRS}
${YAML_INCLUDE_DIRS}
${CERES_INCLUDE_DIRS}
# ${Sophus_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
)
list(APPEND thirdparty_libraries
${YAML_CPP_LIBRARIES}
${Boost_LIBRARIES}
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${OpenCV_LIBS}
${CERES_LIBRARIES}
)
######################
### Library
######################
# Continuous Time Trajectory
add_library(spline_lib src/spline/trajectory.cpp)
target_link_libraries(spline_lib ${thirdparty_libraries})
# LiDAR Odometry
file(GLOB lidar_odometry_files
"src/lidar_odometry/*.cpp"
)
add_library(lidar_lib ${lidar_odometry_files})
target_link_libraries(lidar_lib spline_lib ${thirdparty_libraries})
file(GLOB visual_feature_files
"src/visual_odometry/visual_feature/*.cpp"
"src/visual_odometry/visual_feature/camera_models/*.cc"
)
add_library(feature_tracker_lib ${visual_feature_files})
target_link_libraries(feature_tracker_lib ${thirdparty_libraries})
# Visual Odometry
file(GLOB visual_odometry_files
"src/visual_odometry/*.cpp"
"src/visual_odometry/initial/*.cpp"
)
add_library(visual_lib ${visual_odometry_files})
target_link_libraries(visual_lib spline_lib ${thirdparty_libraries})
######################
### Nodes
######################
# Visual Feature Tracker
add_executable(feature_tracker ${visual_feature_files})
target_link_libraries(feature_tracker ${thirdparty_libraries})
# Estimator
add_executable(odometry_node
src/app/odometry_node.cpp
src/inertial/imu_state_estimator.cpp
src/inertial/inertial_initializer.cpp
src/estimator/msg_manager.cpp
src/estimator/trajectory_manager.cpp
src/estimator/trajectory_estimator.cpp
src/estimator/odometry_manager.cpp
src/estimator/factor/analytic_diff/marginalization_factor.cpp
src/utils/parameter_struct.cpp
src/loop_closure/loop_closure.cpp
src/loop_closure/pose_graph.cpp
)
target_link_libraries(odometry_node
spline_lib
lidar_lib
visual_lib
feature_tracker_lib
${thirdparty_libraries}
)
# About bag
add_executable(recovery_vlp16_timestamp src/app/recovery_vlp16_timestamp.cpp)
target_link_libraries(recovery_vlp16_timestamp lidar_lib ${thirdparty_libraries})
# Test
add_executable(test_analytic_factor
src/app/test_analytic_factor.cpp
src/utils/parameter_struct.cpp
src/visual_odometry/parameters.cpp)
target_link_libraries(test_analytic_factor spline_lib ${thirdparty_libraries})