mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-06 01:57:45 +08:00
updated recovery tool to support databases without image data kept
This commit is contained in:
+23
-11
@@ -4004,7 +4004,7 @@ Signature * Memory::createSignature(const SensorData & inputData, const Transfor
|
||||
float t;
|
||||
std::vector<cv::KeyPoint> keypoints;
|
||||
cv::Mat descriptors;
|
||||
bool isIntermediateNode = data.id() < 0 || data.imageRaw().empty();
|
||||
bool isIntermediateNode = data.id() < 0 || (data.imageRaw().empty() && data.keypoints().empty());
|
||||
int id = data.id();
|
||||
if(_generateIds)
|
||||
{
|
||||
@@ -4955,19 +4955,31 @@ Signature * Memory::createSignature(const SensorData & inputData, const Transfor
|
||||
}
|
||||
|
||||
// Occupancy grid map stuff
|
||||
cv::Mat ground, obstacles, empty;
|
||||
float cellSize = 0.0f;
|
||||
cv::Point3f viewPoint(0,0,0);
|
||||
if(_createOccupancyGrid && !data.depthOrRightRaw().empty() && !isIntermediateNode)
|
||||
if(_createOccupancyGrid && !isIntermediateNode)
|
||||
{
|
||||
_occupancy->createLocalMap(*s, ground, obstacles, empty, viewPoint);
|
||||
cellSize = _occupancy->getCellSize();
|
||||
if(!data.depthOrRightRaw().empty())
|
||||
{
|
||||
cv::Mat ground, obstacles, empty;
|
||||
float cellSize = 0.0f;
|
||||
cv::Point3f viewPoint(0,0,0);
|
||||
_occupancy->createLocalMap(*s, ground, obstacles, empty, viewPoint);
|
||||
cellSize = _occupancy->getCellSize();
|
||||
s->sensorData().setOccupancyGrid(ground, obstacles, empty, cellSize, viewPoint);
|
||||
|
||||
t = timer.ticks();
|
||||
if(stats) stats->addStatistic(Statistics::kTimingMemOccupancy_grid(), t*1000.0f);
|
||||
UDEBUG("time grid map = %fs", t);
|
||||
t = timer.ticks();
|
||||
if(stats) stats->addStatistic(Statistics::kTimingMemOccupancy_grid(), t*1000.0f);
|
||||
UDEBUG("time grid map = %fs", t);
|
||||
}
|
||||
else if(data.gridCellSize() != 0.0f)
|
||||
{
|
||||
s->sensorData().setOccupancyGrid(
|
||||
data.gridGroundCellsRaw(),
|
||||
data.gridObstacleCellsRaw(),
|
||||
data.gridEmptyCellsRaw(),
|
||||
data.gridCellSize(),
|
||||
data.gridViewPoint());
|
||||
}
|
||||
}
|
||||
s->sensorData().setOccupancyGrid(ground, obstacles, empty, cellSize, viewPoint);
|
||||
|
||||
// prior
|
||||
if(!isIntermediateNode)
|
||||
|
||||
Reference in New Issue
Block a user