mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-04 00:57:46 +08:00
Fixed default nearest neighbor approach for the dictionary when the parameter is not set.
rtabmap_gui parameters panel can be opened without rtabmap parameters set on ROS (only GUI parameters can be changed). Rtabmap: added getStatistics() method for convenience Rtabmap/Memory: added deleteLastLocation() method to remove the last location in the STM. git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@779 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -1384,6 +1384,38 @@ const Signature * Memory::getLastSignature() const
|
||||
return _lastSignature;
|
||||
}
|
||||
|
||||
void Memory::deleteLastLocation()
|
||||
{
|
||||
Signature * lastSignature = _lastSignature;
|
||||
if(_lastSignature)
|
||||
{
|
||||
UDEBUG("deleting last location %d", lastSignature->id());
|
||||
const std::set<int> & neighbors = lastSignature->getNeighbors();
|
||||
for(std::set<int>::iterator iter=neighbors.begin(); iter!=neighbors.end(); ++iter)
|
||||
{
|
||||
Signature * s = _getSignature(*iter);
|
||||
if(s)
|
||||
{
|
||||
s->removeNeighbor(lastSignature->id());
|
||||
_lastSignature = s;
|
||||
}
|
||||
}
|
||||
|
||||
const std::set<int> & child = lastSignature->getChildLoopClosureIds();
|
||||
for(std::set<int>::iterator iter=child.begin(); iter!=child.end(); ++iter)
|
||||
{
|
||||
Signature * s = _getSignature(*iter);
|
||||
if(s)
|
||||
{
|
||||
s->removeLoopClosureId(lastSignature->id());
|
||||
s->setWeight(s->getWeight() + lastSignature->getWeight());
|
||||
}
|
||||
}
|
||||
|
||||
this->moveToTrash(lastSignature);
|
||||
}
|
||||
}
|
||||
|
||||
bool Memory::addLoopClosureLink(int oldId, int newId)
|
||||
{
|
||||
ULOGGER_INFO("old=%d, new=%d", oldId, newId);
|
||||
|
||||
Reference in New Issue
Block a user