Added Debug log in incremental FLANN stuff (to track a crashing bug)

This commit is contained in:
matlabbe
2015-10-14 11:03:43 -04:00
parent 9bd649009c
commit 457e1e9d21
3 changed files with 24 additions and 9 deletions

View File

@@ -252,12 +252,13 @@ protected:
*/
void buildIndexImpl()
{
UDEBUG("");
// Create a permutable array of indices to the input vectors.
std::vector<int> ind(size_);
for (size_t i = 0; i < size_; ++i) {
ind[i] = int(i);
}
UDEBUG("");
mean_ = new DistanceType[veclen_];
var_ = new DistanceType[veclen_];
@@ -268,8 +269,10 @@ protected:
std::random_shuffle(ind.begin(), ind.end());
tree_roots_[i] = divideTree(&ind[0], int(size_) );
}
UDEBUG("");
delete[] mean_;
delete[] var_;
UDEBUG("");
}
void freeIndex()

View File

@@ -39,6 +39,7 @@
#include "rtflann/util/result_set.h"
#include "rtflann/util/dynamic_bitset.h"
#include "rtflann/util/saving.h"
#include "rtabmap/utilite/ULogger.h"
namespace rtflann
{
@@ -124,12 +125,15 @@ public:
*/
virtual void buildIndex()
{
UDEBUG("");
freeIndex();
UDEBUG("");
cleanRemovedPoints();
UDEBUG("");
// building index
buildIndexImpl();
UDEBUG("");
size_at_build_ = size_;
}