mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-12 23:39:50 +08:00
fix: support automatic depth dimensions for Gemini 301 series
This commit is contained in:
@@ -3622,15 +3622,33 @@ void OBCameraNode::setupProfiles() {
|
|||||||
if (is_playback_device_) {
|
if (is_playback_device_) {
|
||||||
selected_profile = profiles->getProfile(0)->as<ob::VideoStreamProfile>();
|
selected_profile = profiles->getProfile(0)->as<ob::VideoStreamProfile>();
|
||||||
} else if (width_[elem] == 0 && height_[elem] == 0 && fps_[elem] == 0 &&
|
} else if (width_[elem] == 0 && height_[elem] == 0 && fps_[elem] == 0 &&
|
||||||
format_[elem] == OB_FORMAT_UNKNOWN) {
|
format_[elem] == OB_FORMAT_UNKNOWN &&
|
||||||
|
!(isGemini301SeriesPID(pid_) && elem == DEPTH &&
|
||||||
|
depth_decimation_factor_ != 1)) {
|
||||||
selected_profile = profiles->getProfile(0)->as<ob::VideoStreamProfile>();
|
selected_profile = profiles->getProfile(0)->as<ob::VideoStreamProfile>();
|
||||||
} else {
|
} else {
|
||||||
if (isGemini301SeriesPID(pid_) && elem == DEPTH) {
|
if (isGemini301SeriesPID(pid_) && elem == DEPTH) {
|
||||||
OBHardwareDecimationConfig conf;
|
if (width_[elem] == 0 || height_[elem] == 0) {
|
||||||
conf.originWidth = width_[elem];
|
// The SDK decimation lookup requires exact origin dimensions, not wildcards.
|
||||||
conf.originHeight = height_[elem];
|
for (const auto &profile : supported_profiles_[elem]) {
|
||||||
conf.factor = depth_decimation_factor_;
|
const auto conf = profile->getDecimationConfig();
|
||||||
selected_profile = profiles->getVideoStreamProfile(conf, format_[elem], fps_[elem]);
|
if ((width_[elem] == 0 || static_cast<int64_t>(conf.originWidth) == width_[elem]) &&
|
||||||
|
(height_[elem] == 0 ||
|
||||||
|
static_cast<int64_t>(conf.originHeight) == height_[elem]) &&
|
||||||
|
static_cast<int64_t>(conf.factor) == depth_decimation_factor_ &&
|
||||||
|
(format_[elem] == OB_FORMAT_ANY || profile->getFormat() == format_[elem]) &&
|
||||||
|
(fps_[elem] == 0 || static_cast<int64_t>(profile->getFps()) == fps_[elem])) {
|
||||||
|
selected_profile = profile;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
OBHardwareDecimationConfig conf;
|
||||||
|
conf.originWidth = width_[elem];
|
||||||
|
conf.originHeight = height_[elem];
|
||||||
|
conf.factor = depth_decimation_factor_;
|
||||||
|
selected_profile = profiles->getVideoStreamProfile(conf, format_[elem], fps_[elem]);
|
||||||
|
}
|
||||||
} else if (isGemini301SeriesPID(pid_) && elem == INFRA1) {
|
} else if (isGemini301SeriesPID(pid_) && elem == INFRA1) {
|
||||||
OBHardwareDecimationConfig conf;
|
OBHardwareDecimationConfig conf;
|
||||||
conf.originWidth = width_[elem];
|
conf.originWidth = width_[elem];
|
||||||
|
|||||||
Reference in New Issue
Block a user