30 #ifndef RTABMAP_FLANN_PARAMS_H_ 31 #define RTABMAP_FLANN_PARAMS_H_ 63 SearchParams(
int checks_ = 32,
float eps_ = 0.0,
bool sorted_ =
true ) :
64 checks(checks_), eps(eps_), sorted(sorted_)
69 matrices_in_gpu_ram =
false;
89 inline bool has_param(
const IndexParams& params, std::string name)
91 return params.find(name)!=params.end();
95 T get_param(
const IndexParams& params, std::string name,
const T& default_value)
97 IndexParams::const_iterator it = params.find(name);
98 if (it != params.end()) {
99 return it->second.cast<
T>();
102 return default_value;
109 IndexParams::const_iterator it = params.find(name);
110 if (it != params.end()) {
111 return it->second.cast<
T>();
114 throw FLANNException(std::string(
"Missing parameter '")+name+std::string(
"' in the parameters given"));
120 IndexParams::const_iterator it;
122 for(it=params.begin(); it!=params.end(); ++it) {
123 std::cout << it->first <<
" : " << it->second << std::endl;
129 std::cout <<
"checks : " << params.
checks << std::endl;
130 std::cout <<
"eps : " << params.
eps << std::endl;
131 std::cout <<
"sorted : " << params.
sorted << std::endl;
132 std::cout <<
"max_neighbors : " << params.
max_neighbors << std::endl;
std::map< std::string, any > IndexParams
SearchParams(int checks_=32, float eps_=0.0, bool sorted_=true)
T get_param(const IndexParams ¶ms, std::string name, const T &default_value)
SMALL_POLICY(signed char)
void print_params(const IndexParams ¶ms)
bool has_param(const IndexParams ¶ms, std::string name)