Add IsTrajectoryFrozen to PoseGraph (#962)
Adds IsTrajectoryFrozen to the PoseGraph interfacemaster
parent
ec078c7e1c
commit
82a491181d
|
@ -108,6 +108,10 @@ bool PoseGraphStub::IsTrajectoryFinished(int trajectory_id) {
|
|||
LOG(FATAL) << "Not implemented";
|
||||
}
|
||||
|
||||
bool PoseGraphStub::IsTrajectoryFrozen(int trajectory_id) {
|
||||
LOG(FATAL) << "Not implemented";
|
||||
}
|
||||
|
||||
std::map<int, mapping::PoseGraphInterface::TrajectoryData>
|
||||
PoseGraphStub::GetTrajectoryData() {
|
||||
LOG(FATAL) << "Not implemented";
|
||||
|
|
|
@ -40,6 +40,7 @@ class PoseGraphStub : public ::cartographer::mapping::PoseGraphInterface {
|
|||
GetTrajectoryNodePoses() override;
|
||||
std::map<std::string, transform::Rigid3d> GetLandmarkPoses() override;
|
||||
bool IsTrajectoryFinished(int trajectory_id) override;
|
||||
bool IsTrajectoryFrozen(int trajectory_id) override;
|
||||
std::map<int, mapping::PoseGraphInterface::TrajectoryData> GetTrajectoryData()
|
||||
override;
|
||||
std::vector<Constraint> constraints() override;
|
||||
|
|
|
@ -417,6 +417,10 @@ void PoseGraph2D::FreezeTrajectory(const int trajectory_id) {
|
|||
});
|
||||
}
|
||||
|
||||
bool PoseGraph2D::IsTrajectoryFrozen(const int trajectory_id) {
|
||||
return frozen_trajectories_.count(trajectory_id) > 0;
|
||||
}
|
||||
|
||||
void PoseGraph2D::AddSubmapFromProto(
|
||||
const transform::Rigid3d& global_submap_pose, const proto::Submap& submap) {
|
||||
if (!submap.has_submap_2d()) {
|
||||
|
|
|
@ -93,6 +93,7 @@ class PoseGraph2D : public PoseGraph {
|
|||
void FinishTrajectory(int trajectory_id) override;
|
||||
bool IsTrajectoryFinished(int trajectory_id) override;
|
||||
void FreezeTrajectory(int trajectory_id) override;
|
||||
bool IsTrajectoryFrozen(int trajectory_id) override;
|
||||
void AddSubmapFromProto(const transform::Rigid3d& global_submap_pose,
|
||||
const proto::Submap& submap) override;
|
||||
void AddNodeFromProto(const transform::Rigid3d& global_pose,
|
||||
|
|
|
@ -435,6 +435,10 @@ void PoseGraph3D::FreezeTrajectory(const int trajectory_id) {
|
|||
});
|
||||
}
|
||||
|
||||
bool PoseGraph3D::IsTrajectoryFrozen(const int trajectory_id) {
|
||||
return frozen_trajectories_.count(trajectory_id) > 0;
|
||||
}
|
||||
|
||||
void PoseGraph3D::AddSubmapFromProto(
|
||||
const transform::Rigid3d& global_submap_pose, const proto::Submap& submap) {
|
||||
if (!submap.has_submap_3d()) {
|
||||
|
|
|
@ -92,6 +92,7 @@ class PoseGraph3D : public PoseGraph {
|
|||
void FinishTrajectory(int trajectory_id) override;
|
||||
bool IsTrajectoryFinished(int trajectory_id) override;
|
||||
void FreezeTrajectory(int trajectory_id) override;
|
||||
bool IsTrajectoryFrozen(int trajectory_id) override;
|
||||
void AddSubmapFromProto(const transform::Rigid3d& global_submap_pose,
|
||||
const proto::Submap& submap) override;
|
||||
void AddNodeFromProto(const transform::Rigid3d& global_pose,
|
||||
|
|
|
@ -44,6 +44,7 @@ class MockPoseGraph : public mapping::PoseGraphInterface {
|
|||
mapping::MapById<mapping::NodeId, mapping::TrajectoryNodePose>());
|
||||
MOCK_METHOD0(GetLandmarkPoses, std::map<std::string, transform::Rigid3d>());
|
||||
MOCK_METHOD1(IsTrajectoryFinished, bool(int));
|
||||
MOCK_METHOD1(IsTrajectoryFrozen, bool(int));
|
||||
MOCK_METHOD0(GetTrajectoryData,
|
||||
std::map<int, mapping::PoseGraphInterface::TrajectoryData>());
|
||||
MOCK_METHOD0(constraints, std::vector<Constraint>());
|
||||
|
|
|
@ -111,6 +111,9 @@ class PoseGraphInterface {
|
|||
// Checks if the given trajectory is finished.
|
||||
virtual bool IsTrajectoryFinished(int trajectory_id) = 0;
|
||||
|
||||
// Checks if the given trajectory is frozen.
|
||||
virtual bool IsTrajectoryFrozen(int trajectory_id) = 0;
|
||||
|
||||
// Returns the trajectory data.
|
||||
virtual std::map<int, TrajectoryData> GetTrajectoryData() = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue