diff --git a/cartographer/mapping/2d/submap_2d_test.cc b/cartographer/mapping/2d/submap_2d_test.cc index 1919d3a..3b9d41a 100644 --- a/cartographer/mapping/2d/submap_2d_test.cc +++ b/cartographer/mapping/2d/submap_2d_test.cc @@ -60,8 +60,8 @@ TEST(Submap2DTest, TheRightNumberOfRangeDataAreInserted) { "}," "project_sdf_distance_to_scan_normal = false," "update_weight_range_exponent = 0," - "update_weight_angle_scan_normal_to_ray_kernel_bandwith = 0," - "update_weight_distance_cell_to_hit_kernel_bandwith = 0," + "update_weight_angle_scan_normal_to_ray_kernel_bandwidth = 0," + "update_weight_distance_cell_to_hit_kernel_bandwidth = 0," "}," "}," "}"); diff --git a/cartographer/mapping/2d/tsdf_range_data_inserter_2d.cc b/cartographer/mapping/2d/tsdf_range_data_inserter_2d.cc index c0246a0..491be9c 100644 --- a/cartographer/mapping/2d/tsdf_range_data_inserter_2d.cc +++ b/cartographer/mapping/2d/tsdf_range_data_inserter_2d.cc @@ -111,12 +111,12 @@ proto::TSDFRangeDataInserterOptions2D CreateTSDFRangeDataInserterOptions2D( parameter_dictionary->GetBool("project_sdf_distance_to_scan_normal")); options.set_update_weight_range_exponent( parameter_dictionary->GetInt("update_weight_range_exponent")); - options.set_update_weight_angle_scan_normal_to_ray_kernel_bandwith( + options.set_update_weight_angle_scan_normal_to_ray_kernel_bandwidth( parameter_dictionary->GetDouble( - "update_weight_angle_scan_normal_to_ray_kernel_bandwith")); - options.set_update_weight_distance_cell_to_hit_kernel_bandwith( + "update_weight_angle_scan_normal_to_ray_kernel_bandwidth")); + options.set_update_weight_distance_cell_to_hit_kernel_bandwidth( parameter_dictionary->GetDouble( - "update_weight_distance_cell_to_hit_kernel_bandwith")); + "update_weight_distance_cell_to_hit_kernel_bandwidth")); return options; } @@ -137,7 +137,7 @@ void TSDFRangeDataInserter2D::Insert(const sensor::RangeData& range_data, // Compute normals if needed. bool scale_update_weight_angle_scan_normal_to_ray = - options_.update_weight_angle_scan_normal_to_ray_kernel_bandwith() != 0.f; + options_.update_weight_angle_scan_normal_to_ray_kernel_bandwidth() != 0.f; sensor::RangeData sorted_range_data = range_data; std::vector normals; if (options_.project_sdf_distance_to_scan_normal() || @@ -183,14 +183,14 @@ void TSDFRangeDataInserter2D::InsertHit( // Precompute weight factors. float weight_factor_angle_ray_normal = 1.f; - if (options_.update_weight_angle_scan_normal_to_ray_kernel_bandwith() != + if (options_.update_weight_angle_scan_normal_to_ray_kernel_bandwidth() != 0.f) { const Eigen::Vector2f negative_ray = -ray; float angle_ray_normal = common::NormalizeAngleDifference(normal - common::atan2(negative_ray)); weight_factor_angle_ray_normal = GaussianKernel( angle_ray_normal, - options_.update_weight_angle_scan_normal_to_ray_kernel_bandwith()); + options_.update_weight_angle_scan_normal_to_ray_kernel_bandwidth()); } float weight_factor_range = 1.f; if (options_.update_weight_range_exponent() != 0) { @@ -213,10 +213,10 @@ void TSDFRangeDataInserter2D::InsertHit( update_tsd = common::Clamp(update_tsd, -truncation_distance, truncation_distance); float update_weight = weight_factor_range * weight_factor_angle_ray_normal; - if (options_.update_weight_distance_cell_to_hit_kernel_bandwith() != 0.f) { + if (options_.update_weight_distance_cell_to_hit_kernel_bandwidth() != 0.f) { update_weight *= GaussianKernel( update_tsd, - options_.update_weight_distance_cell_to_hit_kernel_bandwith()); + options_.update_weight_distance_cell_to_hit_kernel_bandwidth()); } UpdateCell(cell_index, update_tsd, update_weight, tsdf); } diff --git a/cartographer/mapping/2d/tsdf_range_data_inserter_2d_test.cc b/cartographer/mapping/2d/tsdf_range_data_inserter_2d_test.cc index 5e05eca..e36ef99 100644 --- a/cartographer/mapping/2d/tsdf_range_data_inserter_2d_test.cc +++ b/cartographer/mapping/2d/tsdf_range_data_inserter_2d_test.cc @@ -40,8 +40,8 @@ class RangeDataInserterTest2DTSDF : public ::testing::Test { "}," "project_sdf_distance_to_scan_normal = false," "update_weight_range_exponent = 0," - "update_weight_angle_scan_normal_to_ray_kernel_bandwith = 0," - "update_weight_distance_cell_to_hit_kernel_bandwith = 0," + "update_weight_angle_scan_normal_to_ray_kernel_bandwidth = 0," + "update_weight_distance_cell_to_hit_kernel_bandwidth = 0," "}"); options_ = CreateTSDFRangeDataInserterOptions2D(parameter_dictionary.get()); range_data_inserter_ = absl::make_unique(options_); @@ -289,8 +289,9 @@ TEST_F(RangeDataInserterTest2DTSDF, InsertSmallAnglePointWitNormalProjection) { TEST_F(RangeDataInserterTest2DTSDF, InsertPointsWithAngleScanNormalToRayWeight) { - float bandwith = 10.f; - options_.set_update_weight_angle_scan_normal_to_ray_kernel_bandwith(bandwith); + float bandwidth = 10.f; + options_.set_update_weight_angle_scan_normal_to_ray_kernel_bandwidth( + bandwidth); range_data_inserter_ = absl::make_unique(options_); sensor::RangeData range_data; range_data.returns.push_back({Eigen::Vector3f{-0.5f, 3.5f, 0.f}}); @@ -304,7 +305,7 @@ TEST_F(RangeDataInserterTest2DTSDF, // Ray is perpendicular to surface. Eigen::Array2i cell_index = tsdf_.limits().GetCellIndex(Eigen::Vector2f(x, y)); - float expected_weight = 1.f / (std::sqrt(2 * M_PI) * bandwith); + float expected_weight = 1.f / (std::sqrt(2 * M_PI) * bandwidth); EXPECT_NEAR(expected_weight, tsdf_.GetWeight(cell_index), 1e-3); x = 6.5f; y = 4.5f; @@ -313,8 +314,8 @@ TEST_F(RangeDataInserterTest2DTSDF, // Ray is inclined relative to surface. cell_index = tsdf_.limits().GetCellIndex(Eigen::Vector2f(x, y)); float angle = std::atan(7.f / 5.f); - expected_weight = 1.f / (std::sqrt(2 * M_PI) * bandwith) * - std::exp(angle * angle / (2 * std::pow(bandwith, 2))); + expected_weight = 1.f / (std::sqrt(2 * M_PI) * bandwidth) * + std::exp(angle * angle / (2 * std::pow(bandwidth, 2))); EXPECT_NEAR(expected_weight, tsdf_.GetWeight(cell_index), 1e-3); x = 6.5f; y = 4.5f; @@ -323,8 +324,8 @@ TEST_F(RangeDataInserterTest2DTSDF, } TEST_F(RangeDataInserterTest2DTSDF, InsertPointsWithDistanceCellToHit) { - float bandwith = 10.f; - options_.set_update_weight_distance_cell_to_hit_kernel_bandwith(bandwith); + float bandwidth = 10.f; + options_.set_update_weight_distance_cell_to_hit_kernel_bandwidth(bandwidth); range_data_inserter_ = absl::make_unique(options_); InsertPoint(); const float truncation_distance = @@ -336,8 +337,8 @@ TEST_F(RangeDataInserterTest2DTSDF, InsertPointsWithDistanceCellToHit) { float expected_tsdf = std::max(std::min(3.5f - y, truncation_distance), -truncation_distance); float expected_weight = - 1.f / (std::sqrt(2 * M_PI) * bandwith) * - std::exp(std::pow(expected_tsdf, 2) / (2 * std::pow(bandwith, 2))); + 1.f / (std::sqrt(2 * M_PI) * bandwidth) * + std::exp(std::pow(expected_tsdf, 2) / (2 * std::pow(bandwidth, 2))); EXPECT_THAT(MockCellProperties(cell_index, tsdf_), EqualCellProperties(true, expected_tsdf, expected_weight)); } diff --git a/cartographer/mapping/internal/2d/pose_graph_2d_test.cc b/cartographer/mapping/internal/2d/pose_graph_2d_test.cc index f5e88ec..965ff0a 100644 --- a/cartographer/mapping/internal/2d/pose_graph_2d_test.cc +++ b/cartographer/mapping/internal/2d/pose_graph_2d_test.cc @@ -73,8 +73,8 @@ class PoseGraph2DTest : public ::testing::Test { }, project_sdf_distance_to_scan_normal = false, update_weight_range_exponent = 0, - update_weight_angle_scan_normal_to_ray_kernel_bandwith = 0, - update_weight_distance_cell_to_hit_kernel_bandwith = 0, + update_weight_angle_scan_normal_to_ray_kernel_bandwidth = 0, + update_weight_distance_cell_to_hit_kernel_bandwidth = 0, }, }, })text"); diff --git a/cartographer/mapping/internal/2d/scan_matching/real_time_correlative_scan_matcher_2d_test.cc b/cartographer/mapping/internal/2d/scan_matching/real_time_correlative_scan_matcher_2d_test.cc index 9561843..f8eef22 100644 --- a/cartographer/mapping/internal/2d/scan_matching/real_time_correlative_scan_matcher_2d_test.cc +++ b/cartographer/mapping/internal/2d/scan_matching/real_time_correlative_scan_matcher_2d_test.cc @@ -80,8 +80,8 @@ class RealTimeCorrelativeScanMatcherTest : public ::testing::Test { }, project_sdf_distance_to_scan_normal = true, update_weight_range_exponent = 0, - update_weight_angle_scan_normal_to_ray_kernel_bandwith = 0.5, - update_weight_distance_cell_to_hit_kernel_bandwith = 0.5, + update_weight_angle_scan_normal_to_ray_kernel_bandwidth = 0.5, + update_weight_distance_cell_to_hit_kernel_bandwidth = 0.5, })text"); range_data_inserter_ = absl::make_unique( CreateTSDFRangeDataInserterOptions2D(parameter_dictionary.get())); diff --git a/cartographer/mapping/internal/2d/scan_matching/tsdf_match_cost_function_2d_test.cc b/cartographer/mapping/internal/2d/scan_matching/tsdf_match_cost_function_2d_test.cc index 015ce5b..821654c 100644 --- a/cartographer/mapping/internal/2d/scan_matching/tsdf_match_cost_function_2d_test.cc +++ b/cartographer/mapping/internal/2d/scan_matching/tsdf_match_cost_function_2d_test.cc @@ -48,8 +48,8 @@ class TSDFSpaceCostFunction2DTest : public ::testing::Test { "}," "project_sdf_distance_to_scan_normal = true," "update_weight_range_exponent = 0," - "update_weight_angle_scan_normal_to_ray_kernel_bandwith = 0," - "update_weight_distance_cell_to_hit_kernel_bandwith = 0," + "update_weight_angle_scan_normal_to_ray_kernel_bandwidth = 0," + "update_weight_distance_cell_to_hit_kernel_bandwidth = 0," "}"); options_ = CreateTSDFRangeDataInserterOptions2D(parameter_dictionary.get()); range_data_inserter_ = absl::make_unique(options_); diff --git a/cartographer/mapping/proto/2d/tsdf_range_data_inserter_options_2d.proto b/cartographer/mapping/proto/2d/tsdf_range_data_inserter_options_2d.proto index a674ca3..1b61f15 100644 --- a/cartographer/mapping/proto/2d/tsdf_range_data_inserter_options_2d.proto +++ b/cartographer/mapping/proto/2d/tsdf_range_data_inserter_options_2d.proto @@ -37,11 +37,11 @@ message TSDFRangeDataInserterOptions2D { // Update weight is scaled with 1/distance(origin,hit)^range_exponent. int32 update_weight_range_exponent = 6; - // Kernel bandwith of the weight factor based on the angle between. + // Kernel bandwidth of the weight factor based on the angle between. // scan normal and ray - double update_weight_angle_scan_normal_to_ray_kernel_bandwith = 7; + double update_weight_angle_scan_normal_to_ray_kernel_bandwidth = 7; - // Kernel bandwith of the weight factor based on the distance between + // Kernel bandwidth of the weight factor based on the distance between // cell and scan observation. - double update_weight_distance_cell_to_hit_kernel_bandwith = 8; + double update_weight_distance_cell_to_hit_kernel_bandwidth = 8; } diff --git a/configuration_files/trajectory_builder_2d.lua b/configuration_files/trajectory_builder_2d.lua index 9d0499d..483f47f 100644 --- a/configuration_files/trajectory_builder_2d.lua +++ b/configuration_files/trajectory_builder_2d.lua @@ -84,8 +84,8 @@ TRAJECTORY_BUILDER_2D = { }, project_sdf_distance_to_scan_normal = true, update_weight_range_exponent = 0, - update_weight_angle_scan_normal_to_ray_kernel_bandwith = 0.5, - update_weight_distance_cell_to_hit_kernel_bandwith = 0.5, + update_weight_angle_scan_normal_to_ray_kernel_bandwidth = 0.5, + update_weight_distance_cell_to_hit_kernel_bandwidth = 0.5, }, }, },