22 #include "Eigen/Geometry" 25 #include "glog/logging.h" 28 namespace mapping_2d {
32 proto::RangeDataInserterOptions options;
33 options.set_hit_probability(
34 parameter_dictionary->
GetDouble(
"hit_probability"));
35 options.set_miss_probability(
36 parameter_dictionary->
GetDouble(
"miss_probability"));
37 options.set_insert_free_space(
38 parameter_dictionary->
HasKey(
"insert_free_space")
39 ? parameter_dictionary->
GetBool(
"insert_free_space")
41 CHECK_GT(options.hit_probability(), 0.5);
42 CHECK_LT(options.miss_probability(), 0.5);
47 const proto::RangeDataInserterOptions& options)
50 mapping::
Odds(options.hit_probability()))),
52 mapping::
Odds(options.miss_probability()))) {}
56 CHECK_NOTNULL(probability_grid)->StartUpdate();
61 [
this, &probability_grid](
const Eigen::Array2i&
hit) {
64 [
this, &probability_grid](
const Eigen::Array2i& miss) {
proto::RangeDataInserterOptions options_
bool GetBool(const string &key)
std::vector< uint16 > ComputeLookupTableToApplyOdds(const float odds)
bool ApplyLookupTable(const Eigen::Array2i &xy_index, const std::vector< uint16 > &table)
void Insert(const sensor::RangeData &range_data, ProbabilityGrid *probability_grid) const
double GetDouble(const string &key)
const std::vector< uint16 > hit_table_
float Odds(float probability)
proto::RangeDataInserterOptions CreateRangeDataInserterOptions(common::LuaParameterDictionary *const parameter_dictionary)
RangeDataInserter(const proto::RangeDataInserterOptions &options)
const proto::RangeDataInserterOptions options_
bool HasKey(const string &key) const
const MapLimits & limits() const
void CastRays(const sensor::RangeData &range_data, const MapLimits &limits, const std::function< void(const Eigen::Array2i &)> &hit_visitor, const std::function< void(const Eigen::Array2i &)> &miss_visitor)
const std::vector< uint16 > miss_table_