Skip to content

Commit 0762415

Browse files
committed
Move PoseGraph::GetSubmapData to the PoseGraphInterface.
Related to cartographer-project#1413. Signed-off-by: Wolfgang Hess <[email protected]>
1 parent 6058388 commit 0762415

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

Diff for: cartographer/cloud/internal/client/pose_graph_stub.cc

+5
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ PoseGraphStub::GetAllSubmapData() const {
5252
LOG(FATAL) << "Not implemented";
5353
}
5454

55+
mapping::PoseGraphInterface::SubmapData PoseGraphStub::GetSubmapData(
56+
const mapping::SubmapId& submap_id) const {
57+
LOG(FATAL) << "Not implemented";
58+
}
59+
5560
mapping::MapById<mapping::SubmapId, mapping::PoseGraphInterface::SubmapPose>
5661
PoseGraphStub::GetAllSubmapPoses() const {
5762
google::protobuf::Empty request;

Diff for: cartographer/cloud/internal/client/pose_graph_stub.h

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class PoseGraphStub : public ::cartographer::mapping::PoseGraphInterface {
3434
void RunFinalOptimization() override;
3535
mapping::MapById<mapping::SubmapId, SubmapData> GetAllSubmapData()
3636
const override;
37+
SubmapData GetSubmapData(const mapping::SubmapId& submap_id) const override;
3738
mapping::MapById<mapping::SubmapId, SubmapPose> GetAllSubmapPoses()
3839
const override;
3940
transform::Rigid3d GetLocalToGlobalTransform(

Diff for: cartographer/mapping/internal/testing/mock_pose_graph.h

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class MockPoseGraph : public mapping::PoseGraphInterface {
3434
MOCK_METHOD0(RunFinalOptimization, void());
3535
MOCK_CONST_METHOD0(GetAllSubmapData,
3636
mapping::MapById<mapping::SubmapId, SubmapData>());
37+
MOCK_CONST_METHOD1(GetSubmapData, SubmapData(const SubmapId&));
3738
MOCK_CONST_METHOD0(GetAllSubmapPoses,
3839
mapping::MapById<mapping::SubmapId, SubmapPose>());
3940
MOCK_CONST_METHOD1(GetLocalToGlobalTransform, transform::Rigid3d(int));

Diff for: cartographer/mapping/pose_graph.h

-5
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ class PoseGraph : public PoseGraphInterface {
112112
// Gets the current trajectory clusters.
113113
virtual std::vector<std::vector<int>> GetConnectedTrajectories() const = 0;
114114

115-
// Returns the current optimized transform and submap itself for the given
116-
// 'submap_id'. Returns 'nullptr' for the 'submap' member if the submap does
117-
// not exist (anymore).
118-
virtual SubmapData GetSubmapData(const SubmapId& submap_id) const = 0;
119-
120115
proto::PoseGraph ToProto(bool include_unfinished_submaps) const override;
121116

122117
// Returns the IMU data.

Diff for: cartographer/mapping/pose_graph_interface.h

+5
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ class PoseGraphInterface {
9999
// Returns data for all submaps.
100100
virtual MapById<SubmapId, SubmapData> GetAllSubmapData() const = 0;
101101

102+
// Returns the current optimized transform and submap itself for the given
103+
// 'submap_id'. Returns 'nullptr' for the 'submap' member if the submap does
104+
// not exist (anymore).
105+
virtual SubmapData GetSubmapData(const SubmapId& submap_id) const = 0;
106+
102107
// Returns the global poses for all submaps.
103108
virtual MapById<SubmapId, SubmapPose> GetAllSubmapPoses() const = 0;
104109

0 commit comments

Comments
 (0)