Move GetTrajectoryData() down to PoseGraphInterface (#932)

master
danielsievers 2018-02-26 12:45:53 +01:00 committed by Alexander Belyaev
parent ed3502909c
commit 258aa715ba
5 changed files with 14 additions and 3 deletions

View File

@ -125,9 +125,6 @@ class PoseGraph : public PoseGraphInterface {
// Returns the odometry data. // Returns the odometry data.
virtual sensor::MapByTime<sensor::OdometryData> GetOdometryData() = 0; virtual sensor::MapByTime<sensor::OdometryData> GetOdometryData() = 0;
// Returns the trajectory data.
virtual std::map<int, TrajectoryData> GetTrajectoryData() = 0;
// Returns the fixed frame pose data. // Returns the fixed frame pose data.
virtual sensor::MapByTime<sensor::FixedFramePoseData> virtual sensor::MapByTime<sensor::FixedFramePoseData>
GetFixedFramePoseData() = 0; GetFixedFramePoseData() = 0;

View File

@ -111,6 +111,9 @@ class PoseGraphInterface {
// Checks if the given trajectory is finished. // Checks if the given trajectory is finished.
virtual bool IsTrajectoryFinished(int trajectory_id) = 0; virtual bool IsTrajectoryFinished(int trajectory_id) = 0;
// Returns the trajectory data.
virtual std::map<int, TrajectoryData> GetTrajectoryData() = 0;
// Returns the collection of constraints. // Returns the collection of constraints.
virtual std::vector<Constraint> constraints() = 0; virtual std::vector<Constraint> constraints() = 0;

View File

@ -121,6 +121,11 @@ bool PoseGraphStub::IsTrajectoryFinished(int trajectory_id) {
LOG(FATAL) << "Not implemented"; LOG(FATAL) << "Not implemented";
} }
std::map<int, cartographer::mapping::PoseGraphInterface::TrajectoryData>
PoseGraphStub::GetTrajectoryData() {
LOG(FATAL) << "Not implemented";
}
std::vector<cartographer::mapping::PoseGraphInterface::Constraint> std::vector<cartographer::mapping::PoseGraphInterface::Constraint>
PoseGraphStub::constraints() { PoseGraphStub::constraints() {
google::protobuf::Empty request; google::protobuf::Empty request;

View File

@ -46,6 +46,8 @@ class PoseGraphStub : public cartographer::mapping::PoseGraphInterface {
std::map<std::string, cartographer::transform::Rigid3d> GetLandmarkPoses() std::map<std::string, cartographer::transform::Rigid3d> GetLandmarkPoses()
override; override;
bool IsTrajectoryFinished(int trajectory_id) override; bool IsTrajectoryFinished(int trajectory_id) override;
std::map<int, cartographer::mapping::PoseGraphInterface::TrajectoryData>
GetTrajectoryData() override;
std::vector<Constraint> constraints() override; std::vector<Constraint> constraints() override;
cartographer::mapping::proto::PoseGraph ToProto() override; cartographer::mapping::proto::PoseGraph ToProto() override;

View File

@ -50,6 +50,10 @@ class MockPoseGraph : public cartographer::mapping::PoseGraphInterface {
MOCK_METHOD0(GetLandmarkPoses, MOCK_METHOD0(GetLandmarkPoses,
std::map<std::string, cartographer::transform::Rigid3d>()); std::map<std::string, cartographer::transform::Rigid3d>());
MOCK_METHOD1(IsTrajectoryFinished, bool(int)); MOCK_METHOD1(IsTrajectoryFinished, bool(int));
MOCK_METHOD0(
GetTrajectoryData,
std::map<int,
cartographer::mapping::PoseGraphInterface::TrajectoryData>());
MOCK_METHOD0(constraints, std::vector<Constraint>()); MOCK_METHOD0(constraints, std::vector<Constraint>());
MOCK_METHOD0(ToProto, cartographer::mapping::proto::PoseGraph()); MOCK_METHOD0(ToProto, cartographer::mapping::proto::PoseGraph());
}; };