Added Map color overlay on 3D cloud (press key '2' on keyboard)

Fixed loading all node ids from database, ignoring children

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1813 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2014-10-01 21:44:46 +00:00
parent 317d382a24
commit c441cc1d0f
10 changed files with 101 additions and 27 deletions
+16 -4
View File
@@ -806,7 +806,7 @@ void DBDriverSqlite3::getPoseQuery(int signatureId, Transform & pose, int & mapI
}
void DBDriverSqlite3::getAllNodeIdsQuery(std::set<int> & ids) const
void DBDriverSqlite3::getAllNodeIdsQuery(std::set<int> & ids, bool ignoreChildren) const
{
if(_ppDb)
{
@@ -816,9 +816,21 @@ void DBDriverSqlite3::getAllNodeIdsQuery(std::set<int> & ids) const
sqlite3_stmt * ppStmt = 0;
std::stringstream query;
query << "SELECT id "
<< "FROM Node "
<< "ORDER BY id";
if(!ignoreChildren)
{
query << "SELECT id "
<< "FROM Node "
<< "ORDER BY id";
}
else
{
query << "SELECT id "
<< "FROM Node "
<< "LEFT OUTER JOIN Link "
<< "ON id = from_id "
<< "WHERE type!=1 "
<< "ORDER BY id";
}
rc = sqlite3_prepare_v2(_ppDb, query.str().c_str(), -1, &ppStmt, 0);
UASSERT_MSG(rc == SQLITE_OK, uFormat("DB error: %s", sqlite3_errmsg(_ppDb)).c_str());