mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-07 18:47:48 +08:00
Export CLI tool memory optimization (#1391)
* Stashing changes so far * Tested and working * removed unused options * Added density_radius and density_angle options * improved description * backward compatibility fixes, matching texture exported file names with base name * Setting global full opt by default, updated preferences defaulting to g2o or gtsam if one or the other is unavailable
This commit is contained in:
@@ -922,6 +922,45 @@ void DBDriver::getAllNodeIds(std::set<int> & ids, bool ignoreChildren, bool igno
|
||||
_dbSafeAccessMutex.unlock();
|
||||
}
|
||||
|
||||
void DBDriver::getAllOdomPoses(std::map<int, Transform> & poses, bool ignoreChildren, bool ignoreIntermediateNodes) const
|
||||
{
|
||||
// look in the trash
|
||||
_trashesMutex.lock();
|
||||
if(_trashSignatures.size())
|
||||
{
|
||||
for(std::map<int, Signature*>::const_iterator sIter = _trashSignatures.begin(); sIter!=_trashSignatures.end(); ++sIter)
|
||||
{
|
||||
bool hasNeighbors = !ignoreChildren;
|
||||
if(ignoreChildren)
|
||||
{
|
||||
for(std::map<int, Link>::const_iterator nIter = sIter->second->getLinks().begin();
|
||||
nIter!=sIter->second->getLinks().end();
|
||||
++nIter)
|
||||
{
|
||||
if(nIter->second.type() == Link::kNeighbor ||
|
||||
nIter->second.type() == Link::kNeighborMerged)
|
||||
{
|
||||
hasNeighbors = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(hasNeighbors && (!ignoreIntermediateNodes || sIter->second->getWeight() != -1))
|
||||
{
|
||||
poses.insert(std::make_pair(sIter->first, sIter->second->getPose()));
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<int> keys = uKeys(_trashSignatures);
|
||||
|
||||
}
|
||||
_trashesMutex.unlock();
|
||||
|
||||
_dbSafeAccessMutex.lock();
|
||||
this->getAllOdomPosesQuery(poses, ignoreChildren, ignoreIntermediateNodes);
|
||||
_dbSafeAccessMutex.unlock();
|
||||
}
|
||||
|
||||
void DBDriver::getAllLinks(std::multimap<int, Link> & links, bool ignoreNullLinks, bool withLandmarks) const
|
||||
{
|
||||
_dbSafeAccessMutex.lock();
|
||||
|
||||
Reference in New Issue
Block a user