points_processor_pipeline_builder.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CARTOGRAPHER_IO_POINTS_PROCESSOR_PIPELINE_BUILDER_H_
18 #define CARTOGRAPHER_IO_POINTS_PROCESSOR_PIPELINE_BUILDER_H_
19 
20 #include <string>
21 #include <unordered_map>
22 #include <vector>
23 
27 #include "cartographer/mapping/proto/trajectory.pb.h"
28 
29 namespace cartographer {
30 namespace io {
31 
32 // Builder to create a points processor pipeline out of a Lua configuration.
33 // You can register all built-in PointsProcessors using
34 // 'RegisterBuiltInPointsProcessors'. Non-built-in PointsProcessors must define
35 // a name and a factory method for building itself from a
36 // LuaParameterDictionary. See the various built-in PointsProcessors for
37 // examples.
39  public:
40  using FactoryFunction = std::function<std::unique_ptr<PointsProcessor>(
42 
44 
46  delete;
48  const PointsProcessorPipelineBuilder&) = delete;
49 
50  // Register a new PointsProcessor type uniquly identified by 'name' which will
51  // be created using 'factory'.
52  void Register(const std::string& name, FactoryFunction factory);
53 
54  std::vector<std::unique_ptr<PointsProcessor>> CreatePipeline(
55  common::LuaParameterDictionary* dictionary) const;
56 
57  private:
58  std::unordered_map<std::string, FactoryFunction> factories_;
59 };
60 
61 // Register all 'PointsProcessor' that ship with Cartographer with this
62 // 'builder'.
64  const mapping::proto::Trajectory& trajectory,
65  FileWriterFactory file_writer_factory,
67 
68 } // namespace io
69 } // namespace cartographer
70 
71 #endif // CARTOGRAPHER_IO_POINTS_PROCESSOR_PIPELINE_BUILDER_H_
std::function< std::unique_ptr< PointsProcessor >(common::LuaParameterDictionary *, PointsProcessor *next)> FactoryFunction
void RegisterBuiltInPointsProcessors(const mapping::proto::Trajectory &trajectory, FileWriterFactory file_writer_factory, PointsProcessorPipelineBuilder *builder)
std::function< std::unique_ptr< FileWriter >(const string &filename)> FileWriterFactory
Definition: file_writer.h:63
std::unordered_map< std::string, FactoryFunction > factories_
std::vector< std::unique_ptr< PointsProcessor > > CreatePipeline(common::LuaParameterDictionary *dictionary) const
PointsProcessorPipelineBuilder & operator=(const PointsProcessorPipelineBuilder &)=delete
void Register(const std::string &name, FactoryFunction factory)


cartographer
Author(s):
autogenerated on Wed Jun 5 2019 21:57:58