Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cartographer/mapping_2d/sparse_pose_graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ std::vector<mapping::SubmapId> SparsePoseGraph::GrowSubmapTransformsAsNeeded(
return {front_submap_id, last_submap_id};
}

void SparsePoseGraph::AddScan(
mapping::NodeId SparsePoseGraph::AddScan(
std::shared_ptr<const mapping::TrajectoryNode::Data> constant_data,
const int trajectory_id,
const std::vector<std::shared_ptr<const Submap>>& insertion_submaps) {
Expand Down Expand Up @@ -124,6 +124,7 @@ void SparsePoseGraph::AddScan(
ComputeConstraintsForScan(node_id, insertion_submaps,
newly_finished_submap);
});
return node_id;
}

void SparsePoseGraph::AddWorkItem(const std::function<void()>& work_item) {
Expand Down
2 changes: 1 addition & 1 deletion cartographer/mapping_2d/sparse_pose_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SparsePoseGraph : public mapping::SparsePoseGraph {
// 'insertion_submaps.front()' and the scan was inserted into the
// 'insertion_submaps'. If 'insertion_submaps.front().finished()' is
// 'true', this submap was inserted into for the last time.
void AddScan(
mapping::NodeId AddScan(
std::shared_ptr<const mapping::TrajectoryNode::Data> constant_data,
int trajectory_id,
const std::vector<std::shared_ptr<const Submap>>& insertion_submaps)
Expand Down
3 changes: 2 additions & 1 deletion cartographer/mapping_3d/sparse_pose_graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ std::vector<mapping::SubmapId> SparsePoseGraph::GrowSubmapTransformsAsNeeded(
return {front_submap_id, last_submap_id};
}

void SparsePoseGraph::AddScan(
mapping::NodeId SparsePoseGraph::AddScan(
std::shared_ptr<const mapping::TrajectoryNode::Data> constant_data,
const int trajectory_id,
const std::vector<std::shared_ptr<const Submap>>& insertion_submaps) {
Expand Down Expand Up @@ -121,6 +121,7 @@ void SparsePoseGraph::AddScan(
ComputeConstraintsForScan(node_id, insertion_submaps,
newly_finished_submap);
});
return node_id;
}

void SparsePoseGraph::AddWorkItem(const std::function<void()>& work_item) {
Expand Down
2 changes: 1 addition & 1 deletion cartographer/mapping_3d/sparse_pose_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SparsePoseGraph : public mapping::SparsePoseGraph {
// 'insertion_submaps.front()' and the scan was inserted into the
// 'insertion_submaps'. If 'insertion_submaps.front().finished()' is
// 'true', this submap was inserted into for the last time.
void AddScan(
mapping::NodeId AddScan(
std::shared_ptr<const mapping::TrajectoryNode::Data> constant_data,
int trajectory_id,
const std::vector<std::shared_ptr<const Submap>>& insertion_submaps)
Expand Down