Allow trimmer to get nodes/constraints. (#1034)
* Allow trimmer to get nodes/constraints. * Mark the methods const.master
parent
41fc7e38cc
commit
abb2661b76
|
@ -798,6 +798,16 @@ std::vector<SubmapId> PoseGraph2D::TrimmingHandle::GetSubmapIds(
|
||||||
return submap_ids;
|
return submap_ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MapById<NodeId, TrajectoryNode>
|
||||||
|
PoseGraph2D::TrimmingHandle::GetTrajectoryNodes() const {
|
||||||
|
return parent_->trajectory_nodes_;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<PoseGraphInterface::Constraint>
|
||||||
|
PoseGraph2D::TrimmingHandle::GetConstraints() const {
|
||||||
|
return parent_->constraints_;
|
||||||
|
}
|
||||||
|
|
||||||
bool PoseGraph2D::TrimmingHandle::IsFinished(const int trajectory_id) const {
|
bool PoseGraph2D::TrimmingHandle::IsFinished(const int trajectory_id) const {
|
||||||
return parent_->IsTrajectoryFinished(trajectory_id);
|
return parent_->IsTrajectoryFinished(trajectory_id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,6 +283,8 @@ class PoseGraph2D : public PoseGraph {
|
||||||
std::vector<SubmapId> GetSubmapIds(int trajectory_id) const override;
|
std::vector<SubmapId> GetSubmapIds(int trajectory_id) const override;
|
||||||
MapById<SubmapId, PoseGraphInterface::SubmapData> GetAllSubmapData()
|
MapById<SubmapId, PoseGraphInterface::SubmapData> GetAllSubmapData()
|
||||||
const override;
|
const override;
|
||||||
|
MapById<NodeId, TrajectoryNode> GetTrajectoryNodes() const override;
|
||||||
|
std::vector<PoseGraphInterface::Constraint> GetConstraints() const override;
|
||||||
void MarkSubmapAsTrimmed(const SubmapId& submap_id)
|
void MarkSubmapAsTrimmed(const SubmapId& submap_id)
|
||||||
REQUIRES(parent_->mutex_) override;
|
REQUIRES(parent_->mutex_) override;
|
||||||
bool IsFinished(int trajectory_id) const override;
|
bool IsFinished(int trajectory_id) const override;
|
||||||
|
|
|
@ -828,6 +828,16 @@ PoseGraph3D::TrimmingHandle::GetAllSubmapData() const {
|
||||||
return parent_->GetSubmapDataUnderLock();
|
return parent_->GetSubmapDataUnderLock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MapById<NodeId, TrajectoryNode>
|
||||||
|
PoseGraph3D::TrimmingHandle::GetTrajectoryNodes() const {
|
||||||
|
return parent_->trajectory_nodes_;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<PoseGraphInterface::Constraint>
|
||||||
|
PoseGraph3D::TrimmingHandle::GetConstraints() const {
|
||||||
|
return parent_->constraints_;
|
||||||
|
}
|
||||||
|
|
||||||
bool PoseGraph3D::TrimmingHandle::IsFinished(const int trajectory_id) const {
|
bool PoseGraph3D::TrimmingHandle::IsFinished(const int trajectory_id) const {
|
||||||
return parent_->IsTrajectoryFinished(trajectory_id);
|
return parent_->IsTrajectoryFinished(trajectory_id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -288,6 +288,8 @@ class PoseGraph3D : public PoseGraph {
|
||||||
std::vector<SubmapId> GetSubmapIds(int trajectory_id) const override;
|
std::vector<SubmapId> GetSubmapIds(int trajectory_id) const override;
|
||||||
MapById<SubmapId, PoseGraphInterface::SubmapData> GetAllSubmapData()
|
MapById<SubmapId, PoseGraphInterface::SubmapData> GetAllSubmapData()
|
||||||
const override;
|
const override;
|
||||||
|
MapById<NodeId, TrajectoryNode> GetTrajectoryNodes() const override;
|
||||||
|
std::vector<PoseGraphInterface::Constraint> GetConstraints() const override;
|
||||||
void MarkSubmapAsTrimmed(const SubmapId& submap_id)
|
void MarkSubmapAsTrimmed(const SubmapId& submap_id)
|
||||||
REQUIRES(parent_->mutex_) override;
|
REQUIRES(parent_->mutex_) override;
|
||||||
bool IsFinished(int trajectory_id) const override;
|
bool IsFinished(int trajectory_id) const override;
|
||||||
|
|
|
@ -34,6 +34,9 @@ class Trimmable {
|
||||||
virtual std::vector<SubmapId> GetSubmapIds(int trajectory_id) const = 0;
|
virtual std::vector<SubmapId> GetSubmapIds(int trajectory_id) const = 0;
|
||||||
virtual MapById<SubmapId, PoseGraphInterface::SubmapData> GetAllSubmapData()
|
virtual MapById<SubmapId, PoseGraphInterface::SubmapData> GetAllSubmapData()
|
||||||
const = 0;
|
const = 0;
|
||||||
|
virtual MapById<NodeId, TrajectoryNode> GetTrajectoryNodes() const = 0;
|
||||||
|
virtual std::vector<PoseGraphInterface::Constraint> GetConstraints()
|
||||||
|
const = 0;
|
||||||
|
|
||||||
// Marks 'submap_id' and corresponding intra-submap nodes as trimmed. They
|
// Marks 'submap_id' and corresponding intra-submap nodes as trimmed. They
|
||||||
// will no longer take part in scan matching, loop closure, visualization.
|
// will no longer take part in scan matching, loop closure, visualization.
|
||||||
|
|
|
@ -47,6 +47,14 @@ class FakePoseGraph : public Trimmable {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MapById<NodeId, TrajectoryNode> GetTrajectoryNodes() const override {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<PoseGraphInterface::Constraint> GetConstraints() const override {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
void MarkSubmapAsTrimmed(const SubmapId& submap_id) override {
|
void MarkSubmapAsTrimmed(const SubmapId& submap_id) override {
|
||||||
trimmed_submaps_.push_back(submap_id);
|
trimmed_submaps_.push_back(submap_id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue