assets_writer.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 #include <string>
18 #include <vector>
19 
22 #include "cartographer/mapping/proto/pose_graph.pb.h"
23 #include "cartographer/mapping/proto/trajectory_builder_options.pb.h"
24 
25 #ifndef CARTOGRAPHER_ROS_CARTOGRAPHER_ROS_ASSETS_WRITER_H
26 #define CARTOGRAPHER_ROS_CARTOGRAPHER_ROS_ASSETS_WRITER_H
27 
28 namespace cartographer_ros {
29 
30 class AssetsWriter {
31  public:
32  AssetsWriter(const std::string& pose_graph_filename,
33  const std::vector<std::string>& bag_filenames,
34  const std::string& output_file_prefix);
35 
36  // Registers a new PointsProcessor type uniquly identified by 'name' which
37  // will be created using 'factory'.
39  const std::string& name,
41  factory);
42 
43  // Configures a points processing pipeline and pushes the points from the
44  // bag through the pipeline.
45  void Run(const std::string& configuration_directory,
46  const std::string& configuration_basename,
47  const std::string& urdf_filename, bool use_bag_transforms);
48 
49  // Creates a FileWriterFactory which creates a FileWriter for storing assets.
50  static ::cartographer::io::FileWriterFactory CreateFileWriterFactory(
51  const std::string& file_path);
52 
53  private:
54  std::vector<std::string> bag_filenames_;
55  std::vector<::cartographer::mapping::proto::Trajectory> all_trajectories_;
56  ::cartographer::mapping::proto::PoseGraph pose_graph_;
57  std::unique_ptr<::cartographer::io::PointsProcessorPipelineBuilder>
59 };
60 
61 } // namespace cartographer_ros
62 
63 #endif // CARTOGRAPHER_ROS_CARTOGRAPHER_ROS_ASSETS_WRITER_H
void Run(const std::string &configuration_directory, const std::string &configuration_basename, const std::string &urdf_filename, bool use_bag_transforms)
std::function< std::unique_ptr< PointsProcessor >(common::LuaParameterDictionary *, PointsProcessor *next)> FactoryFunction
::cartographer::io::FileWriterFactory CreateFileWriterFactory(const std::string &file_path)
AssetsWriter(const std::string &pose_graph_filename, const std::vector< std::string > &bag_filenames, const std::string &output_file_prefix)
std::vector<::cartographer::mapping::proto::Trajectory > all_trajectories_
Definition: assets_writer.h:55
std::vector< std::string > bag_filenames_
Definition: assets_writer.h:54
std::unique_ptr<::cartographer::io::PointsProcessorPipelineBuilder > point_pipeline_builder_
Definition: assets_writer.h:58
void RegisterPointsProcessor(const std::string &name, cartographer::io::PointsProcessorPipelineBuilder::FactoryFunction factory)
::cartographer::mapping::proto::PoseGraph pose_graph_
Definition: assets_writer.h:56


cartographer_ros
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:06:05