Fixed assert "((int)path.size() < = maxGraphDepth*2+1)" when Mem/ReduceGraph=On

This commit is contained in:
matlabbe
2016-11-02 13:06:38 -04:00
parent 8718bb4ff1
commit 043e288d70

View File

@@ -2894,11 +2894,10 @@ std::map<int, std::map<int, Transform> > Rtabmap::getPaths(std::map<int, Transfo
} }
} }
UASSERT_MSG(path.size(), uFormat("nearestId=%d ids=%d", nearestId, (int)ids.size()).c_str()); UASSERT_MSG(path.size(), uFormat("nearestId=%d ids=%d", nearestId, (int)ids.size()).c_str());
if(maxGraphDepth > 0) if(maxGraphDepth > 0 && !_memory->isGraphReduced() && (int)path.size() > maxGraphDepth*2+1)
{ {
UASSERT_MSG((int)path.size() <= maxGraphDepth*2+1, UWARN("%s=Off but path(%d) > maxGraphDepth(%d)*2+1, nearestId=%d ids=%d. Is reduce graph activated before?",
uFormat("nearestId=%d path=%d ids=%d maxGraphDepth=%d", Parameters::kMemReduceGraph().c_str(), (int)path.size(), maxGraphDepth, nearestId, (int)ids.size());
nearestId, (int)path.size(), (int)ids.size(), maxGraphDepth).c_str());
} }
paths.insert(std::make_pair(nearestId, path)); paths.insert(std::make_pair(nearestId, path));
} }