mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-11 12:29:50 +08:00
Added RealSense2 driver to UI
This commit is contained in:
@@ -426,7 +426,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
// default local transform z in, x right, y down));
|
// default local transform z in, x right, y down));
|
||||||
CameraRealSense2(
|
CameraRealSense2(
|
||||||
int deviceId = 0,
|
const std::string & deviceId = "",
|
||||||
float imageRate = 0,
|
float imageRate = 0,
|
||||||
const Transform & localTransform = Transform::getIdentity());
|
const Transform & localTransform = Transform::getIdentity());
|
||||||
virtual ~CameraRealSense2();
|
virtual ~CameraRealSense2();
|
||||||
@@ -435,6 +435,9 @@ public:
|
|||||||
virtual bool isCalibrated() const;
|
virtual bool isCalibrated() const;
|
||||||
virtual std::string getSerial() const;
|
virtual std::string getSerial() const;
|
||||||
|
|
||||||
|
// parameters are set during initialization
|
||||||
|
void setEmitterEnabled(bool enabled);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual SensorData captureImage(CameraInfo * info = 0);
|
virtual SensorData captureImage(CameraInfo * info = 0);
|
||||||
|
|
||||||
@@ -450,7 +453,7 @@ private:
|
|||||||
|
|
||||||
rs2::context ctx_;
|
rs2::context ctx_;
|
||||||
rs2::device dev_;
|
rs2::device dev_;
|
||||||
int deviceId_;
|
std::string deviceId_;
|
||||||
rs2::syncer syncer_;
|
rs2::syncer syncer_;
|
||||||
float depth_scale_meters_;
|
float depth_scale_meters_;
|
||||||
rs2_intrinsics depthIntrinsics_;
|
rs2_intrinsics depthIntrinsics_;
|
||||||
@@ -459,6 +462,8 @@ private:
|
|||||||
cv::Mat depthBuffer_;
|
cv::Mat depthBuffer_;
|
||||||
cv::Mat rgbBuffer_;
|
cv::Mat rgbBuffer_;
|
||||||
CameraModel model_;
|
CameraModel model_;
|
||||||
|
|
||||||
|
bool emitterEnabled_;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+28
-19
@@ -3229,14 +3229,15 @@ bool CameraRealSense2::available()
|
|||||||
}
|
}
|
||||||
|
|
||||||
CameraRealSense2::CameraRealSense2(
|
CameraRealSense2::CameraRealSense2(
|
||||||
int device,
|
const std::string & device,
|
||||||
float imageRate,
|
float imageRate,
|
||||||
const rtabmap::Transform & localTransform) :
|
const rtabmap::Transform & localTransform) :
|
||||||
Camera(imageRate, localTransform)
|
Camera(imageRate, localTransform)
|
||||||
#ifdef RTABMAP_REALSENSE2
|
#ifdef RTABMAP_REALSENSE2
|
||||||
,
|
,
|
||||||
deviceId_(device),
|
deviceId_(device),
|
||||||
depth_scale_meters_(1.0f)
|
depth_scale_meters_(1.0f),
|
||||||
|
emitterEnabled_(true)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
UDEBUG("");
|
UDEBUG("");
|
||||||
@@ -3247,6 +3248,7 @@ CameraRealSense2::~CameraRealSense2()
|
|||||||
UDEBUG("");
|
UDEBUG("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef RTABMAP_REALSENSE2
|
||||||
void CameraRealSense2::alignFrame(const rs2_intrinsics& from_intrin,
|
void CameraRealSense2::alignFrame(const rs2_intrinsics& from_intrin,
|
||||||
const rs2_intrinsics& other_intrin,
|
const rs2_intrinsics& other_intrin,
|
||||||
rs2::frame from_image,
|
rs2::frame from_image,
|
||||||
@@ -3313,6 +3315,7 @@ void CameraRealSense2::alignFrame(const rs2_intrinsics& from_intrin,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool CameraRealSense2::init(const std::string & calibrationFolder, const std::string & cameraName)
|
bool CameraRealSense2::init(const std::string & calibrationFolder, const std::string & cameraName)
|
||||||
{
|
{
|
||||||
@@ -3328,7 +3331,6 @@ bool CameraRealSense2::init(const std::string & calibrationFolder, const std::st
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int count = 0;
|
|
||||||
bool found=false;
|
bool found=false;
|
||||||
for (auto&& dev : list)
|
for (auto&& dev : list)
|
||||||
{
|
{
|
||||||
@@ -3339,7 +3341,7 @@ bool CameraRealSense2::init(const std::string & calibrationFolder, const std::st
|
|||||||
ss << std::hex << pid_str;
|
ss << std::hex << pid_str;
|
||||||
ss >> pid;
|
ss >> pid;
|
||||||
UINFO("Device with serial number %s was found with product ID=%d.", sn, (int)pid);
|
UINFO("Device with serial number %s was found with product ID=%d.", sn, (int)pid);
|
||||||
if (deviceId_ == 0 || deviceId_ == count)
|
if (deviceId_.empty() || deviceId_ == sn)
|
||||||
{
|
{
|
||||||
dev_ = dev;
|
dev_ = dev;
|
||||||
found=true;
|
found=true;
|
||||||
@@ -3349,7 +3351,7 @@ bool CameraRealSense2::init(const std::string & calibrationFolder, const std::st
|
|||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
UERROR("The requested device %d is NOT found!", deviceId_);
|
UERROR("The requested device %s is NOT found!", deviceId_.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3384,6 +3386,7 @@ bool CameraRealSense2::init(const std::string & calibrationFolder, const std::st
|
|||||||
if ("Stereo Module" == module_name)
|
if ("Stereo Module" == module_name)
|
||||||
{
|
{
|
||||||
sensors[1] = elem;
|
sensors[1] = elem;
|
||||||
|
sensors[1].set_option(rs2_option::RS2_OPTION_EMITTER_ENABLED, emitterEnabled_);
|
||||||
}
|
}
|
||||||
else if ("Coded-Light Depth Sensor" == module_name)
|
else if ("Coded-Light Depth Sensor" == module_name)
|
||||||
{
|
{
|
||||||
@@ -3477,7 +3480,7 @@ bool CameraRealSense2::init(const std::string & calibrationFolder, const std::st
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
UERROR("CameraRealSense: RTAB-Map is not built with RealSense support!");
|
UERROR("CameraRealSense: RTAB-Map is not built with RealSense2 support!");
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -3495,16 +3498,29 @@ std::string CameraRealSense2::getSerial() const
|
|||||||
return "NA";
|
return "NA";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CameraRealSense2::setEmitterEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
#ifdef RTABMAP_REALSENSE2
|
||||||
|
emitterEnabled_ = enabled;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
SensorData CameraRealSense2::captureImage(CameraInfo * info)
|
SensorData CameraRealSense2::captureImage(CameraInfo * info)
|
||||||
{
|
{
|
||||||
SensorData data;
|
SensorData data;
|
||||||
#ifdef RTABMAP_REALSENSE2
|
#ifdef RTABMAP_REALSENSE2
|
||||||
|
|
||||||
try{
|
try{
|
||||||
double stamp = UTimer::now();
|
|
||||||
auto frameset = syncer_.wait_for_frames(5000);
|
auto frameset = syncer_.wait_for_frames(5000);
|
||||||
if (frameset.size())
|
UTimer timer;
|
||||||
|
while (frameset.size() != 2 && timer.elapsed() < 2.0)
|
||||||
{
|
{
|
||||||
|
// maybe there is a latency with the USB, try again in 10 ms (for the next 2 seconds)
|
||||||
|
frameset = syncer_.wait_for_frames(10);
|
||||||
|
}
|
||||||
|
if (frameset.size() == 2)
|
||||||
|
{
|
||||||
|
double stamp = UTimer::now();
|
||||||
UDEBUG("Frameset arrived.");
|
UDEBUG("Frameset arrived.");
|
||||||
bool is_rgb_arrived = false;
|
bool is_rgb_arrived = false;
|
||||||
bool is_depth_arrived = false;
|
bool is_depth_arrived = false;
|
||||||
@@ -3545,22 +3561,15 @@ SensorData CameraRealSense2::captureImage(CameraInfo * info)
|
|||||||
UERROR("Not received depth and rgb");
|
UERROR("Not received depth and rgb");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UERROR("Missing frames (received %d)", (int)frameset.size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(const std::exception& ex)
|
catch(const std::exception& ex)
|
||||||
{
|
{
|
||||||
UERROR("An error has occurred during frame callback: %s", ex.what());
|
UERROR("An error has occurred during frame callback: %s", ex.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if(!dataReady_.acquire(1, 5000))
|
|
||||||
{
|
|
||||||
UWARN("Not received new frames since 5 seconds, end of stream reached!");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UScopeMutex s(dataMutex_);
|
|
||||||
data = data_;
|
|
||||||
data_ = SensorData();
|
|
||||||
}*/
|
|
||||||
#else
|
#else
|
||||||
UERROR("CameraRealSense2: RTAB-Map is not built with RealSense2 support!");
|
UERROR("CameraRealSense2: RTAB-Map is not built with RealSense2 support!");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ protected Q_SLOTS:
|
|||||||
void selectFreenect2();
|
void selectFreenect2();
|
||||||
void selectK4W2();
|
void selectK4W2();
|
||||||
void selectRealSense();
|
void selectRealSense();
|
||||||
|
void selectRealSense2();
|
||||||
void selectStereoDC1394();
|
void selectStereoDC1394();
|
||||||
void selectStereoFlyCapture2();
|
void selectStereoFlyCapture2();
|
||||||
void selectStereoZed();
|
void selectStereoZed();
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ public:
|
|||||||
kSrcRealSense = 6,
|
kSrcRealSense = 6,
|
||||||
kSrcRGBDImages = 7,
|
kSrcRGBDImages = 7,
|
||||||
kSrcK4W2 = 8,
|
kSrcK4W2 = 8,
|
||||||
|
kSrcRealSense2 = 9,
|
||||||
|
|
||||||
kSrcStereo = 100,
|
kSrcStereo = 100,
|
||||||
kSrcDC1394 = 100,
|
kSrcDC1394 = 100,
|
||||||
|
|||||||
@@ -33,5 +33,6 @@
|
|||||||
<file>images/zed.png</file>
|
<file>images/zed.png</file>
|
||||||
<file>images/r200.png</file>
|
<file>images/r200.png</file>
|
||||||
<file>images/zr300.png</file>
|
<file>images/zr300.png</file>
|
||||||
|
<file>images/d435.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -429,6 +429,7 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent, bool sh
|
|||||||
connect(_ui->actionKinect_for_Windows_SDK_v2, SIGNAL(triggered()), this, SLOT(selectK4W2()));
|
connect(_ui->actionKinect_for_Windows_SDK_v2, SIGNAL(triggered()), this, SLOT(selectK4W2()));
|
||||||
connect(_ui->actionRealSense_R200, SIGNAL(triggered()), this, SLOT(selectRealSense()));
|
connect(_ui->actionRealSense_R200, SIGNAL(triggered()), this, SLOT(selectRealSense()));
|
||||||
connect(_ui->actionRealSense_ZR300, SIGNAL(triggered()), this, SLOT(selectRealSense()));
|
connect(_ui->actionRealSense_ZR300, SIGNAL(triggered()), this, SLOT(selectRealSense()));
|
||||||
|
connect(_ui->actionRealSense2_D435, SIGNAL(triggered()), this, SLOT(selectRealSense2()));
|
||||||
connect(_ui->actionStereoDC1394, SIGNAL(triggered()), this, SLOT(selectStereoDC1394()));
|
connect(_ui->actionStereoDC1394, SIGNAL(triggered()), this, SLOT(selectStereoDC1394()));
|
||||||
connect(_ui->actionStereoFlyCapture2, SIGNAL(triggered()), this, SLOT(selectStereoFlyCapture2()));
|
connect(_ui->actionStereoFlyCapture2, SIGNAL(triggered()), this, SLOT(selectStereoFlyCapture2()));
|
||||||
connect(_ui->actionStereoZed, SIGNAL(triggered()), this, SLOT(selectStereoZed()));
|
connect(_ui->actionStereoZed, SIGNAL(triggered()), this, SLOT(selectStereoZed()));
|
||||||
@@ -443,6 +444,7 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent, bool sh
|
|||||||
_ui->actionKinect_for_Windows_SDK_v2->setEnabled(CameraK4W2::available());
|
_ui->actionKinect_for_Windows_SDK_v2->setEnabled(CameraK4W2::available());
|
||||||
_ui->actionRealSense_R200->setEnabled(CameraRealSense::available());
|
_ui->actionRealSense_R200->setEnabled(CameraRealSense::available());
|
||||||
_ui->actionRealSense_ZR300->setEnabled(CameraRealSense::available());
|
_ui->actionRealSense_ZR300->setEnabled(CameraRealSense::available());
|
||||||
|
_ui->actionRealSense2_D435->setEnabled(CameraRealSense2::available());
|
||||||
_ui->actionStereoDC1394->setEnabled(CameraStereoDC1394::available());
|
_ui->actionStereoDC1394->setEnabled(CameraStereoDC1394::available());
|
||||||
_ui->actionStereoFlyCapture2->setEnabled(CameraStereoFlyCapture2::available());
|
_ui->actionStereoFlyCapture2->setEnabled(CameraStereoFlyCapture2::available());
|
||||||
_ui->actionStereoZed->setEnabled(CameraStereoZed::available());
|
_ui->actionStereoZed->setEnabled(CameraStereoZed::available());
|
||||||
@@ -4241,6 +4243,7 @@ void MainWindow::updateSelectSourceMenu()
|
|||||||
_ui->actionKinect_for_Windows_SDK_v2->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcK4W2);
|
_ui->actionKinect_for_Windows_SDK_v2->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcK4W2);
|
||||||
_ui->actionRealSense_R200->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcRealSense);
|
_ui->actionRealSense_R200->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcRealSense);
|
||||||
_ui->actionRealSense_ZR300->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcRealSense);
|
_ui->actionRealSense_ZR300->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcRealSense);
|
||||||
|
_ui->actionRealSense2_D435->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcRealSense2);
|
||||||
_ui->actionStereoDC1394->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcDC1394);
|
_ui->actionStereoDC1394->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcDC1394);
|
||||||
_ui->actionStereoFlyCapture2->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcFlyCapture2);
|
_ui->actionStereoFlyCapture2->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcFlyCapture2);
|
||||||
_ui->actionStereoZed->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoZed);
|
_ui->actionStereoZed->setChecked(_preferencesDialog->getSourceDriver() == PreferencesDialog::kSrcStereoZed);
|
||||||
@@ -5931,6 +5934,11 @@ void MainWindow::selectRealSense()
|
|||||||
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcRealSense);
|
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcRealSense);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::selectRealSense2()
|
||||||
|
{
|
||||||
|
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcRealSense2);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::selectStereoDC1394()
|
void MainWindow::selectStereoDC1394()
|
||||||
{
|
{
|
||||||
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcDC1394);
|
_preferencesDialog->selectSourceDriver(PreferencesDialog::kSrcDC1394);
|
||||||
|
|||||||
@@ -255,44 +255,48 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
|||||||
#endif
|
#endif
|
||||||
if(!CameraOpenni::available())
|
if(!CameraOpenni::available())
|
||||||
{
|
{
|
||||||
_ui->comboBox_cameraRGBD->setItemData(0, 0, Qt::UserRole - 1);
|
_ui->comboBox_cameraRGBD->setItemData(kSrcOpenNI_PCL - kSrcRGBD, 0, Qt::UserRole - 1);
|
||||||
}
|
}
|
||||||
if(!CameraFreenect::available())
|
if(!CameraFreenect::available())
|
||||||
{
|
{
|
||||||
_ui->comboBox_cameraRGBD->setItemData(1, 0, Qt::UserRole - 1);
|
_ui->comboBox_cameraRGBD->setItemData(kSrcFreenect - kSrcRGBD, 0, Qt::UserRole - 1);
|
||||||
}
|
}
|
||||||
if(!CameraOpenNICV::available())
|
if(!CameraOpenNICV::available())
|
||||||
{
|
{
|
||||||
_ui->comboBox_cameraRGBD->setItemData(2, 0, Qt::UserRole - 1);
|
_ui->comboBox_cameraRGBD->setItemData(kSrcOpenNI_CV - kSrcRGBD, 0, Qt::UserRole - 1);
|
||||||
_ui->comboBox_cameraRGBD->setItemData(3, 0, Qt::UserRole - 1);
|
_ui->comboBox_cameraRGBD->setItemData(kSrcOpenNI_CV_ASUS - kSrcRGBD, 0, Qt::UserRole - 1);
|
||||||
}
|
}
|
||||||
if(!CameraOpenNI2::available())
|
if(!CameraOpenNI2::available())
|
||||||
{
|
{
|
||||||
_ui->comboBox_cameraRGBD->setItemData(4, 0, Qt::UserRole - 1);
|
_ui->comboBox_cameraRGBD->setItemData(kSrcOpenNI2 - kSrcRGBD, 0, Qt::UserRole - 1);
|
||||||
}
|
}
|
||||||
if(!CameraFreenect2::available())
|
if(!CameraFreenect2::available())
|
||||||
{
|
{
|
||||||
_ui->comboBox_cameraRGBD->setItemData(5, 0, Qt::UserRole - 1);
|
_ui->comboBox_cameraRGBD->setItemData(kSrcFreenect2 - kSrcRGBD, 0, Qt::UserRole - 1);
|
||||||
}
|
}
|
||||||
if (!CameraK4W2::available())
|
if (!CameraK4W2::available())
|
||||||
{
|
{
|
||||||
_ui->comboBox_cameraRGBD->setItemData(8, 0, Qt::UserRole - 1);
|
_ui->comboBox_cameraRGBD->setItemData(kSrcK4W2 - kSrcRGBD, 0, Qt::UserRole - 1);
|
||||||
}
|
}
|
||||||
if (!CameraRealSense::available())
|
if (!CameraRealSense::available())
|
||||||
{
|
{
|
||||||
_ui->comboBox_cameraRGBD->setItemData(6, 0, Qt::UserRole - 1);
|
_ui->comboBox_cameraRGBD->setItemData(kSrcRealSense - kSrcRGBD, 0, Qt::UserRole - 1);
|
||||||
|
}
|
||||||
|
if (!CameraRealSense2::available())
|
||||||
|
{
|
||||||
|
_ui->comboBox_cameraRGBD->setItemData(kSrcRealSense2 - kSrcRGBD, 0, Qt::UserRole - 1);
|
||||||
}
|
}
|
||||||
if(!CameraStereoDC1394::available())
|
if(!CameraStereoDC1394::available())
|
||||||
{
|
{
|
||||||
_ui->comboBox_cameraStereo->setItemData(0, 0, Qt::UserRole - 1);
|
_ui->comboBox_cameraStereo->setItemData(kSrcDC1394 - kSrcStereo, 0, Qt::UserRole - 1);
|
||||||
}
|
}
|
||||||
if(!CameraStereoFlyCapture2::available())
|
if(!CameraStereoFlyCapture2::available())
|
||||||
{
|
{
|
||||||
_ui->comboBox_cameraStereo->setItemData(1, 0, Qt::UserRole - 1);
|
_ui->comboBox_cameraStereo->setItemData(kSrcFlyCapture2 - kSrcStereo, 0, Qt::UserRole - 1);
|
||||||
}
|
}
|
||||||
if (!CameraStereoZed::available())
|
if (!CameraStereoZed::available())
|
||||||
{
|
{
|
||||||
_ui->comboBox_cameraStereo->setItemData(4, 0, Qt::UserRole - 1);
|
_ui->comboBox_cameraStereo->setItemData(kSrcStereoZed - kSrcStereo, 0, Qt::UserRole - 1);
|
||||||
}
|
}
|
||||||
_ui->openni2_exposure->setEnabled(CameraOpenNI2::exposureGainAvailable());
|
_ui->openni2_exposure->setEnabled(CameraOpenNI2::exposureGainAvailable());
|
||||||
_ui->openni2_gain->setEnabled(CameraOpenNI2::exposureGainAvailable());
|
_ui->openni2_gain->setEnabled(CameraOpenNI2::exposureGainAvailable());
|
||||||
@@ -560,6 +564,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
|||||||
connect(_ui->comboBox_realsensePresetRGB, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->comboBox_realsensePresetRGB, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
connect(_ui->comboBox_realsensePresetDepth, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->comboBox_realsensePresetDepth, SIGNAL(currentIndexChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
connect(_ui->checkbox_realsenseOdom, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->checkbox_realsenseOdom, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
|
connect(_ui->checkbox_rs2_emitter, SIGNAL(stateChanged(int)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
|
|
||||||
connect(_ui->toolButton_cameraImages_timestamps, SIGNAL(clicked()), this, SLOT(selectSourceImagesStamps()));
|
connect(_ui->toolButton_cameraImages_timestamps, SIGNAL(clicked()), this, SLOT(selectSourceImagesStamps()));
|
||||||
connect(_ui->lineEdit_cameraImages_timestamps, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));
|
connect(_ui->lineEdit_cameraImages_timestamps, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));
|
||||||
@@ -1601,6 +1606,7 @@ void PreferencesDialog::resetSettings(QGroupBox * groupBox)
|
|||||||
_ui->comboBox_realsensePresetRGB->setCurrentIndex(0);
|
_ui->comboBox_realsensePresetRGB->setCurrentIndex(0);
|
||||||
_ui->comboBox_realsensePresetDepth->setCurrentIndex(2);
|
_ui->comboBox_realsensePresetDepth->setCurrentIndex(2);
|
||||||
_ui->checkbox_realsenseOdom->setChecked(false);
|
_ui->checkbox_realsenseOdom->setChecked(false);
|
||||||
|
_ui->checkbox_rs2_emitter->setChecked(true);
|
||||||
_ui->lineEdit_openniOniPath->clear();
|
_ui->lineEdit_openniOniPath->clear();
|
||||||
_ui->lineEdit_openni2OniPath->clear();
|
_ui->lineEdit_openni2OniPath->clear();
|
||||||
_ui->lineEdit_cameraRGBDImages_path_rgb->setText("");
|
_ui->lineEdit_cameraRGBDImages_path_rgb->setText("");
|
||||||
@@ -1996,6 +2002,10 @@ void PreferencesDialog::readCameraSettings(const QString & filePath)
|
|||||||
_ui->checkbox_realsenseOdom->setChecked(settings.value("odom", _ui->checkbox_realsenseOdom->isChecked()).toBool());
|
_ui->checkbox_realsenseOdom->setChecked(settings.value("odom", _ui->checkbox_realsenseOdom->isChecked()).toBool());
|
||||||
settings.endGroup(); // RealSense
|
settings.endGroup(); // RealSense
|
||||||
|
|
||||||
|
settings.beginGroup("RealSense2");
|
||||||
|
_ui->checkbox_rs2_emitter->setChecked(settings.value("emitter", _ui->checkbox_rs2_emitter->isChecked()).toBool());
|
||||||
|
settings.endGroup(); // RealSense
|
||||||
|
|
||||||
settings.beginGroup("RGBDImages");
|
settings.beginGroup("RGBDImages");
|
||||||
_ui->lineEdit_cameraRGBDImages_path_rgb->setText(settings.value("path_rgb", _ui->lineEdit_cameraRGBDImages_path_rgb->text()).toString());
|
_ui->lineEdit_cameraRGBDImages_path_rgb->setText(settings.value("path_rgb", _ui->lineEdit_cameraRGBDImages_path_rgb->text()).toString());
|
||||||
_ui->lineEdit_cameraRGBDImages_path_depth->setText(settings.value("path_depth", _ui->lineEdit_cameraRGBDImages_path_depth->text()).toString());
|
_ui->lineEdit_cameraRGBDImages_path_depth->setText(settings.value("path_depth", _ui->lineEdit_cameraRGBDImages_path_depth->text()).toString());
|
||||||
@@ -2410,6 +2420,10 @@ void PreferencesDialog::writeCameraSettings(const QString & filePath) const
|
|||||||
settings.setValue("odom", _ui->checkbox_realsenseOdom->isChecked());
|
settings.setValue("odom", _ui->checkbox_realsenseOdom->isChecked());
|
||||||
settings.endGroup(); // RealSense
|
settings.endGroup(); // RealSense
|
||||||
|
|
||||||
|
settings.beginGroup("RealSense2");
|
||||||
|
settings.setValue("emitter", _ui->checkbox_rs2_emitter->isChecked());
|
||||||
|
settings.endGroup(); // RealSense2
|
||||||
|
|
||||||
settings.beginGroup("RGBDImages");
|
settings.beginGroup("RGBDImages");
|
||||||
settings.setValue("path_rgb", _ui->lineEdit_cameraRGBDImages_path_rgb->text());
|
settings.setValue("path_rgb", _ui->lineEdit_cameraRGBDImages_path_rgb->text());
|
||||||
settings.setValue("path_depth", _ui->lineEdit_cameraRGBDImages_path_depth->text());
|
settings.setValue("path_depth", _ui->lineEdit_cameraRGBDImages_path_depth->text());
|
||||||
@@ -4257,11 +4271,13 @@ void PreferencesDialog::updateSourceGrpVisibility()
|
|||||||
_ui->comboBox_cameraRGBD->currentIndex() == kSrcK4W2 - kSrcRGBD ||
|
_ui->comboBox_cameraRGBD->currentIndex() == kSrcK4W2 - kSrcRGBD ||
|
||||||
_ui->comboBox_cameraRGBD->currentIndex() == kSrcRealSense - kSrcRGBD ||
|
_ui->comboBox_cameraRGBD->currentIndex() == kSrcRealSense - kSrcRGBD ||
|
||||||
_ui->comboBox_cameraRGBD->currentIndex() == kSrcRGBDImages-kSrcRGBD ||
|
_ui->comboBox_cameraRGBD->currentIndex() == kSrcRGBDImages-kSrcRGBD ||
|
||||||
_ui->comboBox_cameraRGBD->currentIndex() == kSrcOpenNI_PCL-kSrcRGBD));
|
_ui->comboBox_cameraRGBD->currentIndex() == kSrcOpenNI_PCL-kSrcRGBD ||
|
||||||
|
_ui->comboBox_cameraRGBD->currentIndex() == kSrcRealSense2-kSrcRGBD));
|
||||||
_ui->groupBox_openni2->setVisible(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcOpenNI2-kSrcRGBD);
|
_ui->groupBox_openni2->setVisible(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcOpenNI2-kSrcRGBD);
|
||||||
_ui->groupBox_freenect2->setVisible(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcFreenect2-kSrcRGBD);
|
_ui->groupBox_freenect2->setVisible(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcFreenect2-kSrcRGBD);
|
||||||
_ui->groupBox_k4w2->setVisible(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcK4W2 - kSrcRGBD);
|
_ui->groupBox_k4w2->setVisible(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcK4W2 - kSrcRGBD);
|
||||||
_ui->groupBox_realsense->setVisible(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcRealSense - kSrcRGBD);
|
_ui->groupBox_realsense->setVisible(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcRealSense - kSrcRGBD);
|
||||||
|
_ui->groupBox_realsense2->setVisible(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcRealSense2 - kSrcRGBD);
|
||||||
_ui->groupBox_cameraRGBDImages->setVisible(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcRGBDImages-kSrcRGBD);
|
_ui->groupBox_cameraRGBDImages->setVisible(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcRGBDImages-kSrcRGBD);
|
||||||
_ui->groupBox_openni->setVisible(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcOpenNI_PCL-kSrcRGBD);
|
_ui->groupBox_openni->setVisible(_ui->comboBox_sourceType->currentIndex() == 0 && _ui->comboBox_cameraRGBD->currentIndex() == kSrcOpenNI_PCL-kSrcRGBD);
|
||||||
|
|
||||||
@@ -4948,6 +4964,24 @@ Camera * PreferencesDialog::createCamera(bool useRawImages, bool useColor)
|
|||||||
this->getSourceLocalTransform());
|
this->getSourceLocalTransform());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (driver == kSrcRealSense2)
|
||||||
|
{
|
||||||
|
if(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 CameraRealSense2(
|
||||||
|
this->getSourceDevice().toStdString(),
|
||||||
|
this->getGeneralInputRate(),
|
||||||
|
this->getSourceLocalTransform());
|
||||||
|
((CameraRealSense2*)camera)->setEmitterEnabled(_ui->checkbox_rs2_emitter->isChecked());
|
||||||
|
}
|
||||||
|
}
|
||||||
else if(driver == kSrcRGBDImages)
|
else if(driver == kSrcRGBDImages)
|
||||||
{
|
{
|
||||||
camera = new CameraRGBDImages(
|
camera = new CameraRGBDImages(
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
@@ -27,7 +27,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1012</width>
|
<width>1012</width>
|
||||||
<height>21</height>
|
<height>22</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../GuiLib.qrc">
|
<iconset resource="../GuiLib.qrc">
|
||||||
<normaloff>:/images/r200.png</normaloff>:/images/r200.png</iconset>
|
<normaloff>:/images/d435.png</normaloff>:/images/d435.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionRealSense_R200"/>
|
<addaction name="actionRealSense_R200"/>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -187,12 +187,23 @@
|
|||||||
</property>
|
</property>
|
||||||
<addaction name="actionRealSense_ZR300"/>
|
<addaction name="actionRealSense_ZR300"/>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QMenu" name="menuRealSense_D435">
|
||||||
|
<property name="title">
|
||||||
|
<string>RealSense D435</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../GuiLib.qrc">
|
||||||
|
<normaloff>:/images/d435.png</normaloff>:/images/d435.png</iconset>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionRealSense2_D435"/>
|
||||||
|
</widget>
|
||||||
<addaction name="menuKinect_for_Xbox_360"/>
|
<addaction name="menuKinect_for_Xbox_360"/>
|
||||||
<addaction name="menuXtion_PRO_LIVE"/>
|
<addaction name="menuXtion_PRO_LIVE"/>
|
||||||
<addaction name="menuSense_3D_scanner"/>
|
<addaction name="menuSense_3D_scanner"/>
|
||||||
<addaction name="menuKinect_v2"/>
|
<addaction name="menuKinect_v2"/>
|
||||||
<addaction name="menuRealSense_R200"/>
|
<addaction name="menuRealSense_R200"/>
|
||||||
<addaction name="menuRealSense_ZR300"/>
|
<addaction name="menuRealSense_ZR300"/>
|
||||||
|
<addaction name="menuRealSense_D435"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuStereo_camera">
|
<widget class="QMenu" name="menuStereo_camera">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@@ -1466,6 +1477,14 @@
|
|||||||
<string>Kinect for Windows SDK v2</string>
|
<string>Kinect for Windows SDK v2</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionRealSense2_D435">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>RealSense2</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
|||||||
@@ -63,9 +63,9 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>-567</y>
|
<y>-510</y>
|
||||||
<width>680</width>
|
<width>680</width>
|
||||||
<height>2812</height>
|
<height>2836</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||||
@@ -2827,7 +2827,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="stackedWidget_src">
|
<widget class="QStackedWidget" name="stackedWidget_src">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page_41">
|
<widget class="QWidget" name="page_41">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_64">
|
<layout class="QVBoxLayout" name="verticalLayout_64">
|
||||||
@@ -2905,6 +2905,11 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
<string>Kinect for Windows SDK v2</string>
|
<string>Kinect for Windows SDK v2</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>RealSense2</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
@@ -2942,7 +2947,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="stackedWidget_rgbd">
|
<widget class="QStackedWidget" name="stackedWidget_rgbd">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>7</number>
|
<number>9</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page_32">
|
<widget class="QWidget" name="page_32">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_63">
|
<layout class="QVBoxLayout" name="verticalLayout_63">
|
||||||
@@ -3816,6 +3821,71 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="page_55">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_103">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_realsense2">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>RealSense2</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_100" rowstretch="0,1">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="checkbox_rs2_emitter">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="label_468">
|
||||||
|
<property name="text">
|
||||||
|
<string>Emitter enabled</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<spacer name="verticalSpacer_71">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_72">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>338</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -3958,7 +4028,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>4</number>
|
<number>0</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">
|
||||||
|
|||||||
Reference in New Issue
Block a user