19 #include "async_grpc/rpc_handler.h" 21 #include "cartographer/cloud/proto/map_builder_service.pb.h" 24 #include "google/protobuf/empty.pb.h" 30 void GetAllSubmapPosesHandler::OnRequest(
31 const google::protobuf::Empty& request) {
32 auto submap_poses = GetContext<MapBuilderContextInterface>()
35 ->GetAllSubmapPoses();
36 auto response = common::make_unique<proto::GetAllSubmapPosesResponse>();
37 for (
const auto& submap_id_pose : submap_poses) {
38 auto* submap_pose = response->add_submap_poses();
39 submap_id_pose.id.ToProto(submap_pose->mutable_submap_id());
40 submap_pose->set_submap_version(submap_id_pose.data.version);
41 *submap_pose->mutable_global_pose() =
44 Send(std::move(response));