Added oak-d lite menu option (depthai: imu is now optionnal)

This commit is contained in:
matlabbe
2022-10-23 18:15:23 -07:00
parent 97a150b180
commit 769ace86ce
9 changed files with 167 additions and 72 deletions

View File

@@ -42,6 +42,7 @@
<file>images/mynteyes.png</file>
<file>images/l515.png</file>
<file>images/oakd.png</file>
<file>images/astra.png</file>
<file>images/oakd_lite.png</file>
<file>images/astra.png</file>
</qresource>
</RCC>

View File

@@ -452,7 +452,8 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent, bool sh
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()));
connect(_ui->actionDepthAI, SIGNAL(triggered()), this, SLOT(selectDepthAI()));
connect(_ui->actionDepthAI_oakd, SIGNAL(triggered()), this, SLOT(selectDepthAIOAKD()));
connect(_ui->actionDepthAI_oakdlite, SIGNAL(triggered()), this, SLOT(selectDepthAIOAKDLite()));
_ui->actionFreenect->setEnabled(CameraFreenect::available());
_ui->actionOpenNI_CV->setEnabled(CameraOpenNICV::available());
_ui->actionOpenNI_CV_ASUS->setEnabled(CameraOpenNICV::available());
@@ -475,7 +476,8 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent, bool sh
_ui->actionZed_Open_Capture->setEnabled(CameraStereoZedOC::available());
_ui->actionStereoTara->setEnabled(CameraStereoTara::available());
_ui->actionMYNT_EYE_S_SDK->setEnabled(CameraMyntEye::available());
_ui->actionDepthAI->setEnabled(CameraDepthAI::available());
_ui->actionDepthAI_oakd->setEnabled(CameraDepthAI::available());
_ui->actionDepthAI_oakdlite->setEnabled(CameraDepthAI::available());
this->updateSelectSourceMenu();
connect(_ui->actionPreferences, SIGNAL(triggered()), this, SLOT(openPreferences()));
@@ -5112,7 +5114,8 @@ void MainWindow::updateSelectSourceMenu()
_ui->actionStereoUsb->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoUsb);
_ui->actionRealSense2_T265->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoRealSense2);
_ui->actionMYNT_EYE_S_SDK->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoMyntEye);
_ui->actionDepthAI->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoDepthAI);
_ui->actionDepthAI_oakd->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoDepthAI);
_ui->actionDepthAI_oakdlite->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoDepthAI);
}
void MainWindow::changeImgRateSetting()
@@ -6987,9 +6990,14 @@ void MainWindow::selectMyntEyeS()
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcStereoMyntEye);
}
void MainWindow::selectDepthAI()
void MainWindow::selectDepthAIOAKD()
{
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcStereoDepthAI);
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcStereoDepthAI, 1); // variant 1=IMU
}
void MainWindow::selectDepthAIOAKDLite()
{
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcStereoDepthAI, 0); // variant 0=no IMU
}
void MainWindow::dumpTheMemory()

View File

@@ -796,6 +796,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
connect(_ui->comboBox_depthai_resolution, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->checkBox_depthai_depth, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->spinBox_depthai_confidence, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->checkBox_depthai_imu_published, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->checkBox_depthai_imu_firmware_update, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->checkbox_rgbd_colorOnly, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
@@ -2044,6 +2045,7 @@ void PreferencesDialog::resetSettings(QGroupBox * groupBox)
_ui->comboBox_depthai_resolution->setCurrentIndex(1);
_ui->checkBox_depthai_depth->setChecked(false);
_ui->spinBox_depthai_confidence->setValue(200);
_ui->checkBox_depthai_imu_published->setChecked(true);
_ui->checkBox_depthai_imu_firmware_update->setChecked(false);
_ui->checkBox_cameraImages_configForEachFrame->setChecked(false);
@@ -2526,6 +2528,7 @@ void PreferencesDialog::readCameraSettings(const QString & filePath)
_ui->comboBox_depthai_resolution->setCurrentIndex(settings.value("resolution", _ui->comboBox_depthai_resolution->currentIndex()).toInt());
_ui->checkBox_depthai_depth->setChecked(settings.value("depth", _ui->checkBox_depthai_depth->isChecked()).toBool());
_ui->spinBox_depthai_confidence->setValue(settings.value("confidence", _ui->spinBox_depthai_confidence->value()).toInt());
_ui->checkBox_depthai_imu_published->setChecked(settings.value("imu_published", _ui->checkBox_depthai_imu_published->isChecked()).toBool());
_ui->checkBox_depthai_imu_firmware_update->setChecked(settings.value("imu_firmware_update", _ui->checkBox_depthai_imu_firmware_update->isChecked()).toBool());
settings.endGroup(); // DepthAI
@@ -3050,6 +3053,7 @@ void PreferencesDialog::writeCameraSettings(const QString & filePath) const
settings.setValue("resolution", _ui->comboBox_depthai_resolution->currentIndex());
settings.setValue("depth", _ui->checkBox_depthai_depth->isChecked());
settings.setValue("confidence", _ui->spinBox_depthai_confidence->value());
settings.setValue("imu_published", _ui->checkBox_depthai_imu_published->isChecked());
settings.setValue("imu_firmware_update", _ui->checkBox_depthai_imu_firmware_update->isChecked());
settings.endGroup(); // DepthAI
@@ -3927,6 +3931,10 @@ void PreferencesDialog::selectSourceDriver(Src src, int variant)
// disable IMU filtering (zed sends already quaternion)
_ui->comboBox_imuFilter_strategy->setCurrentIndex(0);
}
else if(src == kSrcStereoDepthAI) // OAK-D, OAK-D Lite
{
_ui->checkBox_depthai_imu_published->setChecked(variant == 1);
}
}
else if(src >= kSrcRGB && src<kSrcDatabase)
{
@@ -6287,6 +6295,7 @@ Camera * PreferencesDialog::createCamera(
this->getSourceLocalTransform());
((CameraDepthAI*)camera)->setOutputDepth(_ui->checkBox_depthai_depth->isChecked(), _ui->spinBox_depthai_confidence->value());
((CameraDepthAI*)camera)->setIMUFirmwareUpdate(_ui->checkBox_depthai_imu_firmware_update->isChecked());
((CameraDepthAI*)camera)->setIMUPublished(_ui->checkBox_depthai_imu_published->isChecked());
}
else if(driver == kSrcUsbDevice)
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -320,7 +320,17 @@
<iconset resource="../GuiLib.qrc">
<normaloff>:/images/oakd.png</normaloff>:/images/oakd.png</iconset>
</property>
<addaction name="actionDepthAI"/>
<addaction name="actionDepthAI_oakd"/>
</widget>
<widget class="QMenu" name="menuOAK_D_Lite">
<property name="title">
<string>OAK-D Lite</string>
</property>
<property name="icon">
<iconset resource="../GuiLib.qrc">
<normaloff>:/images/oakd_lite.png</normaloff>:/images/oakd_lite.png</iconset>
</property>
<addaction name="actionDepthAI_oakdlite"/>
</widget>
<addaction name="menuBumblebee2_2"/>
<addaction name="menuZed_camera"/>
@@ -328,6 +338,7 @@
<addaction name="menuRealSense_T265"/>
<addaction name="menuMynt_Eye_S"/>
<addaction name="menuOAK_D"/>
<addaction name="menuOAK_D_Lite"/>
</widget>
<addaction name="menuRGB_D_camera"/>
<addaction name="menuStereo_camera"/>
@@ -1677,7 +1688,7 @@
<string>Zed Open Capture</string>
</property>
</action>
<action name="actionDepthAI">
<action name="actionDepthAI_oakd">
<property name="checkable">
<bool>true</bool>
</property>
@@ -1703,6 +1714,14 @@
<string>Remove label...</string>
</property>
</action>
<action name="actionDepthAI_oakdlite">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Depth AI</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

View File

@@ -63,7 +63,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-166</y>
<y>-548</y>
<width>756</width>
<height>3657</height>
</rect>
@@ -95,7 +95,7 @@
<enum>QFrame::Raised</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>5</number>
</property>
<widget class="QWidget" name="page_22">
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,0">
@@ -5766,10 +5766,16 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
<string>DepthAI</string>
</property>
<layout class="QGridLayout" name="gridLayout_120" columnstretch="0,1">
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_depthai_depth">
<item row="0" column="1">
<widget class="QLabel" name="label_626">
<property name="text">
<string/>
<string>Resolution.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
@@ -5786,6 +5792,26 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_627">
<property name="text">
<string>Depth confidence.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_depthai_depth">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QComboBox" name="comboBox_depthai_resolution">
<property name="currentIndex">
@@ -5824,33 +5850,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_626">
<property name="text">
<string>Resolution.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_627">
<property name="text">
<string>Depth confidence.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="4" column="1">
<widget class="QLabel" name="label_646">
<property name="text">
<string>IMU firmware update</string>
@@ -5863,13 +5863,33 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QCheckBox" name="checkBox_depthai_imu_firmware_update">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_650">
<property name="text">
<string>IMU published</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="checkBox_depthai_imu_published">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>