Make SPG::AddScan return the inserted node id. (#617)

master
Juraj Oršulić 2017-11-02 10:28:13 +01:00 committed by Wolfgang Hess
parent e10650910e
commit c57641f917
4 changed files with 6 additions and 4 deletions

View File

@ -93,7 +93,7 @@ std::vector<mapping::SubmapId> SparsePoseGraph::GrowSubmapTransformsAsNeeded(
return {front_submap_id, last_submap_id}; return {front_submap_id, last_submap_id};
} }
void SparsePoseGraph::AddScan( mapping::NodeId SparsePoseGraph::AddScan(
std::shared_ptr<const mapping::TrajectoryNode::Data> constant_data, std::shared_ptr<const mapping::TrajectoryNode::Data> constant_data,
const int trajectory_id, const int trajectory_id,
const std::vector<std::shared_ptr<const Submap>>& insertion_submaps) { const std::vector<std::shared_ptr<const Submap>>& insertion_submaps) {
@ -124,6 +124,7 @@ void SparsePoseGraph::AddScan(
ComputeConstraintsForScan(node_id, insertion_submaps, ComputeConstraintsForScan(node_id, insertion_submaps,
newly_finished_submap); newly_finished_submap);
}); });
return node_id;
} }
void SparsePoseGraph::AddWorkItem(const std::function<void()>& work_item) { void SparsePoseGraph::AddWorkItem(const std::function<void()>& work_item) {

View File

@ -70,7 +70,7 @@ class SparsePoseGraph : public mapping::SparsePoseGraph {
// 'insertion_submaps.front()' and the scan was inserted into the // 'insertion_submaps.front()' and the scan was inserted into the
// 'insertion_submaps'. If 'insertion_submaps.front().finished()' is // 'insertion_submaps'. If 'insertion_submaps.front().finished()' is
// 'true', this submap was inserted into for the last time. // 'true', this submap was inserted into for the last time.
void AddScan( mapping::NodeId AddScan(
std::shared_ptr<const mapping::TrajectoryNode::Data> constant_data, std::shared_ptr<const mapping::TrajectoryNode::Data> constant_data,
int trajectory_id, int trajectory_id,
const std::vector<std::shared_ptr<const Submap>>& insertion_submaps) const std::vector<std::shared_ptr<const Submap>>& insertion_submaps)

View File

@ -90,7 +90,7 @@ std::vector<mapping::SubmapId> SparsePoseGraph::GrowSubmapTransformsAsNeeded(
return {front_submap_id, last_submap_id}; return {front_submap_id, last_submap_id};
} }
void SparsePoseGraph::AddScan( mapping::NodeId SparsePoseGraph::AddScan(
std::shared_ptr<const mapping::TrajectoryNode::Data> constant_data, std::shared_ptr<const mapping::TrajectoryNode::Data> constant_data,
const int trajectory_id, const int trajectory_id,
const std::vector<std::shared_ptr<const Submap>>& insertion_submaps) { const std::vector<std::shared_ptr<const Submap>>& insertion_submaps) {
@ -121,6 +121,7 @@ void SparsePoseGraph::AddScan(
ComputeConstraintsForScan(node_id, insertion_submaps, ComputeConstraintsForScan(node_id, insertion_submaps,
newly_finished_submap); newly_finished_submap);
}); });
return node_id;
} }
void SparsePoseGraph::AddWorkItem(const std::function<void()>& work_item) { void SparsePoseGraph::AddWorkItem(const std::function<void()>& work_item) {

View File

@ -70,7 +70,7 @@ class SparsePoseGraph : public mapping::SparsePoseGraph {
// 'insertion_submaps.front()' and the scan was inserted into the // 'insertion_submaps.front()' and the scan was inserted into the
// 'insertion_submaps'. If 'insertion_submaps.front().finished()' is // 'insertion_submaps'. If 'insertion_submaps.front().finished()' is
// 'true', this submap was inserted into for the last time. // 'true', this submap was inserted into for the last time.
void AddScan( mapping::NodeId AddScan(
std::shared_ptr<const mapping::TrajectoryNode::Data> constant_data, std::shared_ptr<const mapping::TrajectoryNode::Data> constant_data,
int trajectory_id, int trajectory_id,
const std::vector<std::shared_ptr<const Submap>>& insertion_submaps) const std::vector<std::shared_ptr<const Submap>>& insertion_submaps)