Skip to content

Commit

Permalink
Merge pull request #183 from ethz-asl/fix/keyframing_crash
Browse files Browse the repository at this point in the history
Fix two keyframing issues
  • Loading branch information
b-hahn authored Dec 5, 2019
2 parents 736b1c4 + 071a11d commit c1e3f77
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 6 additions & 2 deletions algorithms/map-sparsification/src/keyframe-pruning.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,12 @@ size_t selectKeyframesBasedOnHeuristics(
++num_frames_since_last_keyframe;
}

// The last vertex is always a keyframe
insert_keyframe(current_vertex_id);

// Ensure the last vertex is added as a keyframe if it hasn't been selected
// by any heuristics yet.
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 c1e3f77

Please sign in to comment.