34 #include "cartographer/mapping/proto/trajectory.pb.h" 39 template <
typename Po
intsProcessorType>
43 PointsProcessorType::kConfigurationFileActionName,
50 template <
typename Po
intsProcessorType>
55 PointsProcessorType::kConfigurationFileActionName,
56 [file_writer_factory](
64 template <
typename Po
intsProcessorType>
66 const std::vector<mapping::proto::Trajectory>& trajectories,
70 PointsProcessorType::kConfigurationFileActionName,
71 [&trajectories, file_writer_factory](
75 trajectories, file_writer_factory, dictionary, next);
80 const std::vector<mapping::proto::Trajectory>& trajectories,
83 RegisterPlainPointsProcessor<CountingPointsProcessor>(builder);
84 RegisterPlainPointsProcessor<FixedRatioSamplingPointsProcessor>(builder);
85 RegisterPlainPointsProcessor<FrameIdFilteringPointsProcessor>(builder);
86 RegisterPlainPointsProcessor<MinMaxRangeFiteringPointsProcessor>(builder);
87 RegisterPlainPointsProcessor<OutlierRemovingPointsProcessor>(builder);
88 RegisterPlainPointsProcessor<ColoringPointsProcessor>(builder);
89 RegisterPlainPointsProcessor<IntensityToColorPointsProcessor>(builder);
90 RegisterFileWritingPointsProcessor<PcdWritingPointsProcessor>(
91 file_writer_factory, builder);
92 RegisterFileWritingPointsProcessor<PlyWritingPointsProcessor>(
93 file_writer_factory, builder);
94 RegisterFileWritingPointsProcessor<XyzWriterPointsProcessor>(
95 file_writer_factory, builder);
96 RegisterFileWritingPointsProcessor<HybridGridPointsProcessor>(
97 file_writer_factory, builder);
98 RegisterFileWritingPointsProcessorWithTrajectories<XRayPointsProcessor>(
99 trajectories, file_writer_factory, builder);
107 CHECK(
factories_.count(name) == 0) <<
"A points processor named '" << name
108 <<
"' has already been registered.";
114 std::vector<std::unique_ptr<PointsProcessor>>
117 std::vector<std::unique_ptr<PointsProcessor>> pipeline;
121 pipeline.emplace_back(common::make_unique<NullPointsProcessor>());
123 std::vector<std::unique_ptr<common::LuaParameterDictionary>> configurations =
127 for (
auto it = configurations.rbegin(); it != configurations.rend(); it++) {
128 const std::string action = (*it)->GetString(
"action");
131 <<
"Unknown action '" << action
132 <<
"'. Did you register the correspoinding PointsProcessor?";
133 pipeline.push_back(factory_it->second(it->get(), pipeline.back().get()));
std::function< std::unique_ptr< PointsProcessor >(common::LuaParameterDictionary *, PointsProcessor *next)> FactoryFunction
std::function< std::unique_ptr< FileWriter >(const std::string &filename)> FileWriterFactory
void RegisterFileWritingPointsProcessor(const FileWriterFactory &file_writer_factory, PointsProcessorPipelineBuilder *const builder)
std::vector< std::unique_ptr< LuaParameterDictionary > > GetArrayValuesAsDictionaries()
std::unordered_map< std::string, FactoryFunction > factories_
PointsProcessorPipelineBuilder()
std::vector< std::unique_ptr< PointsProcessor > > CreatePipeline(common::LuaParameterDictionary *dictionary) const
void Register(const std::string &name, FactoryFunction factory)
void RegisterPlainPointsProcessor(PointsProcessorPipelineBuilder *const builder)
void RegisterFileWritingPointsProcessorWithTrajectories(const std::vector< mapping::proto::Trajectory > &trajectories, const FileWriterFactory &file_writer_factory, PointsProcessorPipelineBuilder *const builder)
void RegisterBuiltInPointsProcessors(const std::vector< mapping::proto::Trajectory > &trajectories, const FileWriterFactory &file_writer_factory, PointsProcessorPipelineBuilder *builder)