Skip to content

Commit

Permalink
Merge pull request uzh-rpg#69 from andre-nguyen/master
Browse files Browse the repository at this point in the history
fix relocalization segfault
  • Loading branch information
cfo committed Feb 4, 2015
2 parents 1282a95 + 30a43cc commit a9ea5f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions svo/src/frame_handler_mono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ FrameHandlerMono::UpdateResult FrameHandlerMono::relocalizeFrame(
FramePtr ref_keyframe)
{
SVO_WARN_STREAM_THROTTLE(1.0, "Relocalizing frame");
if(ref_keyframe == nullptr)
{
SVO_INFO_STREAM("Relocalization successful.");
return RESULT_FAILURE;
}
SparseImgAlign img_align(Config::kltMaxLevel(), Config::kltMinLevel(),
30, SparseImgAlign::GaussNewton, false, false);
size_t img_align_n_tracked = img_align.run(ref_keyframe, new_frame_);
Expand Down
5 changes: 5 additions & 0 deletions svo/src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ FramePtr Map::getClosestKeyframe(const FramePtr& frame) const
{
list< pair<FramePtr,double> > close_kfs;
getCloseKeyframes(frame, close_kfs);
if(close_kfs.empty())
{
return nullptr;
}


// Sort KFs with overlap according to their closeness
close_kfs.sort(boost::bind(&std::pair<FramePtr, double>::second, _1) <
Expand Down

0 comments on commit a9ea5f5

Please sign in to comment.