mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +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;
|
const Signature * getLastWorkingSignature() const;
|
||||||
int getDatabaseMemoryUsed() const; // in bytes
|
int getDatabaseMemoryUsed() const; // in bytes
|
||||||
double getDbSavingTime() const;
|
double getDbSavingTime() const;
|
||||||
|
int getMapId(int signatureId) const;
|
||||||
std::vector<unsigned char> getImage(int signatureId) const;
|
std::vector<unsigned char> getImage(int signatureId) const;
|
||||||
void getImageDepth(
|
void getImageDepth(
|
||||||
int locationId, std::vector<unsigned char> & rgb,
|
int locationId, std::vector<unsigned char> & rgb,
|
||||||
|
|||||||
@@ -2364,6 +2364,22 @@ bool Memory::rehearsalMerge(int oldId, int newId)
|
|||||||
return false;
|
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> Memory::getImage(int signatureId) const
|
||||||
{
|
{
|
||||||
std::vector<unsigned char> image;
|
std::vector<unsigned char> image;
|
||||||
|
|||||||
@@ -690,6 +690,7 @@ void DatabaseViewer::update(int value,
|
|||||||
{
|
{
|
||||||
view->clear();
|
view->clear();
|
||||||
int id = ids_.at(value);
|
int id = ids_.at(value);
|
||||||
|
int mapId = -1;
|
||||||
labelId->setText(QString::number(id));
|
labelId->setText(QString::number(id));
|
||||||
if(id>0)
|
if(id>0)
|
||||||
{
|
{
|
||||||
@@ -712,15 +713,14 @@ void DatabaseViewer::update(int value,
|
|||||||
{
|
{
|
||||||
imgDepth = uCvMat2QImage(depthMat);
|
imgDepth = uCvMat2QImage(depthMat);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(memory_)
|
|
||||||
{
|
|
||||||
std::multimap<int, cv::KeyPoint> words = memory_->getWords(id);
|
std::multimap<int, cv::KeyPoint> words = memory_->getWords(id);
|
||||||
if(words.size())
|
if(words.size())
|
||||||
{
|
{
|
||||||
view->setFeatures(words);
|
view->setFeatures(words);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mapId = memory_->getMapId(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!img.isNull())
|
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);
|
view->fitInView(view->scene()->itemsBoundingRect(), Qt::KeepAspectRatio);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user