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_SENSOR_COLLATOR_INTERFACE_H_
00018 #define CARTOGRAPHER_SENSOR_COLLATOR_INTERFACE_H_
00019
00020 #include <functional>
00021 #include <memory>
00022 #include <vector>
00023
00024 #include "absl/container/flat_hash_set.h"
00025 #include "absl/types/optional.h"
00026 #include "cartographer/sensor/data.h"
00027
00028 namespace cartographer {
00029 namespace sensor {
00030
00031 class CollatorInterface {
00032 public:
00033 using Callback =
00034 std::function<void(const std::string&, std::unique_ptr<Data>)>;
00035
00036 CollatorInterface() {}
00037 virtual ~CollatorInterface() {}
00038 CollatorInterface(const CollatorInterface&) = delete;
00039 CollatorInterface& operator=(const CollatorInterface&) = delete;
00040
00041
00042
00043 virtual void AddTrajectory(
00044 int trajectory_id,
00045 const absl::flat_hash_set<std::string>& expected_sensor_ids,
00046 const Callback& callback) = 0;
00047
00048
00049 virtual void FinishTrajectory(int trajectory_id) = 0;
00050
00051
00052
00053
00054 virtual void AddSensorData(int trajectory_id, std::unique_ptr<Data> data) = 0;
00055
00056
00057
00058 virtual void Flush() = 0;
00059
00060
00061
00062
00063
00064 virtual absl::optional<int> GetBlockingTrajectoryId() const = 0;
00065 };
00066
00067 }
00068 }
00069
00070 #endif // CARTOGRAPHER_SENSOR_COLLATOR_INTERFACE_H_