mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
report: added --ignore_inter_nodes option. CloudViewer: set max absolute scan intensity to 100 (was 0=auto). reprocess/replay db: ignore intermediate nodes if Rtabmap/CreateIntermediateNodes is false.
This commit is contained in:
@@ -873,7 +873,7 @@ void DBDriver::getLastNodeIds(std::set<int> & ids) const
|
||||
_dbSafeAccessMutex.unlock();
|
||||
}
|
||||
|
||||
void DBDriver::getAllNodeIds(std::set<int> & ids, bool ignoreChildren, bool ignoreBadSignatures) const
|
||||
void DBDriver::getAllNodeIds(std::set<int> & ids, bool ignoreChildren, bool ignoreBadSignatures, bool ignoreIntermediateNodes) const
|
||||
{
|
||||
// look in the trash
|
||||
_trashesMutex.lock();
|
||||
@@ -896,7 +896,7 @@ void DBDriver::getAllNodeIds(std::set<int> & ids, bool ignoreChildren, bool igno
|
||||
}
|
||||
}
|
||||
}
|
||||
if(hasNeighbors)
|
||||
if(hasNeighbors && (!ignoreIntermediateNodes || sIter->second->getWeight() != -1))
|
||||
{
|
||||
ids.insert(sIter->first);
|
||||
}
|
||||
@@ -908,7 +908,7 @@ void DBDriver::getAllNodeIds(std::set<int> & ids, bool ignoreChildren, bool igno
|
||||
_trashesMutex.unlock();
|
||||
|
||||
_dbSafeAccessMutex.lock();
|
||||
this->getAllNodeIdsQuery(ids, ignoreChildren, ignoreBadSignatures);
|
||||
this->getAllNodeIdsQuery(ids, ignoreChildren, ignoreBadSignatures, ignoreIntermediateNodes);
|
||||
_dbSafeAccessMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -2396,7 +2396,7 @@ void DBDriverSqlite3::getLastNodeIdsQuery(std::set<int> & ids) const
|
||||
}
|
||||
}
|
||||
|
||||
void DBDriverSqlite3::getAllNodeIdsQuery(std::set<int> & ids, bool ignoreChildren, bool ignoreBadSignatures) const
|
||||
void DBDriverSqlite3::getAllNodeIdsQuery(std::set<int> & ids, bool ignoreChildren, bool ignoreBadSignatures, bool ignoreIntermediateNodes) const
|
||||
{
|
||||
if(_ppDb)
|
||||
{
|
||||
@@ -2414,11 +2414,19 @@ void DBDriverSqlite3::getAllNodeIdsQuery(std::set<int> & ids, bool ignoreChildre
|
||||
query << "ON id = to_id "; // use to_id to ignore all children (which don't have link pointing on them)
|
||||
query << "WHERE from_id != to_id "; // ignore self referring links
|
||||
query << "AND weight>-9 "; //ignore invalid nodes
|
||||
if(ignoreIntermediateNodes)
|
||||
{
|
||||
query << "AND weight!=-1 "; //ignore intermediate nodes
|
||||
}
|
||||
}
|
||||
else if(ignoreIntermediateNodes)
|
||||
{
|
||||
query << "WHERE weight!=-1 "; //ignore intermediate nodes
|
||||
}
|
||||
|
||||
if(ignoreBadSignatures)
|
||||
{
|
||||
if(ignoreChildren)
|
||||
if(ignoreChildren || ignoreIntermediateNodes)
|
||||
{
|
||||
query << "AND ";
|
||||
}
|
||||
@@ -2435,6 +2443,7 @@ void DBDriverSqlite3::getAllNodeIdsQuery(std::set<int> & ids, bool ignoreChildre
|
||||
query << " id in (select node_id from Map_Node_Word) ";
|
||||
}
|
||||
}
|
||||
|
||||
query << "ORDER BY id";
|
||||
|
||||
rc = sqlite3_prepare_v2(_ppDb, query.str().c_str(), -1, &ppStmt, 0);
|
||||
|
||||
@@ -49,7 +49,8 @@ DBReader::DBReader(const std::string & databasePath,
|
||||
bool goalsIgnored,
|
||||
int startId,
|
||||
int cameraIndex,
|
||||
int stopId) :
|
||||
int stopId,
|
||||
bool intermediateNodesIgnored) :
|
||||
Camera(frameRate),
|
||||
_paths(uSplit(databasePath, ';')),
|
||||
_odometryIgnored(odometryIgnored),
|
||||
@@ -58,6 +59,7 @@ DBReader::DBReader(const std::string & databasePath,
|
||||
_startId(startId),
|
||||
_stopId(stopId),
|
||||
_cameraIndex(cameraIndex),
|
||||
_intermediateNodesIgnored(intermediateNodesIgnored),
|
||||
_dbDriver(0),
|
||||
_currentId(_ids.end()),
|
||||
_previousMapId(-1),
|
||||
@@ -78,7 +80,8 @@ DBReader::DBReader(const std::list<std::string> & databasePaths,
|
||||
bool goalsIgnored,
|
||||
int startId,
|
||||
int cameraIndex,
|
||||
int stopId) :
|
||||
int stopId,
|
||||
bool intermediateNodesIgnored) :
|
||||
Camera(frameRate),
|
||||
_paths(databasePaths),
|
||||
_odometryIgnored(odometryIgnored),
|
||||
@@ -87,6 +90,7 @@ DBReader::DBReader(const std::list<std::string> & databasePaths,
|
||||
_startId(startId),
|
||||
_stopId(stopId),
|
||||
_cameraIndex(cameraIndex),
|
||||
_intermediateNodesIgnored(intermediateNodesIgnored),
|
||||
_dbDriver(0),
|
||||
_currentId(_ids.end()),
|
||||
_previousMapId(-1),
|
||||
@@ -341,7 +345,7 @@ SensorData DBReader::getNextData(CameraInfo * info)
|
||||
SensorData data;
|
||||
if(_dbDriver)
|
||||
{
|
||||
if(_currentId != _ids.end())
|
||||
while(_currentId != _ids.end())
|
||||
{
|
||||
std::list<int> signIds;
|
||||
signIds.push_back(*_currentId);
|
||||
@@ -353,6 +357,14 @@ SensorData DBReader::getNextData(CameraInfo * info)
|
||||
}
|
||||
_dbDriver->loadNodeData(signatures);
|
||||
Signature * s = signatures.front();
|
||||
|
||||
if(_intermediateNodesIgnored && s->getWeight() == -1)
|
||||
{
|
||||
++_currentId;
|
||||
delete s;
|
||||
continue;
|
||||
}
|
||||
|
||||
data = s->sensorData();
|
||||
|
||||
// info
|
||||
@@ -558,6 +570,7 @@ SensorData DBReader::getNextData(CameraInfo * info)
|
||||
}
|
||||
}
|
||||
delete s;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user