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_local_to_global_transform_handler.h"
00018
00019 #include "async_grpc/rpc_handler.h"
00020 #include "cartographer/cloud/internal/map_builder_context_interface.h"
00021 #include "cartographer/cloud/proto/map_builder_service.pb.h"
00022 #include "cartographer/transform/transform.h"
00023 #include "google/protobuf/empty.pb.h"
00024
00025 namespace cartographer {
00026 namespace cloud {
00027 namespace handlers {
00028
00029 void GetLocalToGlobalTransformHandler::OnRequest(
00030 const proto::GetLocalToGlobalTransformRequest& request) {
00031 auto response = absl::make_unique<proto::GetLocalToGlobalTransformResponse>();
00032 auto local_to_global =
00033 GetContext<MapBuilderContextInterface>()
00034 ->map_builder()
00035 .pose_graph()
00036 ->GetLocalToGlobalTransform(request.trajectory_id());
00037 *response->mutable_local_to_global() = transform::ToProto(local_to_global);
00038 Send(std::move(response));
00039 }
00040
00041 }
00042 }
00043 }