Skip to content
Snippets Groups Projects
Commit 1abdf4ab authored by Sergi Pujol's avatar Sergi Pujol
Browse files

findloopClosure function segmentation fault error corrected

parent 65e79c90
No related branches found
No related tags found
1 merge request!4Resolve "Implementation of Falko lib"
...@@ -42,6 +42,8 @@ void CornerFalko2d::storeCorners (falkolib::LaserScan scan, int scanInterval){ ...@@ -42,6 +42,8 @@ void CornerFalko2d::storeCorners (falkolib::LaserScan scan, int scanInterval){
keypointSets.push_back(lastKeypointSet); keypointSets.push_back(lastKeypointSet);
descriptorSets.push_back(lastDescriptorSet); descriptorSets.push_back(lastDescriptorSet);
std::cout << "sizeof : " << lastKeypointSet.size() << std::endl;
} }
} }
...@@ -56,13 +58,15 @@ void CornerFalko2d::findLoopClosure(falkolib::LaserScan scan){ ...@@ -56,13 +58,15 @@ void CornerFalko2d::findLoopClosure(falkolib::LaserScan scan){
compute(scan, keypointSet2, descriptorSet2); compute(scan, keypointSet2, descriptorSet2);
//Matching //Matching
int rows = sizeof(keypointSets)/sizeof(keypointSets[0]);
int cols = sizeof(keypointSets)/(sizeof(int)*rows);
for (int i=0; i<keypointSets.size();i++){ for (int i=0; i<rows;i++){
setDistanceThreshold(0.1);
std::vector<std::pair<int, int> > assoNN; std::vector<std::pair<int, int> > assoNN;
int matchingNumber = match(keypointSets[i], keypointSet2, assoNN); matchingNumber = match(keypointSets[i], keypointSet2, assoNN);
}
}
} }
......
...@@ -77,6 +77,8 @@ public: ...@@ -77,6 +77,8 @@ public:
std::vector<std::vector<falkolib::BSC>> descriptorSets; std::vector<std::vector<falkolib::BSC>> descriptorSets;
std::vector<falkolib::BSC>lastDescriptorSet; std::vector<falkolib::BSC>lastDescriptorSet;
int matchingNumber;
int scanNumber=0; int scanNumber=0;
}; };
......
...@@ -35,4 +35,6 @@ int main(int argc, char** argv) ...@@ -35,4 +35,6 @@ int main(int argc, char** argv)
CornerMatching.findLoopClosure(scan1); CornerMatching.findLoopClosure(scan1);
std::cout << "matching number : " << CornerMatching.matchingNumber << std::endl;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment