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_CLOUD_INTERNAL_HANDLERS_ADD_SENSOR_DATA_BATCH_HANDLER_H
00018 #define CARTOGRAPHER_CLOUD_INTERNAL_HANDLERS_ADD_SENSOR_DATA_BATCH_HANDLER_H
00019
00020 #include <memory>
00021 #include <string>
00022
00023 #include "absl/container/flat_hash_map.h"
00024 #include "async_grpc/rpc_handler.h"
00025 #include "cartographer/cloud/proto/map_builder_service.pb.h"
00026 #include "cartographer/metrics/counter.h"
00027 #include "cartographer/metrics/family_factory.h"
00028 #include "google/protobuf/empty.pb.h"
00029
00030 namespace cartographer {
00031 namespace cloud {
00032 namespace handlers {
00033
00034 DEFINE_HANDLER_SIGNATURE(
00035 AddSensorDataBatchSignature, proto::AddSensorDataBatchRequest,
00036 google::protobuf::Empty,
00037 "/cartographer.cloud.proto.MapBuilderService/AddSensorDataBatch")
00038
00039 class AddSensorDataBatchHandler
00040 : public async_grpc::RpcHandler<AddSensorDataBatchSignature> {
00041 public:
00042 void OnRequest(const proto::AddSensorDataBatchRequest& request) override;
00043
00044 static void RegisterMetrics(metrics::FamilyFactory* family_factory);
00045
00046 private:
00047 struct ClientMetrics {
00048 metrics::Counter* odometry_sensor_counter;
00049 metrics::Counter* imu_sensor_counter;
00050 metrics::Counter* timed_point_cloud_counter;
00051 metrics::Counter* fixed_frame_pose_counter;
00052 metrics::Counter* landmark_counter;
00053 metrics::Counter* local_slam_result_counter;
00054 };
00055
00056 ClientMetrics* GetOrCreateClientMetrics(const std::string& client_id,
00057 int trajectory_id);
00058
00059 static cartographer::metrics::Family<metrics::Counter>*
00060 counter_metrics_family_;
00061
00062
00063 absl::flat_hash_map<std::string, std::unique_ptr<ClientMetrics>>
00064 client_metric_map_;
00065 };
00066
00067 }
00068 }
00069 }
00070
00071 #endif // CARTOGRAPHER_CLOUD_INTERNAL_HANDLERS_ADD_SENSOR_DATA_BATCH_HANDLER_H