diff --git a/cartographer/mapping_2d/sparse_pose_graph.cc b/cartographer/mapping_2d/sparse_pose_graph.cc index b1279b1..ad9c0e2 100644 --- a/cartographer/mapping_2d/sparse_pose_graph.cc +++ b/cartographer/mapping_2d/sparse_pose_graph.cc @@ -93,7 +93,7 @@ std::vector SparsePoseGraph::GrowSubmapTransformsAsNeeded( return {front_submap_id, last_submap_id}; } -void SparsePoseGraph::AddScan( +mapping::NodeId SparsePoseGraph::AddScan( std::shared_ptr constant_data, const int trajectory_id, const std::vector>& insertion_submaps) { @@ -124,6 +124,7 @@ void SparsePoseGraph::AddScan( ComputeConstraintsForScan(node_id, insertion_submaps, newly_finished_submap); }); + return node_id; } void SparsePoseGraph::AddWorkItem(const std::function& work_item) { diff --git a/cartographer/mapping_2d/sparse_pose_graph.h b/cartographer/mapping_2d/sparse_pose_graph.h index b0b60fb..f370380 100644 --- a/cartographer/mapping_2d/sparse_pose_graph.h +++ b/cartographer/mapping_2d/sparse_pose_graph.h @@ -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 constant_data, int trajectory_id, const std::vector>& insertion_submaps) diff --git a/cartographer/mapping_3d/sparse_pose_graph.cc b/cartographer/mapping_3d/sparse_pose_graph.cc index 86e00c3..ed79a71 100644 --- a/cartographer/mapping_3d/sparse_pose_graph.cc +++ b/cartographer/mapping_3d/sparse_pose_graph.cc @@ -90,7 +90,7 @@ std::vector SparsePoseGraph::GrowSubmapTransformsAsNeeded( return {front_submap_id, last_submap_id}; } -void SparsePoseGraph::AddScan( +mapping::NodeId SparsePoseGraph::AddScan( std::shared_ptr constant_data, const int trajectory_id, const std::vector>& insertion_submaps) { @@ -121,6 +121,7 @@ void SparsePoseGraph::AddScan( ComputeConstraintsForScan(node_id, insertion_submaps, newly_finished_submap); }); + return node_id; } void SparsePoseGraph::AddWorkItem(const std::function& work_item) { diff --git a/cartographer/mapping_3d/sparse_pose_graph.h b/cartographer/mapping_3d/sparse_pose_graph.h index 1b24980..fddd023 100644 --- a/cartographer/mapping_3d/sparse_pose_graph.h +++ b/cartographer/mapping_3d/sparse_pose_graph.h @@ -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 constant_data, int trajectory_id, const std::vector>& insertion_submaps)