@@ -2,29 +2,32 @@ cmake_minimum_required(VERSION 2.8.3)
2
2
project (fuse_constraints)
3
3
4
4
set (build_depends
5
- geometry_msgs
6
5
fuse_core
7
6
fuse_variables
7
+ geometry_msgs
8
8
roscpp
9
9
)
10
10
11
11
find_package (catkin REQUIRED COMPONENTS
12
12
${build_depends}
13
13
)
14
14
15
+ list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} /cmake)
15
16
find_package (Ceres REQUIRED)
16
17
find_package (Eigen3 REQUIRED)
18
+ find_package (SuiteSparse REQUIRED COMPONENTS CCOLAMD)
17
19
18
20
catkin_package(
19
21
INCLUDE_DIRS
20
22
include
21
- ${CERES_INCLUDE_DIRS}
22
- ${EIGEN3_INCLUDE_DIRS}
23
23
LIBRARIES
24
24
${PROJECT_NAME}
25
- ${CERES_LIBRARIES}
26
25
CATKIN_DEPENDS
27
26
${build_depends}
27
+ DEPENDS
28
+ CERES
29
+ EIGEN3
30
+ SUITESPARSE
28
31
)
29
32
30
33
###########
@@ -41,6 +44,7 @@ add_library(${PROJECT_NAME}
41
44
src/absolute_pose_3d_stamped_constraint.cpp
42
45
src/marginal_constraint.cpp
43
46
src/marginal_cost_function.cpp
47
+ src/marginalize_variables.cpp
44
48
src/normal_delta.cpp
45
49
src/normal_delta_orientation_2d.cpp
46
50
src/normal_prior_orientation_2d.cpp
@@ -59,10 +63,13 @@ target_include_directories(${PROJECT_NAME}
59
63
${catkin_INCLUDE_DIRS}
60
64
${CERES_INCLUDE_DIRS}
61
65
${EIGEN3_INCLUDE_DIRS}
66
+ ${SUITESPARSE_INCLUDE_DIRS}
62
67
)
63
68
target_link_libraries (${PROJECT_NAME}
64
69
${catkin_LIBRARIES}
65
70
${CERES_LIBRARIES}
71
+ ${EIGEN3_LIBRARIES}
72
+ ${SUITESPARSE_LIBRARIES}
66
73
)
67
74
68
75
#############
@@ -87,6 +94,7 @@ install(DIRECTORY include/${PROJECT_NAME}/
87
94
if (CATKIN_ENABLE_TESTING)
88
95
find_package (roslint REQUIRED)
89
96
find_package (rostest REQUIRED)
97
+ find_package (fuse_graphs REQUIRED)
90
98
91
99
# Lint tests
92
100
set (ROSLINT_CPP_OPTS "--filter=-build/c++11,-runtime/references" )
@@ -105,7 +113,6 @@ if(CATKIN_ENABLE_TESTING)
105
113
include
106
114
${catkin_INCLUDE_DIRS}
107
115
${CERES_INCLUDE_DIRS}
108
- ${EIGEN3_INCLUDE_DIRS}
109
116
)
110
117
target_link_libraries (test_absolute_constraint
111
118
${PROJECT_NAME}
@@ -130,6 +137,8 @@ if(CATKIN_ENABLE_TESTING)
130
137
target_link_libraries (test_absolute_orientation_3d_stamped_constraint
131
138
${PROJECT_NAME}
132
139
${catkin_LIBRARIES}
140
+ ${CERES_LIBRARIES}
141
+ ${EIGEN3_LIBRARIES}
133
142
)
134
143
135
144
# Absolute Orientation 3D Stamped Euler Constraint Tests
@@ -149,6 +158,8 @@ if(CATKIN_ENABLE_TESTING)
149
158
target_link_libraries (test_absolute_orientation_3d_stamped_euler_constraint
150
159
${PROJECT_NAME}
151
160
${catkin_LIBRARIES}
161
+ ${CERES_LIBRARIES}
162
+ ${EIGEN3_LIBRARIES}
152
163
)
153
164
154
165
# Absolute Pose 2D Stamped Constraint Tests
@@ -163,11 +174,11 @@ if(CATKIN_ENABLE_TESTING)
163
174
include
164
175
${catkin_INCLUDE_DIRS}
165
176
${CERES_INCLUDE_DIRS}
166
- ${EIGEN3_INCLUDE_DIRS}
167
177
)
168
178
target_link_libraries (test_absolute_pose_2d_stamped_constraint
169
179
${PROJECT_NAME}
170
180
${catkin_LIBRARIES}
181
+ ${CERES_LIBRARIES}
171
182
)
172
183
173
184
# Absolute Pose 3D Stamped Constraint Tests
@@ -182,11 +193,11 @@ if(CATKIN_ENABLE_TESTING)
182
193
include
183
194
${catkin_INCLUDE_DIRS}
184
195
${CERES_INCLUDE_DIRS}
185
- ${EIGEN3_INCLUDE_DIRS}
186
196
)
187
197
target_link_libraries (test_absolute_pose_3d_stamped_constraint
188
198
${PROJECT_NAME}
189
199
${catkin_LIBRARIES}
200
+ ${CERES_LIBRARIES}
190
201
)
191
202
192
203
# Marginal Constraint Tests
@@ -206,6 +217,25 @@ if(CATKIN_ENABLE_TESTING)
206
217
${catkin_LIBRARIES}
207
218
)
208
219
220
+ # Marginalize Variables Tests
221
+ catkin_add_gtest(test_marginalize_variables
222
+ test /test_marginalize_variables.cpp
223
+ )
224
+ add_dependencies (test_marginalize_variables
225
+ ${catkin_EXPORTED_TARGETS}
226
+ )
227
+ target_include_directories (test_marginalize_variables
228
+ PRIVATE
229
+ include
230
+ ${CERES_INCLUDE_DIRS}
231
+ ${fuse_graphs_INCLUDE_DIRS}
232
+ )
233
+ target_link_libraries (test_marginalize_variables
234
+ ${PROJECT_NAME}
235
+ ${catkin_LIBRARIES}
236
+ ${fuse_graphs_LIBRARIES}
237
+ )
238
+
209
239
# Relative Constraint Tests
210
240
catkin_add_gtest(test_relative_constraint
211
241
test /test_relative_constraint.cpp
@@ -218,7 +248,6 @@ if(CATKIN_ENABLE_TESTING)
218
248
include
219
249
${catkin_INCLUDE_DIRS}
220
250
${CERES_INCLUDE_DIRS}
221
- ${EIGEN3_INCLUDE_DIRS}
222
251
)
223
252
target_link_libraries (test_relative_constraint
224
253
${PROJECT_NAME}
@@ -238,11 +267,11 @@ if(CATKIN_ENABLE_TESTING)
238
267
include
239
268
${catkin_INCLUDE_DIRS}
240
269
${CERES_INCLUDE_DIRS}
241
- ${EIGEN3_INCLUDE_DIRS}
242
270
)
243
271
target_link_libraries (test_relative_pose_2d_stamped_constraint
244
272
${PROJECT_NAME}
245
273
${catkin_LIBRARIES}
274
+ ${CERES_LIBRARIES}
246
275
)
247
276
248
277
# Relative Pose 3D Stamped Constraint Tests
@@ -257,11 +286,11 @@ if(CATKIN_ENABLE_TESTING)
257
286
include
258
287
${catkin_INCLUDE_DIRS}
259
288
${CERES_INCLUDE_DIRS}
260
- ${EIGEN3_INCLUDE_DIRS}
261
289
)
262
290
target_link_libraries (test_relative_pose_3d_stamped_constraint
263
291
${PROJECT_NAME}
264
292
${catkin_LIBRARIES}
293
+ ${CERES_LIBRARIES}
265
294
)
266
295
267
296
# UuidOrdering Tests
0 commit comments