mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
DB: Added error when loading a database with version more recent than installed rtabmap version
This commit is contained in:
@@ -373,6 +373,15 @@ bool DBDriverSqlite3::connectDatabaseQuery(const std::string & url, bool overwri
|
||||
UASSERT(this->getDatabaseVersionQuery(_version)); // must be true!
|
||||
UINFO("Database version = %s", _version.c_str());
|
||||
|
||||
if(uStrNumCmp(_version, RTABMAP_VERSION) > 0)
|
||||
{
|
||||
UERROR("Opened database version (%s) is more recent than rtabmap "
|
||||
"installed version (%s). Please update rtabmap to new version!",
|
||||
_version.c_str(), RTABMAP_VERSION);
|
||||
this->disconnectDatabaseQuery(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
//Set database optimizations
|
||||
this->setCacheSize(_cacheSize); // this will call the SQL
|
||||
this->setJournalMode(_journalMode); // this will call the SQL
|
||||
|
||||
Reference in New Issue
Block a user