forked from cra-ros-pkg/robot_localization
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
188 lines (157 loc) · 5.14 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
cmake_minimum_required(VERSION 3.5)
project(robot_localization)
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
endif()
find_package(ament_cmake REQUIRED)
find_package(angles REQUIRED)
find_package(rclcpp REQUIRED)
#find_package(geographic_msgs REQUIRED)
find_package(diagnostic_msgs REQUIRED)
find_package(diagnostic_updater REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(Eigen3 REQUIRED)
rosidl_generate_interfaces(${PROJECT_NAME}
#"srv/SetDatum.srv"
"srv/SetPose.srv"
DEPENDENCIES
builtin_interfaces
geometry_msgs
#geographic_msgs
diagnostic_msgs
ADD_LINTER_TESTS
)
include_directories(SYSTEM ${Eigen_INCLUDE_DIRS})
include_directories(
include
${EIGEN3_INCLUDE_DIRS}
${angles_INCLUDE_DIRS}
${rclcpp_INCLUDE_DIRS}
${geometry_msgs_INCLUDE_DIRS}
${diagnostic_msgs_INCLUDE_DIRS}
${diagnostic_updater_INCLUDE_DIRS}
${nav_msgs_INCLUDE_DIRS}
${sensor_msgs_INCLUDE_DIRS}
${tf2_ros_INCLUDE_DIRS}
${tf2_INCLUDE_DIRS}
${tf2_geometry_msgs_INCLUDE_DIRS})
add_library(
rl_lib
src/ekf.cpp
src/ukf.cpp
src/filter_base.cpp
src/filter_utilities.cpp
src/ros_filter.cpp
src/ros_filter_utilities.cpp)
rosidl_target_interfaces(rl_lib
${PROJECT_NAME} "rosidl_typesupport_cpp")
add_executable(
se_node
src/se_node.cpp
)
target_link_libraries(
rl_lib
${angles_LIBRARIES}
${EIGEN3_LIBRARIES}
${rclcpp_LIBRARIES}
${geometry_msgs_LIBRARIES}
${diagnostic_msgs_LIBRARIES}
${diagnostic_updater_LIBRARIES}
${nav_msgs_LIBRARIES}
${sensor_msgs_LIBRARIES}
${tf2_ros_LIBRARIES}
${tf2_LIBRARIES}
${tf2_geometry_msgs_LIBRARIES}
)
target_link_libraries(
se_node
rl_lib
)
install(
TARGETS
rl_lib
se_node
DESTINATION lib/${PROJECT_NAME}
)
#install(
# TARGETS ${PROJECT_NAME}
# DESTINATION lib/${PROJECT_NAME}
#)
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_cmake_cppcheck REQUIRED)
find_package(ament_cmake_cpplint REQUIRED)
find_package(ament_cmake_lint_cmake REQUIRED)
find_package(ament_cmake_uncrustify REQUIRED)
#### FILTER BASE TESTS ####
ament_add_gtest(filter_base-test test/test_filter_base.cpp)
target_link_libraries(filter_base-test rl_lib)
# This test uses se_node node for convenience.
ament_add_gtest(test_filter_base_diagnostics_timestamps
test/test_filter_base_diagnostics_timestamps.cpp)
target_link_libraries(test_filter_base_diagnostics_timestamps rl_lib)
add_dependencies(test_filter_base_diagnostics_timestamps se_node)
#### EKF TESTS ######
ament_add_gtest(test_ekf test/test_ekf.cpp)
target_link_libraries(test_ekf rl_lib)
ament_add_gtest(test_ekf_localization_node_interfaces
test/test_ekf_localization_node_interfaces.cpp)
target_link_libraries(test_ekf_localization_node_interfaces rl_lib)
ament_add_gtest(test_ekf_localization_node_bag1 test/test_localization_node_bag_pose_tester.cpp)
target_link_libraries(test_ekf_localization_node_bag1 rl_lib)
ament_add_gtest(test_ekf_localization_node_bag2 test/test_localization_node_bag_pose_tester.cpp)
target_link_libraries(test_ekf_localization_node_bag2 rl_lib)
ament_add_gtest(test_ekf_localization_node_bag3 test/test_localization_node_bag_pose_tester.cpp)
target_link_libraries(test_ekf_localization_node_bag3 rl_lib)
#### UKF TESTS #####
ament_add_gtest(test_ukf test/test_ukf.cpp)
target_link_libraries(test_ukf rl_lib)
ament_add_gtest(test_ukf_localization_node_interfaces test/test_ukf_localization_node_interfaces.cpp)
target_link_libraries(test_ukf_localization_node_interfaces rl_lib)
ament_add_gtest(test_ukf_localization_node_bag1 test/test_localization_node_bag_pose_tester.cpp)
target_link_libraries(test_ukf_localization_node_bag1 rl_lib)
ament_add_gtest(test_ukf_localization_node_bag2 test/test_localization_node_bag_pose_tester.cpp)
target_link_libraries(test_ukf_localization_node_bag2 rl_lib)
ament_add_gtest(test_ukf_localization_node_bag3 test/test_localization_node_bag_pose_tester.cpp)
target_link_libraries(test_ukf_localization_node_bag3 rl_lib)
# This forces cppcheck to consider all files in this project to be C++,
# including the headers which end with .h, which cppcheck would normally
# consider to be C instead.
ament_cppcheck(LANGUAGE "c++")
ament_cpplint()
ament_lint_cmake()
ament_uncrustify()
install(
TARGETS
filter_base-test
test_filter_base_diagnostics_timestamps
test_ekf
test_ekf_localization_node_interfaces
test_ekf_localization_node_bag1
test_ekf_localization_node_bag2
test_ekf_localization_node_bag3
test_ukf
test_ukf_localization_node_interfaces
test_ukf_localization_node_bag1
test_ukf_localization_node_bag2
test_ukf_localization_node_bag3
DESTINATION lib/${PROJECT_NAME})
endif()
ament_export_dependencies(rosidl_default_runtime)
ament_export_include_directories(include)
ament_export_libraries(
rl_lib
)
# Install params config files.
install(DIRECTORY
params
launch
DESTINATION share/${PROJECT_NAME}
)
ament_package()