mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
rtabmap: support two usb devices for stereo input
This commit is contained in:
@@ -606,6 +606,8 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
|||||||
connect(_ui->lineEdit_cameraStereoVideo_path, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->lineEdit_cameraStereoVideo_path, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
connect(_ui->lineEdit_cameraStereoVideo_path_2, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->lineEdit_cameraStereoVideo_path_2, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
|
|
||||||
|
connect(_ui->spinBox_stereo_right_device, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
|
|
||||||
connect(_ui->comboBox_stereoZed_resolution, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->comboBox_stereoZed_resolution, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
connect(_ui->comboBox_stereoZed_quality, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->comboBox_stereoZed_quality, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
connect(_ui->comboBox_stereoZed_quality, SIGNAL(currentIndexChanged(int)), this, SLOT(updateStereoDisparityVisibility()));
|
connect(_ui->comboBox_stereoZed_quality, SIGNAL(currentIndexChanged(int)), this, SLOT(updateStereoDisparityVisibility()));
|
||||||
@@ -1616,6 +1618,7 @@ void PreferencesDialog::resetSettings(QGroupBox * groupBox)
|
|||||||
_ui->spinBox_cameraStereoImages_startIndex->setValue(0);
|
_ui->spinBox_cameraStereoImages_startIndex->setValue(0);
|
||||||
_ui->lineEdit_cameraStereoVideo_path->setText("");
|
_ui->lineEdit_cameraStereoVideo_path->setText("");
|
||||||
_ui->lineEdit_cameraStereoVideo_path_2->setText("");
|
_ui->lineEdit_cameraStereoVideo_path_2->setText("");
|
||||||
|
_ui->spinBox_stereo_right_device->setValue(-1);
|
||||||
_ui->comboBox_stereoZed_resolution->setCurrentIndex(2);
|
_ui->comboBox_stereoZed_resolution->setCurrentIndex(2);
|
||||||
_ui->comboBox_stereoZed_quality->setCurrentIndex(1);
|
_ui->comboBox_stereoZed_quality->setCurrentIndex(1);
|
||||||
_ui->checkbox_stereoZed_selfCalibration->setChecked(false);
|
_ui->checkbox_stereoZed_selfCalibration->setChecked(false);
|
||||||
@@ -2009,6 +2012,7 @@ void PreferencesDialog::readCameraSettings(const QString & filePath)
|
|||||||
settings.beginGroup("StereoVideo");
|
settings.beginGroup("StereoVideo");
|
||||||
_ui->lineEdit_cameraStereoVideo_path->setText(settings.value("path", _ui->lineEdit_cameraStereoVideo_path->text()).toString());
|
_ui->lineEdit_cameraStereoVideo_path->setText(settings.value("path", _ui->lineEdit_cameraStereoVideo_path->text()).toString());
|
||||||
_ui->lineEdit_cameraStereoVideo_path_2->setText(settings.value("path2", _ui->lineEdit_cameraStereoVideo_path_2->text()).toString());
|
_ui->lineEdit_cameraStereoVideo_path_2->setText(settings.value("path2", _ui->lineEdit_cameraStereoVideo_path_2->text()).toString());
|
||||||
|
_ui->spinBox_stereo_right_device->setValue(settings.value("device2", _ui->spinBox_stereo_right_device->value()).toInt());
|
||||||
settings.endGroup(); // StereoVideo
|
settings.endGroup(); // StereoVideo
|
||||||
|
|
||||||
settings.beginGroup("StereoZed");
|
settings.beginGroup("StereoZed");
|
||||||
@@ -2422,6 +2426,7 @@ void PreferencesDialog::writeCameraSettings(const QString & filePath) const
|
|||||||
settings.beginGroup("StereoVideo");
|
settings.beginGroup("StereoVideo");
|
||||||
settings.setValue("path", _ui->lineEdit_cameraStereoVideo_path->text());
|
settings.setValue("path", _ui->lineEdit_cameraStereoVideo_path->text());
|
||||||
settings.setValue("path2", _ui->lineEdit_cameraStereoVideo_path_2->text());
|
settings.setValue("path2", _ui->lineEdit_cameraStereoVideo_path_2->text());
|
||||||
|
settings.setValue("device2", _ui->spinBox_stereo_right_device->value());
|
||||||
settings.endGroup(); // StereoVideo
|
settings.endGroup(); // StereoVideo
|
||||||
|
|
||||||
settings.beginGroup("StereoZed");
|
settings.beginGroup("StereoZed");
|
||||||
@@ -4262,9 +4267,11 @@ void PreferencesDialog::updateSourceGrpVisibility()
|
|||||||
_ui->stackedWidget_stereo->setVisible(_ui->comboBox_sourceType->currentIndex() == 1 &&
|
_ui->stackedWidget_stereo->setVisible(_ui->comboBox_sourceType->currentIndex() == 1 &&
|
||||||
(_ui->comboBox_cameraStereo->currentIndex() == kSrcStereoVideo-kSrcStereo ||
|
(_ui->comboBox_cameraStereo->currentIndex() == kSrcStereoVideo-kSrcStereo ||
|
||||||
_ui->comboBox_cameraStereo->currentIndex() == kSrcStereoImages-kSrcStereo ||
|
_ui->comboBox_cameraStereo->currentIndex() == kSrcStereoImages-kSrcStereo ||
|
||||||
_ui->comboBox_cameraStereo->currentIndex() == kSrcStereoZed - kSrcStereo));
|
_ui->comboBox_cameraStereo->currentIndex() == kSrcStereoZed - kSrcStereo ||
|
||||||
|
_ui->comboBox_cameraStereo->currentIndex() == kSrcStereoUsb - kSrcStereo));
|
||||||
_ui->groupBox_cameraStereoImages->setVisible(_ui->comboBox_sourceType->currentIndex() == 1 && _ui->comboBox_cameraStereo->currentIndex() == kSrcStereoImages-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_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_cameraStereoZed->setVisible(_ui->comboBox_sourceType->currentIndex() == 1 && _ui->comboBox_cameraStereo->currentIndex() == kSrcStereoZed - kSrcStereo);
|
||||||
|
|
||||||
_ui->stackedWidget_image->setVisible(_ui->comboBox_sourceType->currentIndex() == 2 && (_ui->source_comboBox_image_type->currentIndex() == kSrcImages-kSrcRGB || _ui->source_comboBox_image_type->currentIndex() == kSrcVideo-kSrcRGB));
|
_ui->stackedWidget_image->setVisible(_ui->comboBox_sourceType->currentIndex() == 2 && (_ui->source_comboBox_image_type->currentIndex() == kSrcImages-kSrcRGB || _ui->source_comboBox_image_type->currentIndex() == kSrcVideo-kSrcRGB));
|
||||||
@@ -5019,11 +5026,23 @@ Camera * PreferencesDialog::createCamera(bool useRawImages, bool useColor)
|
|||||||
}
|
}
|
||||||
else if (driver == kSrcStereoUsb)
|
else if (driver == kSrcStereoUsb)
|
||||||
{
|
{
|
||||||
camera = new CameraStereoVideo(
|
if(_ui->spinBox_stereo_right_device->value()>=0)
|
||||||
this->getSourceDevice().isEmpty() ? 0 : atoi(this->getSourceDevice().toStdString().c_str()),
|
{
|
||||||
_ui->checkBox_stereo_rectify->isChecked() && !useRawImages,
|
camera = new CameraStereoVideo(
|
||||||
this->getGeneralInputRate(),
|
this->getSourceDevice().isEmpty() ? 0 : atoi(this->getSourceDevice().toStdString().c_str()),
|
||||||
this->getSourceLocalTransform());
|
_ui->spinBox_stereo_right_device->value(),
|
||||||
|
_ui->checkBox_stereo_rectify->isChecked() && !useRawImages,
|
||||||
|
this->getGeneralInputRate(),
|
||||||
|
this->getSourceLocalTransform());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
camera = new CameraStereoVideo(
|
||||||
|
this->getSourceDevice().isEmpty() ? 0 : atoi(this->getSourceDevice().toStdString().c_str()),
|
||||||
|
_ui->checkBox_stereo_rectify->isChecked() && !useRawImages,
|
||||||
|
this->getGeneralInputRate(),
|
||||||
|
this->getSourceLocalTransform());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(driver == kSrcStereoVideo)
|
else if(driver == kSrcStereoVideo)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>-4</y>
|
<y>-363</y>
|
||||||
<width>681</width>
|
<width>681</width>
|
||||||
<height>2811</height>
|
<height>2811</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>7</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page_22">
|
<widget class="QWidget" name="page_22">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,1">
|
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,1">
|
||||||
@@ -3881,7 +3881,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Usb camera (Side-by-Side)</string>
|
<string>Usb camera</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -3958,7 +3958,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="stackedWidget_stereo">
|
<widget class="QStackedWidget" name="stackedWidget_stereo">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page_49">
|
<widget class="QWidget" name="page_49">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_91">
|
<layout class="QVBoxLayout" name="verticalLayout_91">
|
||||||
@@ -4411,19 +4411,54 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="page_60">
|
<widget class="QWidget" name="page_60">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_103">
|
<layout class="QVBoxLayout" name="verticalLayout_86">
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_53">
|
<widget class="QGroupBox" name="groupBox_cameraStereoUsb">
|
||||||
<property name="orientation">
|
<property name="sizePolicy">
|
||||||
<enum>Qt::Vertical</enum>
|
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="title">
|
||||||
<size>
|
<string>Usb Camera</string>
|
||||||
<width>20</width>
|
|
||||||
<height>217</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
<layout class="QGridLayout" name="gridLayout_99" columnstretch="0,1">
|
||||||
|
<item row="1" column="0">
|
||||||
|
<spacer name="verticalSpacer_70">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="label_470">
|
||||||
|
<property name="text">
|
||||||
|
<string>Optional right device ID. It should be -1 if the stereo camera streams side-by-side images.</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="QSpinBox" name="spinBox_stereo_right_device">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
Reference in New Issue
Block a user