assets_writer.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2016 The Cartographer Authors
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #include <string>
00018 #include <vector>
00019 
00020 #include "cartographer/common/configuration_file_resolver.h"
00021 #include "cartographer/io/points_processor_pipeline_builder.h"
00022 #include "cartographer/mapping/proto/pose_graph.pb.h"
00023 #include "cartographer/mapping/proto/trajectory_builder_options.pb.h"
00024 
00025 #ifndef CARTOGRAPHER_ROS_CARTOGRAPHER_ROS_ASSETS_WRITER_H
00026 #define CARTOGRAPHER_ROS_CARTOGRAPHER_ROS_ASSETS_WRITER_H
00027 
00028 namespace cartographer_ros {
00029 
00030 class AssetsWriter {
00031  public:
00032   AssetsWriter(const std::string& pose_graph_filename,
00033                const std::vector<std::string>& bag_filenames,
00034                const std::string& output_file_prefix);
00035 
00036   // Registers a new PointsProcessor type uniquly identified by 'name' which
00037   // will be created using 'factory'.
00038   void RegisterPointsProcessor(
00039       const std::string& name,
00040       cartographer::io::PointsProcessorPipelineBuilder::FactoryFunction
00041           factory);
00042 
00043   // Configures a points processing pipeline and pushes the points from the
00044   // bag through the pipeline.
00045   void Run(const std::string& configuration_directory,
00046            const std::string& configuration_basename,
00047            const std::string& urdf_filename, bool use_bag_transforms);
00048 
00049   // Creates a FileWriterFactory which creates a FileWriter for storing assets.
00050   static ::cartographer::io::FileWriterFactory CreateFileWriterFactory(
00051       const std::string& file_path);
00052 
00053  private:
00054   std::vector<std::string> bag_filenames_;
00055   std::vector<::cartographer::mapping::proto::Trajectory> all_trajectories_;
00056   ::cartographer::mapping::proto::PoseGraph pose_graph_;
00057   std::unique_ptr<::cartographer::io::PointsProcessorPipelineBuilder>
00058       point_pipeline_builder_;
00059 };
00060 
00061 }  // namespace cartographer_ros
00062 
00063 #endif  // CARTOGRAPHER_ROS_CARTOGRAPHER_ROS_ASSETS_WRITER_H


cartographer_ros
Author(s): The Cartographer Authors
autogenerated on Wed Jul 10 2019 04:10:28