Fix EqualCellProperties matcher. (#1276)

master
Kevin Daun 2018-07-14 10:34:46 +02:00 committed by Wally B. Feed
parent 7b48b66a65
commit df12154542
2 changed files with 5 additions and 5 deletions

View File

@ -86,8 +86,8 @@ MATCHER_P3(EqualCellProperties, expected_is_known, expected_tsd,
std::to_string(expected_tsd) + "\t" +
std::to_string(expected_weight)) {
bool result = expected_is_known == arg.is_known_;
result = result && (std::abs(expected_tsd - arg.tsd_ < 1e-4));
result = result && (std::abs(expected_weight - arg.weight_ < 1e-2));
result = result && (std::abs(expected_tsd - arg.tsd_) < 1e-4);
result = result && (std::abs(expected_weight - arg.weight_) < 1e-2);
return result;
}

View File

@ -26,10 +26,10 @@ TSDValueConverter::TSDValueConverter(float max_tsd, float max_weight,
max_weight_(max_weight),
tsd_resolution_(32766.f / (max_tsd_ - min_tsd_)),
weight_resolution_(32766.f / (max_weight_ - min_weight_)),
value_to_tsd_(conversion_tables->GetConversionTable(unknown_tsd_value_,
min_tsd_, max_tsd_)),
value_to_tsd_(
conversion_tables->GetConversionTable(min_tsd_, min_tsd_, max_tsd_)),
value_to_weight_(conversion_tables->GetConversionTable(
unknown_weight_value_, min_weight_, max_weight)) {}
min_weight_, min_weight_, max_weight)) {}
} // namespace mapping
} // namespace cartographer