Integration of viso2 odometry approach.

This commit is contained in:
matlabbe
2017-05-30 14:03:46 -04:00
parent 4ffbc0fb58
commit f6e21bd6c8
13 changed files with 406 additions and 14 deletions
@@ -299,6 +299,7 @@ private slots:
void addParameter(const QString & value);
void updatePredictionPlot();
void updateKpROI();
void updateOdometryVisibility();
void updateStereoDisparityVisibility();
void useOdomFeatures();
void useGridProjRayTracing();
+9 -9
View File
@@ -1188,7 +1188,7 @@ void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom, bool dataI
{
if(_ui->imageView_odometry->isFeaturesShown())
{
if(odom.info().type == 0)
if(odom.info().type == (int)Odometry::kTypeF2M)
{
if(_preferencesDialog->isOdomOnlyInliersShown())
{
@@ -1210,10 +1210,10 @@ void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom, bool dataI
Qt::yellow);
}
}
else if(odom.info().type == 1)
else if(odom.info().type == (int)Odometry::kTypeF2F || odom.info().type == (int)Odometry::kTypeViso2)
{
std::vector<cv::KeyPoint> kpts;
cv::KeyPoint::convert(odom.info().refCorners, kpts);
cv::KeyPoint::convert(odom.info().refCorners, kpts, 7);
_ui->imageView_odometry->setFeatures(
kpts,
odom.data().depthRaw(),
@@ -1223,10 +1223,10 @@ void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom, bool dataI
//detect if it is OdometryMono intitialization
bool monoInitialization = false;
if(_preferencesDialog->getOdomStrategy() == 2 && odom.info().type == 1)
{
monoInitialization = true;
}
//if(_preferencesDialog->getOdomStrategy() == ?? && odom.info().type == (int)Odometry::kTypeF2F)
//{
// monoInitialization = true;
//}
_ui->imageView_odometry->clearLines();
if(lost && !monoInitialization)
@@ -1256,7 +1256,7 @@ void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom, bool dataI
_ui->imageView_odometry->setImageDepth(uCvMat2QImage(odom.data().depthOrRightRaw()));
}
if(odom.info().type == 0)
if(odom.info().type == (int)Odometry::kTypeF2M)
{
if(_ui->imageView_odometry->isFeaturesShown() && !_preferencesDialog->isOdomOnlyInliersShown())
{
@@ -1270,7 +1270,7 @@ void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom, bool dataI
}
}
}
if(odom.info().type == 1 && odom.info().refCorners.size())
if((odom.info().type == (int)Odometry::kTypeF2F || odom.info().type == (int)Odometry::kTypeViso2) && odom.info().refCorners.size())
{
if(_ui->imageView_odometry->isFeaturesShown() || _ui->imageView_odometry->isLinesShown())
{
+15
View File
@@ -159,6 +159,13 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
_ui->label_realsenseOdom->setEnabled(false);
#endif
#ifndef RTABMAP_FOVIS
_ui->odom_strategy->setItemData(2, 0, Qt::UserRole - 1);
#endif
#ifndef RTABMAP_VISO2
_ui->odom_strategy->setItemData(3, 0, Qt::UserRole - 1);
#endif
#ifndef RTABMAP_NONFREE
_ui->comboBox_detector_strategy->setItemData(0, 0, Qt::UserRole - 1);
_ui->comboBox_detector_strategy->setItemData(1, 0, Qt::UserRole - 1);
@@ -872,6 +879,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
//Odometry
_ui->odom_strategy->setObjectName(Parameters::kOdomStrategy().c_str());
connect(_ui->odom_strategy, SIGNAL(currentIndexChanged(int)), _ui->stackedWidget_odometryType, SLOT(setCurrentIndex(int)));
connect(_ui->odom_strategy, SIGNAL(currentIndexChanged(int)), this, SLOT(updateOdometryVisibility()));
_ui->odom_strategy->setCurrentIndex(Parameters::defaultOdomStrategy());
_ui->odom_countdown->setObjectName(Parameters::kOdomResetCountdown().c_str());
_ui->odom_holonomic->setObjectName(Parameters::kOdomHolonomic().c_str());
@@ -3823,6 +3831,13 @@ void PreferencesDialog::setupKpRoiPanel()
_ui->doubleSpinBox_kp_roi3->setValue(strings[3].toDouble()*100.0);
}
void PreferencesDialog::updateOdometryVisibility()
{
_ui->stackedWidget_odometryType->setVisible(
_ui->odom_strategy->currentIndex() == 2 || // fovis
_ui->odom_strategy->currentIndex() == 3); // viso2
}
void PreferencesDialog::updateKpROI()
{
QStringList strings;
+8 -1
View File
@@ -63,7 +63,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<y>-530</y>
<width>678</width>
<height>2739</height>
</rect>
@@ -9704,6 +9704,11 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
<string>Fovis</string>
</property>
</item>
<item>
<property name="text">
<string>Viso2</string>
</property>
</item>
</widget>
</item>
<item row="2" column="1">
@@ -10218,6 +10223,8 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
</item>
</layout>
</widget>
<widget class="QWidget" name="page_67"/>
<widget class="QWidget" name="page_68"/>
<widget class="QWidget" name="page_26">
<layout class="QVBoxLayout" name="verticalLayout_88">
<item>