19 #include "glog/logging.h" 22 namespace mapping_2d {
23 namespace scan_matching {
33 CHECK(best_pose_estimate !=
nullptr)
34 <<
"Need a non-null output_pose_estimate!";
35 CHECK(best_score !=
nullptr) <<
"Need a non-null best_score!";
39 voxel_filter.
Filter(point_cloud);
41 if (matchers.size() == 0) {
42 LOG(WARNING) <<
"Map not yet large enough to localize in!";
45 for (
auto& matcher : matchers) {
48 if (matcher->MatchFullSubmap(filtered_point_cloud, *best_score, &score,
50 CHECK_GT(score, *best_score) <<
"MatchFullSubmap lied!";
52 *best_pose_estimate = pose_estimate;
bool PerformGlobalLocalization(const float cutoff, const cartographer::sensor::AdaptiveVoxelFilter &voxel_filter, const std::vector< cartographer::mapping_2d::scan_matching::FastCorrelativeScanMatcher * > &matchers, const cartographer::sensor::PointCloud &point_cloud, transform::Rigid2d *const best_pose_estimate, float *const best_score)
PointCloud Filter(const PointCloud &point_cloud) const
std::vector< Eigen::Vector3f > PointCloud