MainWindow: added driver options to differentiate between cameras having IMU or not (D400 vs D435i, ZED vs Zedm and Zed2). Enabled imu filtering by default for Freenect driver (Kinect XBOX360).

This commit is contained in:
matlabbe
2021-01-08 01:10:23 -05:00
parent a67dbc26f2
commit 792c967d46
4 changed files with 49 additions and 6 deletions

View File

@@ -436,10 +436,12 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent, bool sh
connect(_ui->actionRealSense_ZR300, SIGNAL(triggered()), this, SLOT(selectRealSense()));
connect(_ui->actionRealSense2_SR300, SIGNAL(triggered()), this, SLOT(selectRealSense2()));
connect(_ui->actionRealSense2_D400, SIGNAL(triggered()), this, SLOT(selectRealSense2()));
connect(_ui->actionRealSense2_IMU, SIGNAL(triggered()), this, SLOT(selectRealSense2i()));
connect(_ui->actionRealSense2_L515, SIGNAL(triggered()), this, SLOT(selectRealSense2L515()));
connect(_ui->actionStereoDC1394, SIGNAL(triggered()), this, SLOT(selectStereoDC1394()));
connect(_ui->actionStereoFlyCapture2, SIGNAL(triggered()), this, SLOT(selectStereoFlyCapture2()));
connect(_ui->actionStereoZed, SIGNAL(triggered()), this, SLOT(selectStereoZed()));
connect(_ui->actionZed_sdk_IMU, SIGNAL(triggered()), this, SLOT(selectStereoZedi()));
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()));
@@ -457,11 +459,13 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent, bool sh
_ui->actionRealSense_ZR300->setEnabled(CameraRealSense::available());
_ui->actionRealSense2_SR300->setEnabled(CameraRealSense2::available());
_ui->actionRealSense2_D400->setEnabled(CameraRealSense2::available());
_ui->actionRealSense2_IMU->setEnabled(CameraRealSense2::available());
_ui->actionRealSense2_L515->setEnabled(CameraRealSense2::available());
_ui->actionRealSense2_T265->setEnabled(CameraRealSense2::available());
_ui->actionStereoDC1394->setEnabled(CameraStereoDC1394::available());
_ui->actionStereoFlyCapture2->setEnabled(CameraStereoFlyCapture2::available());
_ui->actionStereoZed->setEnabled(CameraStereoZed::available());
_ui->actionZed_sdk_IMU->setEnabled(CameraStereoZed::available());
_ui->actionStereoTara->setEnabled(CameraStereoTara::available());
_ui->actionMYNT_EYE_S_SDK->setEnabled(CameraMyntEye::available());
this->updateSelectSourceMenu();
@@ -4730,10 +4734,12 @@ void MainWindow::updateSelectSourceMenu()
_ui->actionRealSense_ZR300->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcRealSense);
_ui->actionRealSense2_SR300->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcRealSense2);
_ui->actionRealSense2_D400->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcRealSense2);
_ui->actionRealSense2_IMU->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcRealSense2);
_ui->actionRealSense2_L515->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcRealSense2);
_ui->actionStereoDC1394->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcDC1394);
_ui->actionStereoFlyCapture2->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcFlyCapture2);
_ui->actionStereoZed->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoZed);
_ui->actionZed_sdk_IMU->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoZed);
_ui->actionStereoTara->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoTara);
_ui->actionStereoUsb->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoUsb);
_ui->actionRealSense2_T265->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoRealSense2);
@@ -6481,10 +6487,14 @@ void MainWindow::selectRealSense2()
{
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcRealSense2);
}
void MainWindow::selectRealSense2L515()
void MainWindow::selectRealSense2i()
{
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcRealSense2, 1);
}
void MainWindow::selectRealSense2L515()
{
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcRealSense2, 2);
}
void MainWindow::selectRealSense2Stereo()
{
@@ -6504,6 +6514,10 @@ void MainWindow::selectStereoZed()
{
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcStereoZed);
}
void MainWindow::selectStereoZedi()
{
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcStereoZed, 1);
}
void MainWindow::selectStereoTara()
{

View File

@@ -3723,13 +3723,22 @@ void PreferencesDialog::updateParameters(const ParametersMap & parameters, bool
void PreferencesDialog::selectSourceDriver(Src src, int variant)
{
_ui->comboBox_imuFilter_strategy->setCurrentIndex(0);
this->setParameter(Parameters::kOptimizerGravitySigma(), uNumber2Str(Parameters::defaultOptimizerGravitySigma()));
this->setParameter(Parameters::kOptimizerGravitySigma(), "0.0");
if(src >= kSrcRGBD && src<kSrcStereo)
{
_ui->comboBox_sourceType->setCurrentIndex(0);
_ui->comboBox_cameraRGBD->setCurrentIndex(src - kSrcRGBD);
if(src == kSrcOpenNI_PCL)
if(src == kSrcFreenect)
{
if(Optimizer::isAvailable(Optimizer::kTypeG2O) || Optimizer::isAvailable(Optimizer::kTypeGTSAM))
{
// enable IMU
_ui->comboBox_imuFilter_strategy->setCurrentIndex(1);
this->setParameter(Parameters::kOptimizerGravitySigma(), "0.3");
}
}
else if(src == kSrcOpenNI_PCL)
{
_ui->lineEdit_openniOniPath->clear();
}
@@ -3749,7 +3758,7 @@ void PreferencesDialog::selectSourceDriver(Src src, int variant)
}
else if (src == kSrcRealSense2)
{
if(variant > 0) // L515
if(variant > 1) // L515
{
_ui->spinBox_rs2_width->setValue(1280);
_ui->spinBox_rs2_height->setValue(720);
@@ -3761,7 +3770,7 @@ void PreferencesDialog::selectSourceDriver(Src src, int variant)
_ui->spinBox_rs2_height->setValue(480);
_ui->spinBox_rs2_rate->setValue(60);
}
if(Optimizer::isAvailable(Optimizer::kTypeG2O) || Optimizer::isAvailable(Optimizer::kTypeGTSAM))
if(variant>0 && (Optimizer::isAvailable(Optimizer::kTypeG2O) || Optimizer::isAvailable(Optimizer::kTypeGTSAM)))
{
// enable IMU
_ui->comboBox_imuFilter_strategy->setCurrentIndex(1);
@@ -3775,7 +3784,7 @@ void PreferencesDialog::selectSourceDriver(Src src, int variant)
_ui->comboBox_cameraStereo->setCurrentIndex(src - kSrcStereo);
if(Optimizer::isAvailable(Optimizer::kTypeG2O) || Optimizer::isAvailable(Optimizer::kTypeGTSAM))
{
if(src == kSrcStereoZed) // Zedm, Zed2
if(src == kSrcStereoZed && variant>0) // Zedm, Zed2
{
// enable IMU (zed sends already quaternion)
_ui->comboBox_imuFilter_strategy->setCurrentIndex(0);

View File

@@ -207,6 +207,7 @@
<normaloff>:/images/d435.png</normaloff>:/images/d435.png</iconset>
</property>
<addaction name="actionRealSense2_D400"/>
<addaction name="actionRealSense2_IMU"/>
</widget>
<widget class="QMenu" name="menuRealSense_SR300">
<property name="title">
@@ -267,6 +268,7 @@
<normaloff>:/images/zed.png</normaloff>:/images/zed.png</iconset>
</property>
<addaction name="actionStereoZed"/>
<addaction name="actionZed_sdk_IMU"/>
<addaction name="actionStereoUsb"/>
</widget>
<widget class="QMenu" name="menuTara_Camera">
@@ -1617,6 +1619,22 @@
<string>RealSense2</string>
</property>
</action>
<action name="actionZed_sdk_IMU">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Zed sdk (Zedm, Zed2)</string>
</property>
</action>
<action name="actionRealSense2_IMU">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>RealSense2 (D435i)</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>