Correct spelling to bandwidth (#1490)

Previously, two config values were spelled "bandwith".
The assumption is that these values are not used in other
repositories so the rename is harmless.
master
Andre Gaschler 2019-01-02 13:12:26 +01:00 committed by GitHub
parent 9925d360f4
commit 5182dd1bf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 35 additions and 34 deletions

View File

@ -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,"
"},"
"},"
"}");

View File

@ -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<float> 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);
}

View File

@ -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<TSDFRangeDataInserter2D>(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<TSDFRangeDataInserter2D>(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<TSDFRangeDataInserter2D>(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));
}

View File

@ -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");

View File

@ -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<TSDFRangeDataInserter2D>(
CreateTSDFRangeDataInserterOptions2D(parameter_dictionary.get()));

View File

@ -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<TSDFRangeDataInserter2D>(options_);

View File

@ -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;
}

View File

@ -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,
},
},
},