CameraMyntEye: added setIrControl()

This commit is contained in:
matlabbe
2020-05-31 12:17:14 -04:00
parent 415a2778f1
commit d5cfd8013d
4 changed files with 73 additions and 16 deletions

View File

@@ -738,6 +738,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
connect(_ui->spinBox_stereoMyntEye_gain, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->spinBox_stereoMyntEye_brightness, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->spinBox_stereoMyntEye_contrast, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
connect(_ui->spinBox_stereoMyntEye_irControl, SIGNAL(valueChanged(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()));
@@ -1919,6 +1920,7 @@ void PreferencesDialog::resetSettings(QGroupBox * groupBox)
_ui->spinBox_stereoMyntEye_gain->setValue(24);
_ui->spinBox_stereoMyntEye_brightness->setValue(120);
_ui->spinBox_stereoMyntEye_contrast->setValue(116);
_ui->spinBox_stereoMyntEye_irControl->setValue(0);
_ui->checkBox_cameraImages_timestamps->setChecked(false);
_ui->checkBox_cameraImages_syncTimeStamps->setChecked(true);
@@ -2373,6 +2375,7 @@ void PreferencesDialog::readCameraSettings(const QString & filePath)
_ui->spinBox_stereoMyntEye_gain->setValue(settings.value("gain", _ui->spinBox_stereoMyntEye_gain->value()).toInt());
_ui->spinBox_stereoMyntEye_brightness->setValue(settings.value("brightness", _ui->spinBox_stereoMyntEye_brightness->value()).toInt());
_ui->spinBox_stereoMyntEye_contrast->setValue(settings.value("contrast", _ui->spinBox_stereoMyntEye_contrast->value()).toInt());
_ui->spinBox_stereoMyntEye_irControl->setValue(settings.value("ir_control", _ui->spinBox_stereoMyntEye_irControl->value()).toInt());
settings.endGroup(); // MyntEye
settings.beginGroup("Images");
@@ -2850,6 +2853,7 @@ void PreferencesDialog::writeCameraSettings(const QString & filePath) const
settings.setValue("gain", _ui->spinBox_stereoMyntEye_gain->value());
settings.setValue("brightness", _ui->spinBox_stereoMyntEye_brightness->value());
settings.setValue("contrast", _ui->spinBox_stereoMyntEye_contrast->value());
settings.setValue("ir_control", _ui->spinBox_stereoMyntEye_irControl->value());
settings.endGroup(); // MyntEye
settings.beginGroup("Images");
@@ -5702,11 +5706,19 @@ Camera * PreferencesDialog::createCamera(bool useRawImages, bool useColor)
this->getGeneralInputRate(),
this->getSourceLocalTransform());
((CameraMyntEye*)camera)->publishInterIMU(_ui->checkbox_publishInterIMU->isChecked());
((CameraMyntEye*)camera)->setAutoExposure(
_ui->checkbox_stereoMyntEye_autoExposure->isChecked(),
_ui->spinBox_stereoMyntEye_gain->value(),
_ui->spinBox_stereoMyntEye_brightness->value(),
_ui->spinBox_stereoMyntEye_contrast->value());
if(_ui->checkbox_stereoMyntEye_autoExposure->isChecked())
{
((CameraMyntEye*)camera)->setAutoExposure();
}
else
{
((CameraMyntEye*)camera)->setManualExposure(
_ui->spinBox_stereoMyntEye_gain->value(),
_ui->spinBox_stereoMyntEye_brightness->value(),
_ui->spinBox_stereoMyntEye_contrast->value());
}
((CameraMyntEye*)camera)->setIrControl(
_ui->spinBox_stereoMyntEye_irControl->value());
}
}
else if(driver == kSrcRGBDImages)

View File

@@ -63,7 +63,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<y>-696</y>
<width>680</width>
<height>3270</height>
</rect>
@@ -95,7 +95,7 @@
<enum>QFrame::Raised</enum>
</property>
<property name="currentIndex">
<number>14</number>
<number>5</number>
</property>
<widget class="QWidget" name="page_22">
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,1">
@@ -5372,7 +5372,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
<item row="3" column="1">
<widget class="QLabel" name="label_595">
<property name="text">
<string>Image gain, valid if manual-exposure.</string>
<string>Image gain [0-48], valid if manual-exposure.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -5385,7 +5385,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
<item row="4" column="1">
<widget class="QLabel" name="label_596">
<property name="text">
<string>Image brightness, valid if manual-exposure.</string>
<string>Image brightness [0-240], valid if manual-exposure.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -5411,7 +5411,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
<item row="5" column="1">
<widget class="QLabel" name="label_597">
<property name="text">
<string>Image contrast, valid if manual-exposure.</string>
<string>Image contrast [0-254], valid if manual-exposure.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -5431,6 +5431,29 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="label_599">
<property name="text">
<string>IR control [0-160]. 0 means that the IR pattern is not projected.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QSpinBox" name="spinBox_stereoMyntEye_irControl">
<property name="maximum">
<number>160</number>
</property>
<property name="value">
<number>116</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>