Updated zed sdk5 resolution and quality

This commit is contained in:
matlabbe
2026-07-02 23:00:29 -07:00
parent 1e25f5d4e1
commit 3a95215c99
4 changed files with 83 additions and 19 deletions
@@ -49,7 +49,7 @@ public:
public: public:
CameraStereoZed( CameraStereoZed(
int deviceId, int deviceId,
int resolution = -1, // -1 = AUTO, 0=HD4K 1=HD2K 2=HD1080 3=HD1200 4=HD720 5=SVGA 6=VGA int resolution = -1, // -1 = AUTO, 0=HD4K 1=QHDPLUS 2=HD2K 3=HD1536 4=HD1080 5=HD1200 6=HD720 7=SVGA 8=VGA 9=XVGA 10=TXVGA
int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY
int sensingMode = 0,// 0=STANDARD, 1=FILL int sensingMode = 0,// 0=STANDARD, 1=FILL
int confidenceThr = 100, int confidenceThr = 100,
+30 -13
View File
@@ -303,28 +303,42 @@ CameraStereoZed::CameraStereoZed(
{ {
UDEBUG(""); UDEBUG("");
#ifdef RTABMAP_ZED #ifdef RTABMAP_ZED
// -1 = AUTO, 0=HD4K 1=QHDPLUS 2=HD2K 3=HD1536 4=HD1080 5=HD1200 6=HD720 7=SVGA 8=VGA 9=XVGA 10=TXVGA
#if ZED_SDK_MAJOR_VERSION < 4 #if ZED_SDK_MAJOR_VERSION < 4
if(resolution_ == 1 || resolution_ == 2) // HD2K, HD1080 // Zed3 Supported: 2=HD2K 4=HD1080 6=HD720 8=VGA
if(resolution_ == 0 || resolution_ == 1) // 0=HD4K 1=QHDPLUS
{ {
resolution_ -= 1; // HD2K=0, HD1080=1 UWARN("Zed SDK v4 doesn't support HD4K and QHDPLUS, setting HD2K.");
resolution_ = 2; // 2=HD2K
} }
if(resolution_ == 3) // HD1200 if(resolution_ == 3 || resolution_ == 5) // 3=HD1536 5=HD1200
{ {
resolution_ = 1; // HD1080=1 UWARN("Zed SDK v4 doesn't support HD1536 and HD1200, setting HD1080.");
resolution_ = 4; // 4=HD1080
} }
if(resolution_ == 4 || resolution_ == -1) if(resolution_ == 7 || resolution_ >=9) // 7=SVGA 9=XVGA 10=TXVGA
{ {
resolution_ = 2; // HD720=2 UWARN("Zed SDK v4 doesn't support SVGA, XVGA and TXVGA, setting VGA.");
resolution_ = 8; // 8=VGA
} }
else if(resolution_ == 5 || resolution_ == 6) // SVGA, VGA #else
{
resolution_ = 3; // VGA=3
}
#else // ZED=4
if(resolution_ == -1) if(resolution_ == -1)
{ {
resolution_ = int(sl::RESOLUTION::AUTO); // AUTO resolution_ = int(sl::RESOLUTION::AUTO); // AUTO
} }
#if ZED_SDK_MAJOR_VERSION < 5
// Zed4 Supported: 0=HD4K 1=QHDPLUS 2=HD2K 4=HD1080 5=HD1200 6=HD720 7=SVGA 8=VGA
if(resolution_ == 3) // 3=HD1536
{
UWARN("Zed SDK v4 doesn't support HD1536, setting HD1200.");
resolution_ = 5; // 5=HD1200
}
if(resolution_ >=9) // 9=XVGA 10=TXVGA
{
UWARN("Zed SDK v4 doesn't support XVGA and TXVGA, setting VGA.");
resolution_ = 8; // 8=VGA
}
#endif
#endif #endif
#if ZED_SDK_MAJOR_VERSION < 3 #if ZED_SDK_MAJOR_VERSION < 3
@@ -485,8 +499,11 @@ bool CameraStereoZed::init(const std::string & calibrationFolder, const std::str
// CORRUPTED_SDK_INSTALLATION on open() is typically a NEURAL depth mode whose optional // CORRUPTED_SDK_INSTALLATION on open() is typically a NEURAL depth mode whose optional
// neural/TensorRT runtime files aren't installed. Give a clear, actionable error. // neural/TensorRT runtime files aren't installed. Give a clear, actionable error.
if(r == sl::ERROR_CODE::CORRUPTED_SDK_INSTALLATION && if(r == sl::ERROR_CODE::CORRUPTED_SDK_INSTALLATION &&
param.depth_mode != sl::DEPTH_MODE::PERFORMANCE && #if ZED_SDK_MAJOR_VERSION >= 5
param.depth_mode != sl::DEPTH_MODE::NONE) param.depth_mode >= sl::DEPTH_MODE::NEURAL_LIGHT)
#else
param.depth_mode >= sl::DEPTH_MODE::NEURAL)
#endif
{ {
UERROR("ZED open() returned \"%s\": the optional NEURAL/TensorRT runtime files are " UERROR("ZED open() returned \"%s\": the optional NEURAL/TensorRT runtime files are "
"likely missing. Install ZED SDK %d.%d, or select a non-NEURAL depth mode " "likely missing. Install ZED SDK %d.%d, or select a non-NEURAL depth mode "
+22 -5
View File
@@ -437,12 +437,29 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
_ui->comboBox_cameraStereo->setItemData(kSrcStereoZed - kSrcStereo, 0, Qt::UserRole - 1); _ui->comboBox_cameraStereo->setItemData(kSrcStereoZed - kSrcStereo, 0, Qt::UserRole - 1);
_ui->comboBox_odom_sensor->setItemData(2, 0, Qt::UserRole - 1); _ui->comboBox_odom_sensor->setItemData(2, 0, Qt::UserRole - 1);
} }
else if(CameraStereoZed::sdkVersion() < 4) else
{ {
_ui->comboBox_stereoZed_resolution->setItemData(1, 0, Qt::UserRole - 1); if(CameraStereoZed::sdkVersion() < 5)
_ui->comboBox_stereoZed_resolution->setItemData(4, 0, Qt::UserRole - 1); {
_ui->comboBox_stereoZed_resolution->setItemData(6, 0, Qt::UserRole - 1); // SDK 4.X
_ui->comboBox_stereoZed_quality->setItemData(3, 0, Qt::UserRole - 1); _ui->comboBox_stereoZed_quality->setItemData(5, 0, Qt::UserRole - 1); // NEURAL_ULTRA
_ui->comboBox_stereoZed_resolution->setItemData(4, 0, Qt::UserRole - 1); //HD1536
_ui->comboBox_stereoZed_resolution->setItemData(10, 0, Qt::UserRole - 1); //XVGA
_ui->comboBox_stereoZed_resolution->setItemData(11, 0, Qt::UserRole - 1); //TXGA
}
if(CameraStereoZed::sdkVersion() < 4)
{
// SDK 3.X
_ui->comboBox_stereoZed_quality->setItemData(4, 0, Qt::UserRole - 1); // NEURAL
_ui->comboBox_stereoZed_resolution->setItemData(1, 0, Qt::UserRole - 1); // HD4K
_ui->comboBox_stereoZed_resolution->setItemData(2, 0, Qt::UserRole - 1); // QHDPLUS
_ui->comboBox_stereoZed_resolution->setItemData(6, 0, Qt::UserRole - 1); // HD1200
_ui->comboBox_stereoZed_resolution->setItemData(8, 0, Qt::UserRole - 1); // SVGA
}
if(CameraStereoZed::sdkVersion() < 3)
{
_ui->comboBox_stereoZed_quality->setItemData(3, 0, Qt::UserRole - 1); // NEURAL_LIGHT
}
} }
if (!CameraStereoTara::available()) if (!CameraStereoTara::available())
{ {
+30
View File
@@ -5740,11 +5740,21 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
<string>ULTRA</string> <string>ULTRA</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>NEURAL LIGHT</string>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>NEURAL</string> <string>NEURAL</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>NEURAL ULTRA</string>
</property>
</item>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="5" column="1">
@@ -5903,11 +5913,21 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
<string>HD4K</string> <string>HD4K</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>QHDPLUS</string>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>HD2K</string> <string>HD2K</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>HD1536</string>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>HD1080</string> <string>HD1080</string>
@@ -5933,6 +5953,16 @@ when using the file type, logs are saved in LogRtabmap.txt (located in the worki
<string>VGA</string> <string>VGA</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>XVGA</string>
</property>
</item>
<item>
<property name="text">
<string>TXVGA</string>
</property>
</item>
</widget> </widget>
</item> </item>
</layout> </layout>