How to set RTABMap parameter in C++ project?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to set RTABMap parameter in C++ project?

LoganWade
This post was updated on .
Hi,

I'm using the sample code to build a simple RTABMAP program.
There are lots of parameters and here introduced them.

I want to set some RTABMap parameters in C++ project and I only know using config file.
Are there any API provided?
For example, how can I do if I want to ...
  set the detected feature type (SIFT or SURF or...)
  set the registration approach (visual or ICP)
  set the graph optimization approach (TORO or G2O)
and so on.

Thanks a lot.
Wade
Reply | Threaded
Open this post in threaded view
|

Re: How to set RTABMap parameter in C++ project?

m.omar82
for example if you use command console application rtabmap-console, you can find it in bin directory, as show in this page
Benchmark

you can change the  parameter for example if you like to use SIFT -Kp/DetectorStrategy 1 , ORB -Kp/DetectorStrategy 2, but with ORB you have to add this one -Kp/NNStrategy 3. and so on.
Reply | Threaded
Open this post in threaded view
|

Re: How to set RTABMap parameter in C++ project?

LoganWade
Thanks a lot!
You give me a new way to set the parameters.

But what I really want is to set them in C++ codes in my project.
For example, if I use config file to initialize, it will looks like

        Rtabmap rtabmap;
        rtabmap.init("config.ini");
Reply | Threaded
Open this post in threaded view
|

Re: How to set RTABMap parameter in C++ project?

matlabbe
Administrator
Hi,

The config file can be a good approach. If you want to use hard-coded parameters, you can use the Rtabmap::init(ParametersMap) version. You can look at the C++ loop closure detection tutorial. Example:
rtabmap::ParametersMap parameters;

// SIFT vocabulary
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kKpDetectorStrategy(), "1"));
 
// ICP registration
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRegStrategy(), "1")); 

// g2o graph optimization
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kOptimizerStrategy(), "1")); 

rtabmap.init(parameters);
You can see the list of parameters in Parameters.h for convenience.

cheers
Reply | Threaded
Open this post in threaded view
|

Re: How to set RTABMap parameter in C++ project?

LoganWade
Thanks for your help!!!