-
Notifications
You must be signed in to change notification settings - Fork 0
/
joint_matching.cpp
585 lines (508 loc) · 18.8 KB
/
joint_matching.cpp
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
#include "joint_matching.hpp"
namespace gicp_mapping{
template <typename PointT>
joint_matching<PointT>::joint_matching(int max_iter_in, int max_iter_GN_in)
: source_pln_(new PointCloudType<PointT>),
target_pln_(new PointCloudType<PointT>),
source_gnd_(new PointCloudType<PointT>),
target_gnd_(new PointCloudType<PointT>),
source_pln_voxel_(new PointCloudType<PointT>),
target_pln_voxel_(new PointCloudType<PointT>){
OMP_NUM = omp_get_max_threads();
Eigen::initParallel();
Eigen::setNbThreads(OMP_NUM);
initPt.x = -50;
initPt.y = -50;
initPt.z = -50;
// set max iters for debugging.
max_iter_ = max_iter_in;
max_iter_GN_ = max_iter_GN_in;
fst_iter_GN_ = max_iter_GN_in;
source_pln_tree_.reset(new KDTreeType<PointT>);
target_pln_tree_.reset(new KDTreeType<PointT>);
source_covs_ = new covVec;
target_covs_ = new covVec;
source_gnd_tree_.reset(new KDTreeType<PointT>);
target_gnd_tree_.reset(new KDTreeType<PointT>);
}
template <typename PointT>
void joint_matching<PointT>::setInputSource(PointCloudTypePtr<PointT> input_cloud){
PointCloudTypePtr<PointT> source_voxel(new PointCloudType<PointT>);
PointCloudTypePtr<PointT> source_in(new PointCloudType<PointT>);
PointCloudTypePtr<PointT> raw_cloud(new PointCloudType<PointT>);
raw_cloud = input_cloud;
*source_pln_voxel_ = *input_cloud;
RegionGPFSegmenter<PointT> ground_remover;
// ground_remover.segment_threads(*raw_cloud, source_gnd_, source_in);
auto start = high_resolution_clock::now();
ground_remover.segment(*raw_cloud, source_gnd_, source_in);
auto end = high_resolution_clock::now();
auto duration = duration_cast<milliseconds>(end - start);
ground_time.push_back(duration.count());
source_gnd_tree_->setInputCloud(source_gnd_);
source_pln_tree_->setInputCloud(source_in);
start = high_resolution_clock::now();
voxelFiltering(source_in, source_voxel);
computeCovariances(source_voxel, source_pln_, source_pln_tree_, source_covs_);
end = high_resolution_clock::now();
duration = duration_cast<milliseconds>(end - start);
voxel_time.push_back(duration.count());
}
template <typename PointT>
void joint_matching<PointT>::setInputTarget(PointCloudTypePtr<PointT> input_cloud){
PointCloudTypePtr<PointT> target_voxel(new PointCloudType<PointT>);
PointCloudTypePtr<PointT> target_in(new PointCloudType<PointT>);
PointCloudTypePtr<PointT> raw_cloud(new PointCloudType<PointT>);
raw_cloud = input_cloud;
*target_pln_voxel_ = *input_cloud;
RegionGPFSegmenter<PointT> ground_remover;
// ground_remover.segment_threads(*raw_cloud, target_gnd_, target_in);
ground_remover.segment(*raw_cloud, target_gnd_, target_in);
target_gnd_tree_->setInputCloud(target_gnd_);
target_pln_tree_->setInputCloud(target_in);
voxelFiltering(target_in, target_voxel);
computeCovariances(target_voxel, target_pln_, target_pln_tree_, target_covs_);
}
template <typename PointT>
bool joint_matching<PointT>::align(Sophus::SE3f initial_guess){
T0_ = initial_guess;
bool converged = false;
int iters = 0;
int gn_iter = 0;
PointCloudTypePtr<PointT> source_pln_transformed(new PointCloudType<PointT>);
PointCloudTypePtr<PointT> source_gnd_transformed(new PointCloudType<PointT>);
T1_ = T0_;
while (iters < max_iter_ && !converged){
std::cout << "Current GICP Iter: " << iters << std::endl;
pcl::transformPointCloud(*source_pln_, *source_pln_transformed, T1_.matrix());
pcl::transformPointCloud(*source_gnd_, *source_gnd_transformed, T1_.matrix());
gn_iter = 0;
bool gn_converged = false;
int iter_GN_num = max_iter_GN_;
if (iters == 0)
iter_GN_num = fst_iter_GN_;
while (gn_iter < iter_GN_num && !gn_converged){
pcl::transformPointCloud(*source_pln_, *source_pln_transformed, T1_.matrix());
pcl::transformPointCloud(*source_gnd_, *source_gnd_transformed, T1_.matrix());
// Ax = b Least Square Problem for lie-se(3), R^6 vector.
std::vector<Eigen::Matrix<float, 6, 6>> A_omp_list;
std::vector<Eigen::Matrix<float, 6, 1>> b_omp_list;
int pln_count = source_pln_->size();
int gnd_count = source_gnd_->size();
A_omp_list.resize(pln_count+gnd_count, Eigen::Matrix<float, 6, 6>::Zero());
b_omp_list.resize(pln_count+gnd_count, Eigen::Matrix<float, 6, 1>::Zero());
#pragma omp parallel for num_threads(OMP_NUM)
for (int i = 0; i < pln_count; i++){
pln2pln_step(
i, source_pln_transformed,
target_pln_tree_,
target_covs_,
source_covs_,
A_omp_list, b_omp_list
);
}
#pragma omp parallel for num_threads(OMP_NUM)
for (int j = 0; j < gnd_count; j++){
localPlaneStep(
j, pln_count, gnd_weights_,
source_gnd_transformed,
target_gnd_tree_,
A_omp_list, b_omp_list
);
}
Eigen::Matrix<float, 6, 6> A = Eigen::Matrix<float, 6, 6>::Zero();
Eigen::Matrix<float, 6, 1> b = Eigen::Matrix<float, 6, 1>::Zero();
assert(A_omp_list.size() == b_omp_list.size());
#pragma omp declare reduction( + : Eigen::Matrix<float, 6, 6> : omp_out += omp_in ) \
initializer( omp_priv = Eigen::Matrix<float, 6, 6>::Zero() )
#pragma omp declare reduction( + : Eigen::Matrix<float, 6, 1> : omp_out += omp_in ) \
initializer( omp_priv = Eigen::Matrix<float, 6, 1>::Zero() )
#pragma omp parallel for num_threads(OMP_NUM) reduction(+ : A) reduction(+ : b) schedule(guided, 8)
for (int i = 0; i < A_omp_list.size(); i++){
A += A_omp_list[i];
b += b_omp_list[i];
}
Eigen::LDLT<Eigen::Matrix<float, 6, 6>> solver(A);
Eigen::Matrix<float, 6, 1> delta_xi = solver.solve(b);
T1_ = Sophus::SE3f::exp(delta_xi) * T1_;
gn_converged = is_converged(Sophus::SE3f::exp(delta_xi).matrix());
gn_iter += 1;
}
std::cout << "Gauss-Newton Iteration: " << gn_iter << std::endl;
// 3. GICP converged?
// if converged: exit loop.
// else: T0 = T1, once again.
if (is_converged((T0_.inverse() * T1_).matrix())){
converged = true;
}
else{
T0_ = T1_;
}
iters += 1;
}
std::cout << "GICP Iterations: " << iters << std::endl;
converged = true;
if (iters == max_iter_ && gn_iter == max_iter_GN_)
converged = false;
return converged;
}
/*/
* Scan-to-Map member functions.
/*/
template <typename PointT>
void joint_matching<PointT>::getSourcePln(PointCloudType<PointT> &cloud_out)
{
pcl::copyPointCloud(*source_pln_voxel_, cloud_out);
}
template <typename PointT>
void joint_matching<PointT>::getTargetPln(PointCloudType<PointT> &cloud_out)
{
pcl::copyPointCloud(*target_pln_voxel_, cloud_out);
}
template <typename PointT>
void joint_matching<PointT>::getSourcePln(
PointCloudType<PointT> &cloud_out,
covVec &covs_out
)
{
assert(cloud_out.size() == 0 && "Container cloud is not empty!");
assert(covs_out.size() == 0 && "Container covs vector is not empty!");
pcl::copyPointCloud(*source_pln_, cloud_out);
covs_out = *source_covs_;
int pln_size = source_pln_->size();
assert(cloud_out.size() == pln_size && "cloud copy error!");
assert(covs_out.size() == pln_size && "covariance error!");
}
template <typename PointT>
void joint_matching<PointT>::getTargetPln(
PointCloudType<PointT> &cloud_out,
covVec &covs_out
)
{
assert(cloud_out.size() == 0 && "Container cloud is not empty!");
assert(covs_out.size() == 0 && "Container covs vector is not empty!");
pcl::copyPointCloud(*target_pln_, cloud_out);
covs_out = *target_covs_;
int pln_size = target_pln_->size();
assert(cloud_out.size() == pln_size && "cloud copy error!");
assert(covs_out.size() == pln_size && "covariance error!");
}
template <typename PointT>
void joint_matching<PointT>::getSourceGnd(
PointCloudType<PointT> &cloud_out
)
{
assert(cloud_out.size() == 0 && "Container cloud is not empty!");
pcl::copyPointCloud(*source_gnd_, cloud_out);
int gnd_size = source_gnd_->size();
assert(cloud_out.size() == gnd_size && "cloud copy error!");
}
template <typename PointT>
void joint_matching<PointT>::getTargetGnd(
PointCloudType<PointT> &cloud_out
)
{
assert(cloud_out.size() == 0 && "Container cloud is not empty!");
pcl::copyPointCloud(*target_gnd_, cloud_out);
int gnd_size = target_gnd_->size();
assert(cloud_out.size() == gnd_size && "cloud copy error!");
}
/*/
/*/
template <typename PointT>
void joint_matching<PointT>::setSourcePln(
const PointCloudType<PointT> &cloud_in,
const covVec &covs_in
)
{
pcl::copyPointCloud(cloud_in, *source_pln_);
*source_covs_ = covs_in;
source_pln_tree_->setInputCloud(source_pln_);
}
template <typename PointT>
void joint_matching<PointT>::setTargetPln(
const PointCloudType<PointT> &cloud_in,
const covVec &covs_in
)
{
pcl::copyPointCloud(cloud_in, *target_pln_);
*target_covs_ = covs_in;
target_pln_tree_->setInputCloud(target_pln_);
}
template <typename PointT>
void joint_matching<PointT>::setSourceGnd(
const PointCloudType<PointT> &cloud_in
)
{
pcl::copyPointCloud(cloud_in, *source_gnd_);
source_gnd_tree_->setInputCloud(source_gnd_);
}
template <typename PointT>
void joint_matching<PointT>::setTargetGnd(
const PointCloudType<PointT> &cloud_in
)
{
pcl::copyPointCloud(cloud_in, *target_gnd_);
target_gnd_tree_->setInputCloud(target_gnd_);
}
/*/
* optimization objectives.
/*/
template <typename PointT>
void joint_matching<PointT>::localPlaneStep(
int index, int start, float gnd_weight,
PointCloudTypePtr<PointT> source_gnd_t,
KDTreeTypePtr<PointT> target_gnd_tree,
std::vector<Eigen::Matrix<float, 6, 6>> &A_vec,
std::vector<Eigen::Matrix<float, 6, 1>> &b_vec){
std::vector<int> nn_id;
std::vector<float> nn_dist;
int local_num = target_gnd_tree->nearestKSearch(source_gnd_t->at(index), 5, nn_id, nn_dist);
if (local_num <= 3)
return;
Eigen::Vector3f centroid(0, 0, 0);
std::vector<Eigen::Vector3f> pt_list;
for (auto& id : nn_id){
Eigen::Vector3f pt = Eigen::Vector3f(
target_gnd_tree->getInputCloud()->at(id).x,
target_gnd_tree->getInputCloud()->at(id).y,
target_gnd_tree->getInputCloud()->at(id).z
);
centroid += pt;
pt_list.push_back(pt);
}
centroid /= local_num;
float xx = 0.0, xy = 0.0, xz = 0.0, yy = 0.0, yz = 0.0, zz = 0.0;
for (auto& pt : pt_list){
Eigen::Vector3f norm_pt = pt - centroid;
xx += norm_pt(0) * norm_pt(0);
xy += norm_pt(0) * norm_pt(1);
xz += norm_pt(0) * norm_pt(2);
yy += norm_pt(1) * norm_pt(1);
yz += norm_pt(1) * norm_pt(2);
zz += norm_pt(2) * norm_pt(2);
}
xx /= local_num;
xy /= local_num;
xz /= local_num;
yy /= local_num;
yz /= local_num;
zz /= local_num;
Eigen::Vector3f weighted_dir(0, 0, 0);
{
float det_x = yy*zz - yz*yz;
Eigen::Vector3f axis_dir = Eigen::Vector3f(det_x, xz*yz - xy*zz, xy*yz - xz*yy);
float weight = det_x * det_x;
if (weighted_dir.dot(axis_dir) < 0.0)
weight = -weight;
weighted_dir += axis_dir * weight;
}
{
float det_y = xx*zz - xz*xz;
Eigen::Vector3f axis_dir = Eigen::Vector3f(xz*yz - xy*zz, det_y, xy*xz - yz*xx);
float weight = det_y * det_y;
if (weighted_dir.dot(axis_dir) < 0.0)
weight = -weight;
weighted_dir += axis_dir*weight;
}
{
float det_z = xx*yy - xy*xy;
Eigen::Vector3f axis_dir = Eigen::Vector3f(xy*yz - xz*yy, xy*xz - yz*xx, det_z);
float weight = det_z * det_z;
if (weighted_dir.dot(axis_dir) < 0.0)
weight = -weight;
weighted_dir += axis_dir * weight;
}
float norm = weighted_dir.norm();
if (norm == 0)
return;
weighted_dir.normalize();
float d = -weighted_dir.dot(centroid);
int source_idx = index;
Eigen::Vector3f pt_s = Eigen::Vector3f(
source_gnd_t->at(source_idx).x,
source_gnd_t->at(source_idx).y,
source_gnd_t->at(source_idx).z
);
float residual = weighted_dir.dot(pt_s) + d;
Eigen::Matrix<float, 3, 6> J = Eigen::Matrix<float, 3, 6>::Zero();
J.block<3, 3>(0, 0) = Eigen::Matrix3f::Identity();
J.block<3, 3>(0, 3) = -Sophus::SO3f::hat(pt_s);
Eigen::Matrix<float, 1, 6> J1 = weighted_dir.transpose() * J;
J1 *= gnd_weight;
residual *= gnd_weight;
A_vec[index + start] += J1.transpose() * J1;
b_vec[index + start] += -J1.transpose() * residual;
}
template <typename PointT>
void joint_matching<PointT>::pln2pln_step(
int index, PointCloudTypePtr<PointT> source_t,
KDTreeTypePtr<PointT> target_cloud_tree,
covVecPtr target_covariances,
covVecPtr source_covariances,
std::vector<Eigen::Matrix<float, 6, 6>> &A_vec,
std::vector<Eigen::Matrix<float, 6, 1>> &b_vec){
std::vector<int> nn_id;
std::vector<float> nn_dist;
target_cloud_tree->nearestKSearch(source_t->at(index), 1, nn_id, nn_dist);
int source_idx = index ;
int target_idx = nn_id[0];
if (!corresRejector(nn_dist[0])){
return;
}
// Current nonlinear least square block.
Eigen::Matrix<float, 6, 6> A_i = Eigen::Matrix<float, 6, 6>::Zero();
Eigen::Matrix<float, 6, 1> b_i = Eigen::Matrix<float, 6, 1>::Zero();
// Derivative of SE(3) on Manifold, following Sophus definition.
Eigen::Matrix<float, 3, 6> J = Eigen::Matrix<float, 3, 6>::Zero();
J.block<3, 3>(0, 3) = Sophus::SO3f::hat(
Eigen::Vector3f(
source_t->at(source_idx).x,
source_t->at(source_idx).y,
source_t->at(source_idx).z)
);
J.block<3, 3>(0, 0) = -Eigen::Matrix3f::Identity();
Eigen::Vector3f tbi(source_t->at(source_idx).x,
source_t->at(source_idx).y,
source_t->at(source_idx).z);
// Constructing GICP costs.
Eigen::Matrix3f R = T1_.matrix().block<3, 3>(0, 0);
Eigen::Matrix3f Sigma = target_covariances->at(target_idx) + R * source_covariances->at(source_idx) * R.transpose();
Eigen::Matrix3f L(Sigma.llt().matrixL());
Eigen::Matrix3f invL = L.inverse();
// Jacobian of df/d delta_xi of GICP cost.
Eigen::Matrix<float, 3, 6> J1 = invL * J; // 3 x 6.
PointT mi_pt = target_cloud_tree->getInputCloud()->at(target_idx);
Eigen::Vector3f mi(mi_pt.x, mi_pt.y, mi_pt.z);
Eigen::Vector3f f1 = invL * (mi - tbi);
A_vec[index] += J1.transpose() * J1;
b_vec[index] += -J1.transpose() * f1;
}
template <typename PointT>
void joint_matching<PointT>::computeCovariances(
PointCloudTypePtr<PointT> cloud_in,
PointCloudTypePtr<PointT> cloud_out,
KDTreeTypePtr<PointT> cloud_tree,
covVecPtr pt_covs){
if (pt_covs->size() != 0)
pt_covs->clear();
cloud_out->points.resize(cloud_in->size(), initPt);
pt_covs->resize(cloud_in->size(), Eigen::Matrix3f::Zero());
Eigen::Vector3f eig_p2p(1, 1, 0.001);
#pragma omp parallel for num_threads(OMP_NUM)
for (int i = 0; i < cloud_in->size(); i++){
std::vector<int> nn_idx(nn_k_);
std::vector<float> nn_dists(nn_k_);
int nn_num = cloud_tree->nearestKSearch(cloud_in->at(i), nn_k_, nn_idx, nn_dists);
Eigen::MatrixXf D = Eigen::MatrixXf::Zero(3, nn_num);
Eigen::Matrix3f covD = Eigen::Matrix3f::Zero();
for (int j = 0; j < nn_num; j++){
D(0, j) = cloud_tree->getInputCloud()->at(nn_idx[j]).x;
D(1, j) = cloud_tree->getInputCloud()->at(nn_idx[j]).y;
D(2, j) = cloud_tree->getInputCloud()->at(nn_idx[j]).z;
}
Eigen::MatrixXf D_centered = D.colwise() - D.rowwise().mean();
covD = (D_centered * D_centered.transpose()) / float(nn_num);
Eigen::JacobiSVD<Eigen::Matrix3f> svd(covD, Eigen::ComputeFullU | Eigen::ComputeFullV);
Eigen::Matrix3f C_a_i = svd.matrixU() * eig_p2p.asDiagonal() * svd.matrixV().transpose();
float curve = std::abs(svd.singularValues()(0) / svd.singularValues()(2));
Eigen::Vector3f normal_vector = svd.matrixU().col(2);
PointT currPt;
if (keep_uniform_){
if (curve <= curv_eps_){
C_a_i = covD;
}
currPt.x = cloud_in->points[i].x;
currPt.y = cloud_in->points[i].y;
currPt.z = cloud_in->points[i].z;
}
else{
if (curve <= curv_eps_){
currPt.x = initPt.x;
currPt.y = initPt.y;
currPt.z = initPt.z;
}
else{
currPt.x = cloud_in->points[i].x;
currPt.y = cloud_in->points[i].y;
currPt.z = cloud_in->points[i].z;
}
}
pt_covs->at(i) = C_a_i;
cloud_out->points[i].x = currPt.x;
cloud_out->points[i].y = currPt.y;
cloud_out->points[i].z = currPt.z;
nn_idx.clear();
nn_dists.clear();
}
if (!keep_uniform_){
int j = 0;
for (int i = 0; i < cloud_in->size(); i++){
if (!pointValid(cloud_out->at(i)))
continue;
cloud_out->at(j) = cloud_out->at(i);
pt_covs->at(j) = pt_covs->at(i);
j++;
}
if (j != cloud_in->size()){
cloud_out->resize(j);
pt_covs->resize(j);
}
}
cloud_tree->setInputCloud(cloud_out);
}
template <typename PointT>
bool joint_matching<PointT>::is_converged(const Eigen::Matrix4f &delta){
/*
To determine Gauss-Newton optimization convergence by update se(3).
From V-GICP codes.
*/
Eigen::Matrix3f R = delta.block<3, 3>(0, 0) - Eigen::Matrix3f::Identity();
Eigen::Vector3f t = delta.block<3, 1>(0, 3);
Eigen::Matrix3f r_delta = 1.0 / rot_eps_ * R.array().abs();
Eigen::Vector3f t_delta = 1.0 / trans_eps_ * t.array().abs();
return std::max(r_delta.maxCoeff(), t_delta.maxCoeff()) < 1;
}
template<typename PointT>
void joint_matching<PointT>::voxelFiltering(PointCloudTypePtr<PointT> raw_cloud,
PointCloudTypePtr<PointT> cloud){
pcl::ApproximateVoxelGrid<PointT> vg;
vg.setLeafSize (voxel_size_x_, voxel_size_y_, voxel_size_z_);
vg.setInputCloud(raw_cloud);
vg.filter(*cloud);
}
template <typename PointT>
void joint_matching<PointT>::setNextTarget(){
source_pln_->swap(*target_pln_);
source_gnd_->swap(*target_gnd_);
target_pln_tree_->setInputCloud(target_pln_);
target_gnd_tree_->setInputCloud(target_gnd_);
source_covs_->swap(*target_covs_);
// source_cov_filter.swap(target_cov_filter);
// source_gnd_info_.swap(target_gnd_info_);
source_clear();
}
template <typename PointT>
void joint_matching<PointT>::target_clear(){
target_pln_->clear();
target_gnd_->clear();
target_pln_voxel_->clear();
target_covs_->clear();
// target_gnd_info_.clear();
target_pln_tree_.reset(new KDTreeType<PointT>);
target_gnd_tree_.reset(new KDTreeType<PointT>);
}
template <typename PointT>
void joint_matching<PointT>::source_clear(){
source_pln_->clear();
source_gnd_->clear();
source_pln_voxel_->clear();
source_covs_->clear();
// source_gnd_info_.clear();
source_pln_tree_.reset(new KDTreeType<PointT>);
source_gnd_tree_.reset(new KDTreeType<PointT>);
}
template class joint_matching<pcl::PointXYZ>;
template class joint_matching<pcl::PointXYZRGB>;
template class joint_matching<pcl::PointXYZI>;
}