Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef CARTOGRAPHER_ROS_CARTOGRAPHER_ROS_ROS_MAP_WRITING_POINTS_PROCESSOR_H
00018 #define CARTOGRAPHER_ROS_CARTOGRAPHER_ROS_ROS_MAP_WRITING_POINTS_PROCESSOR_H
00019
00020 #include "cartographer/common/lua_parameter_dictionary.h"
00021 #include "cartographer/io/file_writer.h"
00022 #include "cartographer/io/points_processor.h"
00023 #include "cartographer/mapping/2d/probability_grid.h"
00024 #include "cartographer/mapping/2d/probability_grid_range_data_inserter_2d.h"
00025 #include "cartographer/mapping/proto/2d/probability_grid_range_data_inserter_options_2d.pb.h"
00026 #include "cartographer/mapping/value_conversion_tables.h"
00027
00028 namespace cartographer_ros {
00029
00030
00031
00032 class RosMapWritingPointsProcessor
00033 : public ::cartographer::io::PointsProcessor {
00034 public:
00035 constexpr static const char* kConfigurationFileActionName = "write_ros_map";
00036 RosMapWritingPointsProcessor(
00037 double resolution,
00038 const ::cartographer::mapping::proto::
00039 ProbabilityGridRangeDataInserterOptions2D&
00040 range_data_inserter_options,
00041 ::cartographer::io::FileWriterFactory file_writer_factory,
00042 const std::string& filestem, PointsProcessor* next);
00043 RosMapWritingPointsProcessor(const RosMapWritingPointsProcessor&) = delete;
00044 RosMapWritingPointsProcessor& operator=(const RosMapWritingPointsProcessor&) =
00045 delete;
00046
00047 static std::unique_ptr<RosMapWritingPointsProcessor> FromDictionary(
00048 ::cartographer::io::FileWriterFactory file_writer_factory,
00049 ::cartographer::common::LuaParameterDictionary* dictionary,
00050 PointsProcessor* next);
00051
00052 ~RosMapWritingPointsProcessor() override {}
00053
00054 void Process(std::unique_ptr<::cartographer::io::PointsBatch> batch) override;
00055 FlushResult Flush() override;
00056
00057 private:
00058 const std::string filestem_;
00059 PointsProcessor* const next_;
00060 ::cartographer::io::FileWriterFactory file_writer_factory_;
00061 ::cartographer::mapping::ProbabilityGridRangeDataInserter2D
00062 range_data_inserter_;
00063 ::cartographer::mapping::ValueConversionTables conversion_tables_;
00064 ::cartographer::mapping::ProbabilityGrid probability_grid_;
00065 };
00066
00067 }
00068
00069 #endif // CARTOGRAPHER_ROS_CARTOGRAPHER_ROS_ROS_MAP_WRITING_POINTS_PROCESSOR_H