Skip to content

Commit

Permalink
Fixes two keyframing issues:
Browse files Browse the repository at this point in the history
  1. Solves crash during kfh when a vertex is deleted during merging and
     a const ref pointing to the transformation_edge's sensor_id no longer
     exists and contains a bogus value.
  2. Solves crash where the last vertex in a map is added twice during keyframing,
     causing issues downstream.
  • Loading branch information
Benjamin Hahn committed Dec 4, 2019
1 parent 736b1c4 commit 2b1a12d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion algorithms/map-sparsification/src/keyframe-pruning.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ size_t selectKeyframesBasedOnHeuristics(
}

// The last vertex is always a keyframe
insert_keyframe(current_vertex_id);
if (last_keyframe_id != current_vertex_id) {
insert_keyframe(current_vertex_id);
}

return selected_keyframes->size();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ int keyframeMapBasedOnHeuristics(
return common::CommandStatus::kUnknownError;
}

if (keyframe_ids.back() != last_vertex_id) {
keyframe_ids.emplace_back(last_vertex_id);
}

// Optionally, visualize the selected keyframes.
if (plotter != nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion map-structure/vi-map/src/pose-graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void PoseGraph::mergeNeighboringEdges<TransformationEdge>(
CHECK_EQ(merge_into_vertex_id, edge_between_vertices.from());
CHECK_EQ(edge_between_vertices.to(), edge_after_next_vertex.from());

const aslam::SensorId& sensor_id = edge_between_vertices.getSensorId();
const aslam::SensorId sensor_id = edge_between_vertices.getSensorId();
CHECK_EQ(sensor_id, edge_after_next_vertex.getSensorId());

const Edge::EdgeType edge_type = edge_between_vertices.getType();
Expand Down

0 comments on commit 2b1a12d

Please sign in to comment.