DBDriver: when an empty database url is provided, an empty database "in memory" is used by default. Tango: fixed second database not recorded in Data Recorder mode (now creating a new one on save). Mapping parameters are saved in database instead of the one used to record data (Data Recorder mode).

This commit is contained in:
matlabbe
2016-11-23 15:13:09 -05:00
parent 639896b309
commit 23bb5d5147
9 changed files with 77 additions and 47 deletions
+3 -3
View File
@@ -151,7 +151,7 @@ bool Memory::init(const std::string & dbUrl, bool dbOverwritten, const Parameter
if(postInitClosingEvents) UEventsManager::post(new RtabmapEventInit("Closing database connection, done!"));
}
if(_dbDriver == 0 && !dbUrl.empty())
if(_dbDriver == 0)
{
_dbDriver = DBDriver::create(parameters);
}
@@ -161,11 +161,11 @@ bool Memory::init(const std::string & dbUrl, bool dbOverwritten, const Parameter
{
_dbDriver->setTimestampUpdateEnabled(true); // make sure that timestamp update is enabled (may be disabled above)
success = false;
if(postInitClosingEvents) UEventsManager::post(new RtabmapEventInit(std::string("Connecting to database ") + dbUrl + "..."));
if(postInitClosingEvents) UEventsManager::post(new RtabmapEventInit(std::string("Connecting to database \"") + dbUrl + "\"..."));
if(_dbDriver->openConnection(dbUrl, dbOverwritten))
{
success = true;
if(postInitClosingEvents) UEventsManager::post(new RtabmapEventInit(std::string("Connecting to database ") + dbUrl + ", done!"));
if(postInitClosingEvents) UEventsManager::post(new RtabmapEventInit(std::string("Connecting to database \"") + dbUrl + "\", done!"));
// Load the last working memory...
std::list<Signature*> dbSignatures;