Skip to content

Commit

Permalink
Move PoseGraph::GetSubmapData to the PoseGraphInterface. (#1783)
Browse files Browse the repository at this point in the history
Related to #1413.

Signed-off-by: Wolfgang Hess <whess@lyft.com>
  • Loading branch information
wohe committed Nov 23, 2020
1 parent 6058388 commit fdcf0eb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions cartographer/cloud/internal/client/pose_graph_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ PoseGraphStub::GetAllSubmapData() const {
LOG(FATAL) << "Not implemented";
}

mapping::PoseGraphInterface::SubmapData PoseGraphStub::GetSubmapData(
const mapping::SubmapId& submap_id) const {
LOG(FATAL) << "Not implemented";
}

mapping::MapById<mapping::SubmapId, mapping::PoseGraphInterface::SubmapPose>
PoseGraphStub::GetAllSubmapPoses() const {
google::protobuf::Empty request;
Expand Down
1 change: 1 addition & 0 deletions cartographer/cloud/internal/client/pose_graph_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class PoseGraphStub : public ::cartographer::mapping::PoseGraphInterface {
void RunFinalOptimization() override;
mapping::MapById<mapping::SubmapId, SubmapData> GetAllSubmapData()
const override;
SubmapData GetSubmapData(const mapping::SubmapId& submap_id) const override;
mapping::MapById<mapping::SubmapId, SubmapPose> GetAllSubmapPoses()
const override;
transform::Rigid3d GetLocalToGlobalTransform(
Expand Down
1 change: 1 addition & 0 deletions cartographer/mapping/internal/testing/mock_pose_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class MockPoseGraph : public mapping::PoseGraphInterface {
MOCK_METHOD0(RunFinalOptimization, void());
MOCK_CONST_METHOD0(GetAllSubmapData,
mapping::MapById<mapping::SubmapId, SubmapData>());
MOCK_CONST_METHOD1(GetSubmapData, SubmapData(const SubmapId&));
MOCK_CONST_METHOD0(GetAllSubmapPoses,
mapping::MapById<mapping::SubmapId, SubmapPose>());
MOCK_CONST_METHOD1(GetLocalToGlobalTransform, transform::Rigid3d(int));
Expand Down
5 changes: 0 additions & 5 deletions cartographer/mapping/pose_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ class PoseGraph : public PoseGraphInterface {
// Gets the current trajectory clusters.
virtual std::vector<std::vector<int>> GetConnectedTrajectories() const = 0;

// Returns the current optimized transform and submap itself for the given
// 'submap_id'. Returns 'nullptr' for the 'submap' member if the submap does
// not exist (anymore).
virtual SubmapData GetSubmapData(const SubmapId& submap_id) const = 0;

proto::PoseGraph ToProto(bool include_unfinished_submaps) const override;

// Returns the IMU data.
Expand Down
5 changes: 5 additions & 0 deletions cartographer/mapping/pose_graph_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ class PoseGraphInterface {
// Returns data for all submaps.
virtual MapById<SubmapId, SubmapData> GetAllSubmapData() const = 0;

// Returns the current optimized transform and submap itself for the given
// 'submap_id'. Returns 'nullptr' for the 'submap' member if the submap does
// not exist (anymore).
virtual SubmapData GetSubmapData(const SubmapId& submap_id) const = 0;

// Returns the global poses for all submaps.
virtual MapById<SubmapId, SubmapPose> GetAllSubmapPoses() const = 0;

Expand Down

0 comments on commit fdcf0eb

Please sign in to comment.