14 #include "glog/logging.h" 20 const double voxel_size,
21 const mapping_3d::proto::RangeDataInserterOptions&
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);
48 const mapping_3d::proto::HybridGrid hybrid_grid_proto =
51 hybrid_grid_proto.SerializeToString(&serialized);
52 file_writer_->Write(serialized.data(), serialized.size());
57 LOG(FATAL) <<
"Hybrid grid generation must be configured to occur after " 58 "any stages that require multiple passes.";
63 LOG(FATAL) <<
"Failed to receive FlushResult::kFinished";
virtual void Process(std::unique_ptr< PointsBatch > points_batch)=0
mapping_3d::RangeDataInserter range_data_inserter_
proto::RangeDataInserterOptions CreateRangeDataInserterOptions(common::LuaParameterDictionary *parameter_dictionary)
std::function< std::unique_ptr< FileWriter >(const string &filename)> FileWriterFactory
FlushResult Flush() override
std::unique_ptr< FileWriter > file_writer_
PointsProcessor *const next_
double GetDouble(const string &key)
mapping_3d::HybridGrid hybrid_grid_
static std::unique_ptr< HybridGridPointsProcessor > FromDictionary(FileWriterFactory file_writer_factory, common::LuaParameterDictionary *dictionary, PointsProcessor *next)
virtual FlushResult Flush()=0
void Process(std::unique_ptr< PointsBatch > batch) override
string GetString(const string &key)
HybridGridPointsProcessor(double voxel_size, const mapping_3d::proto::RangeDataInserterOptions &range_data_inserter_options, std::unique_ptr< FileWriter > file_writer, PointsProcessor *next)
proto::HybridGrid ToProto(const HybridGrid &grid)
std::unique_ptr< RangeDataInserter > range_data_inserter_
std::unique_ptr< LuaParameterDictionary > GetDictionary(const string &key)
void Insert(const sensor::RangeData &range_data, HybridGrid *hybrid_grid) const