diff --git a/corelib/include/rtabmap/core/CameraStereo.h b/corelib/include/rtabmap/core/CameraStereo.h index f1db7875..b20f5d39 100644 --- a/corelib/include/rtabmap/core/CameraStereo.h +++ b/corelib/include/rtabmap/core/CameraStereo.h @@ -118,7 +118,7 @@ public: int deviceId, int resolution = 2, // 0=HD2K, 1=HD1080, 2=HD720, 3=VGA int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY - int sensingMode = 1,// 0=FULL, 1=RAW + int sensingMode = 0,// 0=STANDARD, 1=FILL int confidenceThr = 100, bool computeOdometry = false, float imageRate=0.0f, @@ -127,7 +127,7 @@ public: CameraStereoZed( const std::string & svoFilePath, int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY - int sensingMode = 1,// 0=FULL, 1=RAW + int sensingMode = 0,// 0=STANDARD, 1=FILL int confidenceThr = 100, bool computeOdometry = false, float imageRate=0.0f, diff --git a/corelib/src/CameraStereo.cpp b/corelib/src/CameraStereo.cpp index 967047ca..8ba0d19e 100644 --- a/corelib/src/CameraStereo.cpp +++ b/corelib/src/CameraStereo.cpp @@ -787,7 +787,7 @@ CameraStereoZed::CameraStereoZed( #ifdef RTABMAP_ZED UASSERT(resolution_ >= sl::RESOLUTION_HD2K && resolution_ = sl::DEPTH_MODE_NONE && quality_ = sl::SENSING_MODE_FILL && sensingMode_ = sl::SENSING_MODE_STANDARD && sensingMode_ = 0 && confidenceThr_ <=100); #endif } @@ -900,6 +900,16 @@ bool CameraStereoZed::init(const std::string & calibrationFolder, const std::str this->getLocalTransform(), cv::Size(res.width, res.height)); + UINFO("Calibration: fx=%f, fy=%f, cx=%f, cy=%f, baseline=%f, width=%d, height=%d, transform=%s", + stereoParams->left_cam.fx, + stereoParams->left_cam.fy, + stereoParams->left_cam.cx, + stereoParams->left_cam.cy, + stereoParams->T[0],//baseline + (int)res.width, + (int)res.height, + this->getLocalTransform().prettyPrint().c_str()); + return true; #else UERROR("CameraStereoZED: RTAB-Map is not built with ZED sdk support!"); @@ -956,6 +966,14 @@ static cv::Mat slMat2cvMat(sl::Mat& input) { } #endif +Transform zedPoseToTransform(const sl::Pose & pose) +{ + return Transform( + pose.pose_data.m[0], pose.pose_data.m[1], pose.pose_data.m[2], pose.pose_data.m[3], + pose.pose_data.m[4], pose.pose_data.m[5], pose.pose_data.m[6], pose.pose_data.m[7], + pose.pose_data.m[8], pose.pose_data.m[9], pose.pose_data.m[10], pose.pose_data.m[11]); +} + SensorData CameraStereoZed::captureImage(CameraInfo * info) { SensorData data; @@ -1012,9 +1030,7 @@ SensorData CameraStereoZed::captureImage(CameraInfo * info) int trackingConfidence = pose.pose_confidence; if (trackingConfidence) { - Transform t; - for(int i=0;i<16;i++)t.data()[i]=pose.pose_data.m[i]; - info->odomPose = t; + info->odomPose = zedPoseToTransform(pose); if (!info->odomPose.isNull()) { //transform x->forward, y->left, z->up diff --git a/guilib/src/PreferencesDialog.cpp b/guilib/src/PreferencesDialog.cpp index cf549506..2d04c7e0 100644 --- a/guilib/src/PreferencesDialog.cpp +++ b/guilib/src/PreferencesDialog.cpp @@ -1420,7 +1420,7 @@ void PreferencesDialog::resetSettings(QGroupBox * groupBox) _ui->comboBox_stereoZed_resolution->setCurrentIndex(2); _ui->comboBox_stereoZed_quality->setCurrentIndex(1); _ui->checkbox_stereoZed_selfCalibration->setChecked(false); - _ui->comboBox_stereoZed_sensingMode->setCurrentIndex(1); + _ui->comboBox_stereoZed_sensingMode->setCurrentIndex(0); _ui->spinBox_stereoZed_confidenceThr->setValue(100); _ui->checkbox_stereoZed_odom->setChecked(false); _ui->lineEdit_zedSvoPath->clear(); diff --git a/guilib/src/ui/preferencesDialog.ui b/guilib/src/ui/preferencesDialog.ui index 431b9449..692460c5 100644 --- a/guilib/src/ui/preferencesDialog.ui +++ b/guilib/src/ui/preferencesDialog.ui @@ -63,7 +63,7 @@ 0 - -675 + -433 678 2701 @@ -86,7 +86,7 @@ QFrame::Raised - 15 + 5 @@ -2582,7 +2582,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki - 0 + 1 @@ -3820,12 +3820,12 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki - FILL + STANDARD - STANDARD + FILL @@ -3908,7 +3908,7 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki - Quality. If NONE, the disparity is not computed on the GPU. + Quality. If NONE, the disparity is not computed on the GPU, but on CPU using OpenCV (see StereoBM panel for parameters). true