From 595ac4955208155634cf518a2125602a2040542f Mon Sep 17 00:00:00 2001 From: matlabbe Date: Fri, 17 Feb 2017 14:37:41 -0500 Subject: [PATCH] 0.12.0: database update: added missing octave field, added preview_image field --- CMakeLists.txt | 4 ++-- corelib/src/DBDriverSqlite3.cpp | 20 ++++++++++++++++++-- corelib/src/resources/DatabaseSchema.sql.in | 2 ++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 836a0b46..3f100806 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,8 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules") # VERSION ####################### SET(RTABMAP_MAJOR_VERSION 0) -SET(RTABMAP_MINOR_VERSION 11) -SET(RTABMAP_PATCH_VERSION 14) +SET(RTABMAP_MINOR_VERSION 12) +SET(RTABMAP_PATCH_VERSION 0) SET(RTABMAP_VERSION ${RTABMAP_MAJOR_VERSION}.${RTABMAP_MINOR_VERSION}.${RTABMAP_PATCH_VERSION}) diff --git a/corelib/src/DBDriverSqlite3.cpp b/corelib/src/DBDriverSqlite3.cpp index 562cdfb7..5dc4a388 100644 --- a/corelib/src/DBDriverSqlite3.cpp +++ b/corelib/src/DBDriverSqlite3.cpp @@ -1992,7 +1992,13 @@ void DBDriverSqlite3::loadSignaturesQuery(const std::list & ids, std::list< // Prepare the query... Get the map from signature and visual words std::stringstream query2; - if(uStrNumCmp(_version, "0.11.2") >= 0) + if(uStrNumCmp(_version, "0.11.15") >= 0) + { + query2 << "SELECT word_id, pos_x, pos_y, size, dir, response, octave, depth_x, depth_y, depth_z, descriptor_size, descriptor " + "FROM Map_Node_Word " + "WHERE node_id = ? "; + } + else if(uStrNumCmp(_version, "0.11.2") >= 0) { query2 << "SELECT word_id, pos_x, pos_y, size, dir, response, depth_x, depth_y, depth_z, descriptor_size, descriptor " "FROM Map_Node_Word " @@ -2039,6 +2045,10 @@ void DBDriverSqlite3::loadSignaturesQuery(const std::list & ids, std::list< kpt.size = sqlite3_column_int(ppStmt, index++); kpt.angle = sqlite3_column_double(ppStmt, index++); kpt.response = sqlite3_column_double(ppStmt, index++); + if(uStrNumCmp(_version, "0.11.15") >= 0) + { + kpt.octave = sqlite3_column_int(ppStmt, index++); + } depth.x = sqlite3_column_double(ppStmt, index++); depth.y = sqlite3_column_double(ppStmt, index++); depth.z = sqlite3_column_double(ppStmt, index++); @@ -3857,7 +3867,11 @@ void DBDriverSqlite3::stepWordsChanged(sqlite3_stmt * ppStmt, int nodeId, int ol std::string DBDriverSqlite3::queryStepKeypoint() const { - if(uStrNumCmp(_version, "0.11.2") >= 0) + if(uStrNumCmp(_version, "0.11.15") >= 0) + { + return "INSERT INTO Map_Node_Word(node_id, word_id, pos_x, pos_y, size, dir, response, octave, depth_x, depth_y, depth_z, descriptor_size, descriptor) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?);"; + } + else if(uStrNumCmp(_version, "0.11.2") >= 0) { return "INSERT INTO Map_Node_Word(node_id, word_id, pos_x, pos_y, size, dir, response, depth_x, depth_y, depth_z, descriptor_size, descriptor) VALUES(?,?,?,?,?,?,?,?,?,?,?,?);"; } @@ -3890,6 +3904,8 @@ void DBDriverSqlite3::stepKeypoint(sqlite3_stmt * ppStmt, UASSERT_MSG(rc == SQLITE_OK, uFormat("DB error (%s): %s", _version.c_str(), sqlite3_errmsg(_ppDb)).c_str()); rc = sqlite3_bind_double(ppStmt, index++, kp.response); UASSERT_MSG(rc == SQLITE_OK, uFormat("DB error (%s): %s", _version.c_str(), sqlite3_errmsg(_ppDb)).c_str()); + rc = sqlite3_bind_int(ppStmt, index++, kp.octave); + UASSERT_MSG(rc == SQLITE_OK, uFormat("DB error (%s): %s", _version.c_str(), sqlite3_errmsg(_ppDb)).c_str()); rc = sqlite3_bind_double(ppStmt, index++, pt.x); UASSERT_MSG(rc == SQLITE_OK, uFormat("DB error (%s): %s", _version.c_str(), sqlite3_errmsg(_ppDb)).c_str()); rc = sqlite3_bind_double(ppStmt, index++, pt.y); diff --git a/corelib/src/resources/DatabaseSchema.sql.in b/corelib/src/resources/DatabaseSchema.sql.in index d578d1e3..5aaa07b2 100644 --- a/corelib/src/resources/DatabaseSchema.sql.in +++ b/corelib/src/resources/DatabaseSchema.sql.in @@ -76,6 +76,7 @@ CREATE TABLE Map_Node_Word ( size INTEGER NOT NULL, dir FLOAT NOT NULL, response FLOAT NOT NULL, + octave INTEGER NOT NULL, depth_x FLOAT, depth_y FLOAT, depth_z FLOAT, @@ -103,6 +104,7 @@ CREATE TABLE Statistics ( CREATE TABLE Admin ( version TEXT, + preview_image BLOB, time_enter DATE );