mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-07 02:07:45 +08:00
DbViewer: added mapId
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1561 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -103,6 +103,7 @@ public:
|
||||
const Signature * getLastWorkingSignature() const;
|
||||
int getDatabaseMemoryUsed() const; // in bytes
|
||||
double getDbSavingTime() const;
|
||||
int getMapId(int signatureId) const;
|
||||
std::vector<unsigned char> getImage(int signatureId) const;
|
||||
void getImageDepth(
|
||||
int locationId, std::vector<unsigned char> & rgb,
|
||||
|
||||
@@ -2364,6 +2364,22 @@ bool Memory::rehearsalMerge(int oldId, int newId)
|
||||
return false;
|
||||
}
|
||||
|
||||
int Memory::getMapId(int signatureId) const
|
||||
{
|
||||
int mapId = 0;
|
||||
const Signature * s = this->getSignature(signatureId);
|
||||
if(s)
|
||||
{
|
||||
mapId = s->mapId();
|
||||
}
|
||||
else if(_dbDriver)
|
||||
{
|
||||
Transform pose;
|
||||
_dbDriver->getPose(signatureId, pose, mapId);
|
||||
}
|
||||
return mapId;
|
||||
}
|
||||
|
||||
std::vector<unsigned char> Memory::getImage(int signatureId) const
|
||||
{
|
||||
std::vector<unsigned char> image;
|
||||
|
||||
@@ -690,6 +690,7 @@ void DatabaseViewer::update(int value,
|
||||
{
|
||||
view->clear();
|
||||
int id = ids_.at(value);
|
||||
int mapId = -1;
|
||||
labelId->setText(QString::number(id));
|
||||
if(id>0)
|
||||
{
|
||||
@@ -712,15 +713,14 @@ void DatabaseViewer::update(int value,
|
||||
{
|
||||
imgDepth = uCvMat2QImage(depthMat);
|
||||
}
|
||||
}
|
||||
|
||||
if(memory_)
|
||||
{
|
||||
std::multimap<int, cv::KeyPoint> words = memory_->getWords(id);
|
||||
if(words.size())
|
||||
{
|
||||
view->setFeatures(words);
|
||||
}
|
||||
|
||||
mapId = memory_->getMapId(id);
|
||||
}
|
||||
|
||||
if(!img.isNull())
|
||||
@@ -765,7 +765,14 @@ void DatabaseViewer::update(int value,
|
||||
}
|
||||
}
|
||||
|
||||
labelId->setText(QString::number(id));
|
||||
if(mapId>=0)
|
||||
{
|
||||
labelId->setText(QString("%1 [%2]").arg(id).arg(mapId));
|
||||
}
|
||||
else
|
||||
{
|
||||
labelId->setText(QString::number(id));
|
||||
}
|
||||
view->fitInView(view->scene()->itemsBoundingRect(), Qt::KeepAspectRatio);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user