mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
Added MYNT EYE S support. Fixed StereoCameraModel rectification not done with non-square images, also updated to support fisheye model.
This commit is contained in:
@@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#endif
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#if CV_MAJOR_VERSION > 2 or (CV_MAJOR_VERSION == 2 and (CV_MINOR_VERSION >4 or (CV_MINOR_VERSION == 4 and CV_SUBMINOR_VERSION >=10)))
|
||||
#include "opencv/stereoRectifyFisheye.h"
|
||||
#include <rtabmap/core/stereo/stereoRectifyFisheye.h>
|
||||
#endif
|
||||
|
||||
#include <QFileDialog>
|
||||
|
||||
@@ -38,5 +38,6 @@
|
||||
<file>images/tara.png</file>
|
||||
<file>images/t265.png</file>
|
||||
<file>images/sr300.png</file>
|
||||
<file>images/mynteyes.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -442,6 +442,7 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent, bool sh
|
||||
connect(_ui->actionStereoTara, SIGNAL(triggered()), this, SLOT(selectStereoTara()));
|
||||
connect(_ui->actionStereoUsb, SIGNAL(triggered()), this, SLOT(selectStereoUsb()));
|
||||
connect(_ui->actionRealSense2_T265, SIGNAL(triggered()), this, SLOT(selectRealSense2Stereo()));
|
||||
connect(_ui->actionMYNT_EYE_S_SDK, SIGNAL(triggered()), this, SLOT(selectMyntEyeS()));
|
||||
_ui->actionFreenect->setEnabled(CameraFreenect::available());
|
||||
_ui->actionOpenNI_CV->setEnabled(CameraOpenNICV::available());
|
||||
_ui->actionOpenNI_CV_ASUS->setEnabled(CameraOpenNICV::available());
|
||||
@@ -460,6 +461,7 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent, bool sh
|
||||
_ui->actionStereoFlyCapture2->setEnabled(CameraStereoFlyCapture2::available());
|
||||
_ui->actionStereoZed->setEnabled(CameraStereoZed::available());
|
||||
_ui->actionStereoTara->setEnabled(CameraStereoTara::available());
|
||||
_ui->actionMYNT_EYE_S_SDK->setEnabled(CameraMyntEye::available());
|
||||
this->updateSelectSourceMenu();
|
||||
|
||||
connect(_ui->actionPreferences, SIGNAL(triggered()), this, SLOT(openPreferences()));
|
||||
@@ -6367,6 +6369,11 @@ void MainWindow::selectStereoUsb()
|
||||
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcStereoUsb);
|
||||
}
|
||||
|
||||
void MainWindow::selectMyntEyeS()
|
||||
{
|
||||
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcStereoMyntEye);
|
||||
}
|
||||
|
||||
void MainWindow::dumpTheMemory()
|
||||
{
|
||||
this->post(new RtabmapEventCmd(RtabmapEventCmd::kCmdDumpMemory));
|
||||
|
||||
@@ -335,6 +335,10 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
||||
if (!CameraStereoTara::available())
|
||||
{
|
||||
_ui->comboBox_cameraStereo->setItemData(kSrcStereoTara - kSrcStereo, 0, Qt::UserRole - 1);
|
||||
}
|
||||
if (!CameraMyntEye::available())
|
||||
{
|
||||
_ui->comboBox_cameraStereo->setItemData(kSrcStereoMyntEye - kSrcStereo, 0, Qt::UserRole - 1);
|
||||
}
|
||||
_ui->openni2_exposure->setEnabled(CameraOpenNI2::exposureGainAvailable());
|
||||
_ui->openni2_gain->setEnabled(CameraOpenNI2::exposureGainAvailable());
|
||||
@@ -716,6 +720,9 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
||||
|
||||
connect(_ui->checkbox_stereoRealSense2_odom, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||
|
||||
connect(_ui->checkbox_stereoMyntEye_rectify, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||
connect(_ui->checkbox_stereoMyntEye_depth, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||
|
||||
connect(_ui->checkbox_rgbd_colorOnly, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||
connect(_ui->spinBox_source_imageDecimation, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||
connect(_ui->checkbox_stereo_depthGenerated, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||
@@ -1872,6 +1879,8 @@ void PreferencesDialog::resetSettings(QGroupBox * groupBox)
|
||||
_ui->checkbox_stereoZed_odom->setChecked(false);
|
||||
_ui->lineEdit_zedSvoPath->clear();
|
||||
_ui->checkbox_stereoRealSense2_odom->setChecked(false);
|
||||
_ui->checkbox_stereoMyntEye_rectify->setChecked(false);
|
||||
_ui->checkbox_stereoMyntEye_depth->setChecked(false);
|
||||
|
||||
_ui->checkBox_cameraImages_timestamps->setChecked(false);
|
||||
_ui->checkBox_cameraImages_syncTimeStamps->setChecked(true);
|
||||
@@ -2317,6 +2326,11 @@ void PreferencesDialog::readCameraSettings(const QString & filePath)
|
||||
_ui->checkbox_stereoRealSense2_odom->setChecked(settings.value("odom", _ui->checkbox_stereoRealSense2_odom->isChecked()).toBool());
|
||||
settings.endGroup(); // StereoRealSense2
|
||||
|
||||
settings.beginGroup("MyntEye");
|
||||
_ui->checkbox_stereoMyntEye_rectify->setChecked(settings.value("rectify", _ui->checkbox_stereoMyntEye_rectify->isChecked()).toBool());
|
||||
_ui->checkbox_stereoMyntEye_depth->setChecked(settings.value("depth", _ui->checkbox_stereoMyntEye_depth->isChecked()).toBool());
|
||||
settings.endGroup(); // StereoRealSense2
|
||||
|
||||
settings.beginGroup("Images");
|
||||
_ui->source_images_lineEdit_path->setText(settings.value("path", _ui->source_images_lineEdit_path->text()).toString());
|
||||
_ui->source_images_spinBox_startPos->setValue(settings.value("startPos",_ui->source_images_spinBox_startPos->value()).toInt());
|
||||
@@ -2784,6 +2798,11 @@ void PreferencesDialog::writeCameraSettings(const QString & filePath) const
|
||||
settings.setValue("odom", _ui->checkbox_stereoRealSense2_odom->isChecked());
|
||||
settings.endGroup(); // StereoRealSense2
|
||||
|
||||
settings.beginGroup("MyntEye");
|
||||
settings.setValue("rectify", _ui->checkbox_stereoMyntEye_rectify->isChecked());
|
||||
settings.setValue("depth", _ui->checkbox_stereoMyntEye_depth->isChecked());
|
||||
settings.endGroup(); // MyntEye
|
||||
|
||||
settings.beginGroup("Images");
|
||||
settings.setValue("path", _ui->source_images_lineEdit_path->text());
|
||||
settings.setValue("startPos", _ui->source_images_spinBox_startPos->value());
|
||||
@@ -4741,12 +4760,14 @@ void PreferencesDialog::updateSourceGrpVisibility()
|
||||
_ui->comboBox_cameraStereo->currentIndex() == kSrcStereoImages-kSrcStereo ||
|
||||
_ui->comboBox_cameraStereo->currentIndex() == kSrcStereoZed - kSrcStereo ||
|
||||
_ui->comboBox_cameraStereo->currentIndex() == kSrcStereoUsb - kSrcStereo ||
|
||||
_ui->comboBox_cameraStereo->currentIndex() == kSrcStereoRealSense2 - kSrcStereo));
|
||||
_ui->comboBox_cameraStereo->currentIndex() == kSrcStereoRealSense2 - kSrcStereo ||
|
||||
_ui->comboBox_cameraStereo->currentIndex() == kSrcStereoMyntEye - kSrcStereo));
|
||||
_ui->groupBox_cameraStereoImages->setVisible(_ui->comboBox_sourceType->currentIndex() == 1 && _ui->comboBox_cameraStereo->currentIndex() == kSrcStereoImages-kSrcStereo);
|
||||
_ui->groupBox_cameraStereoVideo->setVisible(_ui->comboBox_sourceType->currentIndex() == 1 && _ui->comboBox_cameraStereo->currentIndex() == kSrcStereoVideo - kSrcStereo);
|
||||
_ui->groupBox_cameraStereoUsb->setVisible(_ui->comboBox_sourceType->currentIndex() == 1 && _ui->comboBox_cameraStereo->currentIndex() == kSrcStereoUsb - kSrcStereo);
|
||||
_ui->groupBox_cameraStereoZed->setVisible(_ui->comboBox_sourceType->currentIndex() == 1 && _ui->comboBox_cameraStereo->currentIndex() == kSrcStereoZed - kSrcStereo);
|
||||
_ui->groupBox_cameraStereoRealSense2->setVisible(_ui->comboBox_sourceType->currentIndex() == 1 && _ui->comboBox_cameraStereo->currentIndex() == kSrcStereoRealSense2 - kSrcStereo);
|
||||
_ui->groupBox_cameraMyntEye->setVisible(_ui->comboBox_sourceType->currentIndex() == 1 && _ui->comboBox_cameraStereo->currentIndex() == kSrcStereoMyntEye - kSrcStereo);
|
||||
|
||||
_ui->stackedWidget_image->setVisible(_ui->comboBox_sourceType->currentIndex() == 2 &&
|
||||
(_ui->source_comboBox_image_type->currentIndex() == kSrcImages-kSrcRGB ||
|
||||
@@ -4773,7 +4794,8 @@ void PreferencesDialog::updateSourceGrpVisibility()
|
||||
(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcK4A - kSrcRGBD) || //K4A
|
||||
(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcRealSense2 - kSrcRGBD) || //D435i
|
||||
(_ui->comboBox_sourceType->currentIndex() == 1 && _ui->comboBox_cameraStereo->currentIndex() == kSrcStereoRealSense2 - kSrcStereo) || //T265
|
||||
(_ui->comboBox_sourceType->currentIndex() == 1 && _ui->comboBox_cameraStereo->currentIndex() == kSrcStereoZed - kSrcStereo)); // ZEDm
|
||||
(_ui->comboBox_sourceType->currentIndex() == 1 && _ui->comboBox_cameraStereo->currentIndex() == kSrcStereoZed - kSrcStereo) || // ZEDm, ZED2
|
||||
(_ui->comboBox_sourceType->currentIndex() == 1 && _ui->comboBox_cameraStereo->currentIndex() == kSrcStereoMyntEye - kSrcStereo)); // MYNT EYE S
|
||||
_ui->stackedWidget_imuFilter->setVisible(_ui->comboBox_imuFilter_strategy->currentIndex() > 0);
|
||||
_ui->groupBox_madgwickfilter->setVisible(_ui->comboBox_imuFilter_strategy->currentIndex() == 1);
|
||||
_ui->groupBox_complementaryfilter->setVisible(_ui->comboBox_imuFilter_strategy->currentIndex() == 2);
|
||||
@@ -5545,6 +5567,26 @@ Camera * PreferencesDialog::createCamera(bool useRawImages, bool useColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (driver == kSrcStereoMyntEye)
|
||||
{
|
||||
if(driver == kSrcStereoMyntEye && useRawImages)
|
||||
{
|
||||
QMessageBox::warning(this, tr("Calibration"),
|
||||
tr("Using raw images for \"RealSense\" driver is not yet supported. "
|
||||
"Factory calibration loaded from RealSense2 is used."), QMessageBox::Ok);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
camera = new CameraMyntEye(
|
||||
this->getSourceDevice().toStdString(),
|
||||
_ui->checkbox_stereoMyntEye_rectify->isChecked(),
|
||||
_ui->checkbox_stereoMyntEye_depth->isChecked(),
|
||||
this->getGeneralInputRate(),
|
||||
this->getSourceLocalTransform());
|
||||
((CameraMyntEye*)camera)->publishInterIMU(_ui->checkbox_publishInterIMU->isChecked());
|
||||
}
|
||||
}
|
||||
else if(driver == kSrcRGBDImages)
|
||||
{
|
||||
camera = new CameraRGBDImages(
|
||||
|
||||
BIN
guilib/src/images/mynteyes.png
Normal file
BIN
guilib/src/images/mynteyes.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
File diff suppressed because it is too large
Load Diff
@@ -278,10 +278,21 @@
|
||||
</property>
|
||||
<addaction name="actionRealSense2_T265"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuMynt_Eye_S">
|
||||
<property name="title">
|
||||
<string>Mynt Eye S</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../GuiLib.qrc">
|
||||
<normaloff>:/images/mynteyes.png</normaloff>:/images/mynteyes.png</iconset>
|
||||
</property>
|
||||
<addaction name="actionMYNT_EYE_S_SDK"/>
|
||||
</widget>
|
||||
<addaction name="menuBumblebee2_2"/>
|
||||
<addaction name="menuZed_camera"/>
|
||||
<addaction name="menuTara_Camera"/>
|
||||
<addaction name="menuRealSense_T265"/>
|
||||
<addaction name="menuMynt_Eye_S"/>
|
||||
</widget>
|
||||
<addaction name="menuRGB_D_camera"/>
|
||||
<addaction name="menuStereo_camera"/>
|
||||
@@ -1579,6 +1590,11 @@
|
||||
<string>RealSense2</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMYNT_EYE_S_SDK">
|
||||
<property name="text">
|
||||
<string>MYNT EYE S SDK</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
||||
@@ -63,9 +63,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>-224</y>
|
||||
<y>-250</y>
|
||||
<width>680</width>
|
||||
<height>3310</height>
|
||||
<height>3497</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||
@@ -3109,7 +3109,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget_src">
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page_41">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_64">
|
||||
@@ -4596,6 +4596,11 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
||||
<string>RealSense2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>MyntEyeS</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
@@ -4676,7 +4681,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackedWidget_stereo">
|
||||
<property name="currentIndex">
|
||||
<number>4</number>
|
||||
<number>8</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page_49">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_91">
|
||||
@@ -5294,6 +5299,78 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_86">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_148">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_cameraMyntEye">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>MYNT EYE S</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_115" columnstretch="0,1">
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="checkbox_stereoMyntEye_depth">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label_576">
|
||||
<property name="text">
|
||||
<string>Compute depth image with MYNT EYE S SDK. Ignored if images are not rectified from MYNT EYE S SDK.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_581">
|
||||
<property name="text">
|
||||
<string>Rectify images using MYNT EYE S SDK.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkbox_stereoMyntEye_rectify">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_85">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>596</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
Reference in New Issue
Block a user