Some fixes:

-Memory: Fixed wrongly rejected scan matching transform because of too large correction
-DBViewer: Fixed not shown proximity scans
-DBDriver: Fixed not loaded links' user_data on getAllLinks() method
-MainWindow: Added planning statistics
-DBReader: set a maximum of 10 sec sleep if the map ID has changed
This commit is contained in:
matlabbe
2015-10-26 12:59:20 -04:00
parent 463a5d973c
commit 02ebb3c7e8
12 changed files with 161 additions and 54 deletions

View File

@@ -54,7 +54,8 @@ DBReader::DBReader(const std::string & databasePath,
_goalsIgnored(goalsIgnored),
_dbDriver(0),
_currentId(_ids.end()),
_previousStamp(0)
_previousStamp(0),
_previousMapID(0)
{
}
@@ -70,7 +71,8 @@ DBReader::DBReader(const std::list<std::string> & databasePaths,
_goalsIgnored(goalsIgnored),
_dbDriver(0),
_currentId(_ids.end()),
_previousStamp(0)
_previousStamp(0),
_previousMapID(0)
{
}
@@ -94,6 +96,7 @@ bool DBReader::init(int startIndex)
_ids.clear();
_currentId=_ids.end();
_previousStamp = 0;
_previousMapID = 0;
if(_paths.size() == 0)
{
@@ -315,9 +318,15 @@ OdometryEvent DBReader::getNextData()
UERROR("The option to use database stamps is set (framerate<0), but there are no stamps saved in the database! Aborting...");
this->kill();
}
else if(_previousStamp > 0)
else if(_previousMapID == mapId && _previousStamp > 0)
{
int sleepTime = 1000.0*(stamp-_previousStamp) - 1000.0*_timer.getElapsedTime();
if(sleepTime > 10000)
{
UWARN("Detected long delay (%d sec, stamps = %f vs %f). Waiting a maximum of 10 seconds.",
sleepTime/1000, _previousStamp, stamp);
sleepTime = 10000;
}
if(sleepTime > 2)
{
uSleep(sleepTime-2);
@@ -334,6 +343,7 @@ OdometryEvent DBReader::getNextData()
UDEBUG("slept=%fs vs target=%fs", slept, stamp-_previousStamp);
}
_previousStamp = stamp;
_previousMapID = mapId;
}
else if(_frameRate>0.0f)
{