From 1de696d45f0ab2c364f832b59c136aeabefc67bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Sch=C3=BCtte?= Date: Fri, 12 Jan 2018 13:55:14 +0100 Subject: [PATCH] Introduce PoseGraphInterface::ToProto() (#813) --- cartographer/mapping/pose_graph.h | 3 +-- cartographer/mapping/pose_graph_interface.h | 3 +++ cartographer_grpc/mapping/pose_graph_stub.cc | 4 ++++ cartographer_grpc/mapping/pose_graph_stub.h | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cartographer/mapping/pose_graph.h b/cartographer/mapping/pose_graph.h index 56f7535..24df274 100644 --- a/cartographer/mapping/pose_graph.h +++ b/cartographer/mapping/pose_graph.h @@ -109,8 +109,7 @@ class PoseGraph : public PoseGraphInterface { // not exist (anymore). virtual SubmapData GetSubmapData(const SubmapId& submap_id) = 0; - // Serializes the constraints and trajectories. - proto::PoseGraph ToProto(); + proto::PoseGraph ToProto() override; // Returns the IMU data. virtual sensor::MapByTime GetImuData() = 0; diff --git a/cartographer/mapping/pose_graph_interface.h b/cartographer/mapping/pose_graph_interface.h index 03083ef..8f0a3ce 100644 --- a/cartographer/mapping/pose_graph_interface.h +++ b/cartographer/mapping/pose_graph_interface.h @@ -90,6 +90,9 @@ class PoseGraphInterface { // Returns the collection of constraints. virtual std::vector constraints() = 0; + + // Serializes the constraints and trajectories. + virtual proto::PoseGraph ToProto() = 0; }; } // namespace mapping diff --git a/cartographer_grpc/mapping/pose_graph_stub.cc b/cartographer_grpc/mapping/pose_graph_stub.cc index 406617d..efa65c3 100644 --- a/cartographer_grpc/mapping/pose_graph_stub.cc +++ b/cartographer_grpc/mapping/pose_graph_stub.cc @@ -109,5 +109,9 @@ PoseGraphStub::constraints() { return cartographer::mapping::FromProto(response.constraints()); } +cartographer::mapping::proto::PoseGraph PoseGraphStub::ToProto() { + LOG(FATAL) << "Not implemented"; +} + } // namespace mapping } // namespace cartographer_grpc diff --git a/cartographer_grpc/mapping/pose_graph_stub.h b/cartographer_grpc/mapping/pose_graph_stub.h index e85e1f0..92c1f22 100644 --- a/cartographer_grpc/mapping/pose_graph_stub.h +++ b/cartographer_grpc/mapping/pose_graph_stub.h @@ -47,6 +47,7 @@ class PoseGraphStub : public cartographer::mapping::PoseGraphInterface { GetTrajectoryNodePoses() override; bool IsTrajectoryFinished(int trajectory_id) override; std::vector constraints() override; + cartographer::mapping::proto::PoseGraph ToProto() override; private: std::shared_ptr client_channel_;