mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
fixed delete database action when memory is not yet initialized, enabled gpu SURF option when available
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1055 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -126,6 +126,7 @@ public:
|
||||
int getScanPointSize(int index) const; // 0=map, 1=odom, 2=save
|
||||
|
||||
QString getWorkingDirectory() const;
|
||||
QString getDatabasePath() const;
|
||||
|
||||
// source panel
|
||||
double getGeneralInputRate() const;
|
||||
|
||||
@@ -831,15 +831,6 @@ void MainWindow::processStats(const rtabmap::Statistics & stat)
|
||||
|
||||
UDEBUG("time= %d ms", time.restart());
|
||||
|
||||
if(_ui->imageView_loopClosure->items().size() || stat.loopClosureId()>0)
|
||||
{
|
||||
this->drawKeypoints(stat.refWords(), stat.loopWords());
|
||||
}
|
||||
else
|
||||
{
|
||||
this->drawKeypoints(stat.refWords(), std::multimap<int, cv::KeyPoint>()); //empty loop keypoints...
|
||||
}
|
||||
|
||||
// We use the reference image to resize the 2 views
|
||||
_ui->imageView_source->resetZoom();
|
||||
_ui->imageView_loopClosure->resetZoom();
|
||||
@@ -851,6 +842,16 @@ void MainWindow::processStats(const rtabmap::Statistics & stat)
|
||||
_ui->imageView_source->fitInView(_ui->imageView_source->sceneRect(), Qt::KeepAspectRatio);
|
||||
_ui->imageView_loopClosure->fitInView(_ui->imageView_source->sceneRect(), Qt::KeepAspectRatio);
|
||||
|
||||
// do it after scaling
|
||||
if(_ui->imageView_loopClosure->items().size() || stat.loopClosureId()>0)
|
||||
{
|
||||
this->drawKeypoints(stat.refWords(), stat.loopWords());
|
||||
}
|
||||
else
|
||||
{
|
||||
this->drawKeypoints(stat.refWords(), std::multimap<int, cv::KeyPoint>()); //empty loop keypoints...
|
||||
}
|
||||
|
||||
if(_preferencesDialog->isImageFlipped())
|
||||
{
|
||||
_ui->imageView_source->scale(-1.0, 1.0);
|
||||
@@ -1543,13 +1544,16 @@ void MainWindow::drawKeypoints(const std::multimap<int, cv::KeyPoint> & refWords
|
||||
}
|
||||
|
||||
// Draw lines between corresponding features...
|
||||
int deltaX = _ui->imageView_source->sceneRect().width();
|
||||
float scaleX = _ui->imageView_source->transform().m11();
|
||||
float scaleY = _ui->imageView_source->transform().m22();
|
||||
UDEBUG("scaleX=%f scaleY=%f", scaleX, scaleY);
|
||||
int deltaX = _ui->imageView_source->width()/scaleX;
|
||||
int deltaY = 0;
|
||||
if(_preferencesDialog->isVerticalLayoutUsed())
|
||||
{
|
||||
deltaX = 0;
|
||||
deltaY = _ui->imageView_source->sceneRect().height();
|
||||
deltaY += _ui->label_matchId->height()/_ui->imageView_source->transform().m22();
|
||||
deltaY = _ui->imageView_source->height()/scaleY;
|
||||
deltaY += _ui->label_matchId->height()/scaleY;
|
||||
}
|
||||
for(QList<QPair<KeypointItem*, KeypointItem*> >::iterator iter = uniqueCorrespondences.begin();
|
||||
iter!=uniqueCorrespondences.end();
|
||||
@@ -2147,7 +2151,7 @@ void MainWindow::generateLocalMap()
|
||||
void MainWindow::deleteMemory()
|
||||
{
|
||||
QMessageBox::StandardButton button;
|
||||
QString dbPath = _preferencesDialog->getWorkingDirectory() + QDir::separator() + "rtabmap.db";
|
||||
QString dbPath = _preferencesDialog->getDatabasePath();
|
||||
if(_state == kMonitoring || _state == kMonitoringPaused)
|
||||
{
|
||||
button = QMessageBox::question(this,
|
||||
@@ -2170,7 +2174,7 @@ void MainWindow::deleteMemory()
|
||||
return;
|
||||
}
|
||||
|
||||
this->post(new RtabmapEventCmd(RtabmapEventCmd::kCmdDeleteMemory));
|
||||
this->post(new RtabmapEventCmd(RtabmapEventCmd::kCmdDeleteMemory, dbPath.toStdString()));
|
||||
this->clearTheCache();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
#include <rtabmap/utilite/UEventsManager.h>
|
||||
#include "utilite/UPlot.h"
|
||||
|
||||
#include <opencv2/gpu/gpu.hpp>
|
||||
|
||||
using namespace rtabmap;
|
||||
|
||||
namespace rtabmap {
|
||||
@@ -115,6 +117,14 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
||||
_ui->label_space2->setEnabled(false);
|
||||
_ui->label_space3->setEnabled(false);
|
||||
_ui->loopClosure_icpType->setEnabled(false);
|
||||
_ui->surf_checkBox_gpuVersion->setEnabled(false);
|
||||
_ui->label_surf_checkBox_gpuVersion->setEnabled(false);
|
||||
#else
|
||||
if(cv::gpu::getCudaEnabledDeviceCount() == 0)
|
||||
{
|
||||
_ui->surf_checkBox_gpuVersion->setEnabled(false);
|
||||
_ui->label_surf_checkBox_gpuVersion->setEnabled(false);
|
||||
}
|
||||
#endif
|
||||
_ui->predictionPlot->showLegend(false);
|
||||
|
||||
@@ -824,6 +834,11 @@ QString PreferencesDialog::getWorkingDirectory() const
|
||||
return _ui->lineEdit_workingDirectory->text();
|
||||
}
|
||||
|
||||
QString PreferencesDialog::getDatabasePath() const
|
||||
{
|
||||
return _ui->lineEdit_databasePath->text();
|
||||
}
|
||||
|
||||
QString PreferencesDialog::getIniFilePath() const
|
||||
{
|
||||
#ifdef DEMO_BUILD
|
||||
|
||||
@@ -64,8 +64,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>939</width>
|
||||
<height>724</height>
|
||||
<width>955</width>
|
||||
<height>685</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||
@@ -86,7 +86,7 @@
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>9</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page_22">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_29">
|
||||
@@ -3048,7 +3048,7 @@ generate the number of words requested.</string>
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="surf_checkBox_gpuVersion">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@@ -3056,12 +3056,12 @@ generate the number of words requested.</string>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="label_48">
|
||||
<widget class="QLabel" name="label_surf_checkBox_gpuVersion">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>GPU version (as well for descriptor). Experimental.</string>
|
||||
<string>GPU version (as well for descriptor).</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
|
||||
Reference in New Issue
Block a user