Re: Transformations between Maps

Posted by Kaifei on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Transformations-between-Maps-tp1126p1145.html

Thanks!

One more question. What is the best practice to pick the parameters for "Optimizer::optimize(rootId, poses, constraints)"?

In particular, I did
std::map<int, int> ids = _memory->getNeighborsId(_memory->getLastSignatureId(), 0, 0);
 _memory->getMetricConstraints(uKeysSet(ids), poses, links);
rtabmap::Optimizer *graphOptimizer = rtabmap::Optimizer::create(rtabmap::Optimizer::kTypeTORO);
_optimizedPoses = graphOptimizer->optimize(poses.begin()->first, poses, links);

But it turns out the getLastSignatureId() doesn't have any neighbor in the graph extracted from the link table. So the ids contains only one id (the one returned by getLastSignatureId).

I then do
std::list<int> idList = uKeysList(_memory->getWorkingMem());
std::set<int> idSet(idList.begin(), idList.end());
_memory->getMetricConstraints(idSet, poses, links, lookInDatabase);
rtabmap::Optimizer *graphOptimizer = rtabmap::Optimizer::create(rtabmap::Optimizer::kTypeTORO);
_optimizedPoses = graphOptimizer->optimize(poses.begin()->first, poses, links);
which solves my particular problem, but it cannot guarantee that the poses.begin()->first will contain any neighbor on the TORO graph. So I'm wondering whether there is a better way to do this.

Thanks!

Kaifei