14 #include "glog/logging.h" 20 const double voxel_size,
21 const mapping::proto::RangeDataInserterOptions3D&
22 range_data_inserter_options,
27 file_writer_(std::move(file_writer)) {}
29 std::unique_ptr<HybridGridPointsProcessor>
34 return common::make_unique<HybridGridPointsProcessor>(
38 file_writer_factory(dictionary->
GetString(
"filename")), next);
49 std::string serialized;
50 hybrid_grid_proto.SerializeToString(&serialized);
51 file_writer_->Write(serialized.data(), serialized.size());
56 LOG(FATAL) <<
"Hybrid grid generation must be configured to occur after " 57 "any stages that require multiple passes.";
62 LOG(FATAL) <<
"Failed to receive FlushResult::kFinished";
virtual void Process(std::unique_ptr< PointsBatch > points_batch)=0
proto::HybridGrid ToProto() const
std::function< std::unique_ptr< FileWriter >(const std::string &filename)> FileWriterFactory
proto::RangeDataInserterOptions3D CreateRangeDataInserterOptions3D(common::LuaParameterDictionary *parameter_dictionary)
std::string GetString(const std::string &key)
FlushResult Flush() override
std::unique_ptr< FileWriter > file_writer_
mapping::RangeDataInserter3D range_data_inserter_
PointsProcessor *const next_
double GetDouble(const std::string &key)
void Insert(const sensor::RangeData &range_data, HybridGrid *hybrid_grid) const
static std::unique_ptr< HybridGridPointsProcessor > FromDictionary(const FileWriterFactory &file_writer_factory, common::LuaParameterDictionary *dictionary, PointsProcessor *next)
std::unique_ptr< ProbabilityGridRangeDataInserter2D > range_data_inserter_
HybridGridPointsProcessor(double voxel_size, const mapping::proto::RangeDataInserterOptions3D &range_data_inserter_options, std::unique_ptr< FileWriter > file_writer, PointsProcessor *next)
virtual FlushResult Flush()=0
void Process(std::unique_ptr< PointsBatch > batch) override
mapping::HybridGrid hybrid_grid_
std::unique_ptr< LuaParameterDictionary > GetDictionary(const std::string &key)