Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "cartographer/cloud/internal/handlers/get_submap_handler.h"
00018
00019 #include "absl/memory/memory.h"
00020 #include "async_grpc/rpc_handler.h"
00021 #include "cartographer/cloud/internal/map_builder_context_interface.h"
00022 #include "cartographer/cloud/proto/map_builder_service.pb.h"
00023 #include "google/protobuf/empty.pb.h"
00024
00025 namespace cartographer {
00026 namespace cloud {
00027 namespace handlers {
00028
00029 void GetSubmapHandler::OnRequest(const proto::GetSubmapRequest &request) {
00030 auto response = absl::make_unique<proto::GetSubmapResponse>();
00031 response->set_error_msg(
00032 GetContext<MapBuilderContextInterface>()->map_builder().SubmapToProto(
00033 mapping::SubmapId{request.submap_id().trajectory_id(),
00034 request.submap_id().submap_index()},
00035 response->mutable_submap_query_response()));
00036 Send(std::move(response));
00037 }
00038
00039 }
00040 }
00041 }