3rdparty/libpointmatcher/utest/ui/Matcher.cpp
Go to the documentation of this file.
1 #include "../utest.h"
2 
3 using namespace std;
4 using namespace PointMatcherSupport;
5 
6 //---------------------------
7 // Matcher modules
8 //---------------------------
9 
10 // Utility classes
11 class MatcherTest: public IcpHelper
12 {
13 
14 public:
15 
16  std::shared_ptr<PM::Matcher> testedMatcher;
17 
18  // Will be called for every tests
19  virtual void SetUp()
20  {
21  icp.setDefault();
22  // Uncomment for consol outputs
23  //setLogger(PM::get().LoggerRegistrar.create("FileLogger"));
24  }
25 
26  // Will be called for every tests
27  virtual void TearDown(){}
28 
29  void addFilter(string name, PM::Parameters params)
30  {
31  testedMatcher =
32  PM::get().MatcherRegistrar.create(name, params);
33  icp.matcher = testedMatcher;
34  }
35 
36 };
37 
38 TEST_F(MatcherTest, KDTreeMatcher)
39 {
40  vector<unsigned> knn = {1, 2, 3};
41  vector<double> epsilon = {0.0, 0.2};
42  vector<double> maxDist = {1.0, 0.5};
43 
44  for(unsigned i=0; i < knn.size(); i++)
45  {
46  for(unsigned j=0; j < epsilon.size(); j++)
47  {
48  for(unsigned k=0; k < maxDist.size(); k++)
49  {
50  params = PM::Parameters();
51  params["knn"] = toParam(knn[i]); // remove end parenthesis for bug
52  params["epsilon"] = toParam(epsilon[j]);
53  params["searchType"] = "1";
54  params["maxDist"] = toParam(maxDist[k]);
55 
56 
57  addFilter("KDTreeMatcher", params);
58  validate2dTransformation();
59  validate3dTransformation();
60  }
61  }
62  }
63 }
MatcherTest
Definition: 3rdparty/libpointmatcher/utest/ui/Matcher.cpp:11
PointMatcher< float >::Parameters
Parametrizable::Parameters Parameters
alias
Definition: PointMatcher.h:186
PointMatcherSupport::toParam
std::string toParam(const S &value)
Return the a string value using lexical_cast.
Definition: Parametrizable.h:92
epsilon
double epsilon
MatcherTest::SetUp
virtual void SetUp()
Definition: 3rdparty/libpointmatcher/utest/ui/Matcher.cpp:19
MatcherTest::testedMatcher
std::shared_ptr< PM::Matcher > testedMatcher
Definition: 3rdparty/libpointmatcher/utest/ui/Matcher.cpp:16
IcpHelper
Definition: utest.h:31
TEST_F
TEST_F(MatcherTest, KDTreeMatcher)
Definition: 3rdparty/libpointmatcher/utest/ui/Matcher.cpp:38
std
PointMatcher< float >::get
static const PointMatcher & get()
Return instances.
Definition: Registry.cpp:141
PointMatcherSupport
Functions and classes that are not dependant on scalar type are defined in this namespace.
Definition: Bibliography.cpp:45
MatcherTest::addFilter
void addFilter(string name, PM::Parameters params)
Definition: 3rdparty/libpointmatcher/utest/ui/Matcher.cpp:29
MatcherTest::TearDown
virtual void TearDown()
Definition: 3rdparty/libpointmatcher/utest/ui/Matcher.cpp:27


mp2p_icp
Author(s):
autogenerated on Thu Dec 26 2024 03:48:12