fix: update device PIDs and improve logging messages for Gemini series

This commit is contained in:
ob-yalian
2026-04-13 20:47:25 +08:00
parent fcd741f541
commit f11e94f452
5 changed files with 42 additions and 27 deletions
@@ -135,10 +135,14 @@ const int32_t CUSTOM_ADVANTECH_GEMINI_336_PID = 0x0816; // Custom Advantech Ge
const int32_t CUSTOM_ADVANTECH_GEMINI_336L_PID = 0x0817; // Custom Advantech Gemini 336L
const int32_t DABAI_MAX_PID = 0x069a; // dabai max
const int32_t GEMINI_338_PID = 0x0818; // Gemini 338
const uint16_t GEMINI_435Le_PID = 0x815; // Gemini 435Le
const uint16_t GEMINI_305_PID = 0x0840; // Gemini 305
const uint16_t GEMINI_305_PID2 = 0x0841; // Gemini 305
const uint16_t GEMINI_305G_PID = 0x0842; // Gemini 305g
const int32_t GEMINI_435Le_PID = 0x815; // Gemini 435Le
const int32_t GEMINI_305_PID = 0x0840; // Gemini 305
const int32_t GEMINI_305_PID2 = 0x0841; // Gemini 305
const int32_t GEMINI_305G_PID = 0x0842; // Gemini 305g
const int32_t GEMINI_338Lg_PID = 0x081A; // Gemini 338Lg
const int32_t GEMINI_338Le_PID = 0x081B; // Gemini 338Le
const int32_t GEMINI_338L_PID = 0x081C; // Gemini 338L
const int32_t GEMINI_331L_PID = 0x081D; // Gemini 331L
inline bool isGemini305SeriesPID(uint32_t pid) {
return pid == GEMINI_305_PID || pid == GEMINI_305_PID2 || pid == GEMINI_305G_PID;
+4 -5
View File
@@ -3155,8 +3155,7 @@ void OBCameraNode::setDepthAutoExposureROI() {
return;
}
if (isGemini305SeriesPID(pid_) && ae_reference_stream_ == "color") {
RCLCPP_WARN_STREAM(logger_,
"Skip setting depth AE ROI because AE Reference Stream is color");
RCLCPP_WARN_STREAM(logger_, "Skip setting depth AE ROI because AE Reference Stream is color");
depth_roi_has_run = true;
return;
}
@@ -3201,8 +3200,7 @@ void OBCameraNode::setColorAutoExposureROI() {
return;
}
if (isGemini305SeriesPID(pid_) && ae_reference_stream_ == "depth") {
RCLCPP_WARN_STREAM(logger_,
"Skip setting color AE ROI because AE Reference Stream is depth");
RCLCPP_WARN_STREAM(logger_, "Skip setting color AE ROI because AE Reference Stream is depth");
color_roi_has_run = true;
return;
}
@@ -4435,7 +4433,8 @@ bool OBCameraNode::isGemini335PID(uint32_t pid) {
pid == GEMINI_335L_PID || pid == GEMINI_330L_PID || pid == GEMINI_336L_PID ||
pid == GEMINI_335LG_PID || pid == GEMINI_336LG_PID || pid == GEMINI_335LE_PID ||
pid == GEMINI_336LE_PID || pid == CUSTOM_ADVANTECH_GEMINI_336_PID ||
pid == CUSTOM_ADVANTECH_GEMINI_336L_PID || pid == GEMINI_338_PID;
pid == CUSTOM_ADVANTECH_GEMINI_336L_PID || pid == GEMINI_338_PID ||
pid == GEMINI_338L_PID || pid == GEMINI_338LE_PID || pid == GEMINI_338LG_PID;
}
bool OBCameraNode::isGemini435LePID(uint32_t pid) { return pid == GEMINI_435Le_PID; }
+20 -12
View File
@@ -217,7 +217,8 @@ void OBCameraNodeDriver::init() {
ob::Context::setLoggerFileName(log_file_name);
RCLCPP_INFO_STREAM(logger_, "SDK log file name set to: " << log_file_name);
} catch (const ob::Error &e) {
RCLCPP_WARN_STREAM(logger_, "Failed to set SDK log file name: " << orbbec_camera::formatObErrorWithStatus(e));
RCLCPP_WARN_STREAM(logger_, "Failed to set SDK log file name: "
<< orbbec_camera::formatObErrorWithStatus(e));
}
}
// Force IP
@@ -528,7 +529,8 @@ void OBCameraNodeDriver::resetDevice() {
device_.reset();
RCLCPP_INFO_STREAM(logger_, "device_ reset completed");
} catch (const ob::Error &e) {
RCLCPP_WARN_STREAM(logger_, "OB Exception during device reset: " << orbbec_camera::formatObErrorWithStatus(e));
RCLCPP_WARN_STREAM(logger_, "OB Exception during device reset: "
<< orbbec_camera::formatObErrorWithStatus(e));
} catch (const std::exception &e) {
RCLCPP_WARN_STREAM(logger_, "Standard exception during device reset: " << e.what());
} catch (...) {
@@ -838,8 +840,9 @@ std::shared_ptr<ob::Device> OBCameraNodeDriver::selectDeviceBySerialNumber(
}
}
} catch (ob::Error &e) {
RCLCPP_ERROR_STREAM_THROTTLE(logger_, *get_clock(), 5000,
"Failed to get device info " << orbbec_camera::formatObErrorWithStatus(e));
RCLCPP_ERROR_STREAM_THROTTLE(
logger_, *get_clock(), 5000,
"Failed to get device info " << orbbec_camera::formatObErrorWithStatus(e));
} catch (std::exception &e) {
RCLCPP_ERROR_STREAM_THROTTLE(logger_, *get_clock(), 5000,
"Failed to get device info " << e.what());
@@ -871,8 +874,9 @@ std::shared_ptr<ob::Device> OBCameraNodeDriver::selectDeviceByUSBPort(
}
return device;
} catch (ob::Error &e) {
RCLCPP_ERROR_STREAM_THROTTLE(logger_, *get_clock(), 5000,
"Failed to get device info " << orbbec_camera::formatObErrorWithStatus(e));
RCLCPP_ERROR_STREAM_THROTTLE(
logger_, *get_clock(), 5000,
"Failed to get device info " << orbbec_camera::formatObErrorWithStatus(e));
} catch (std::exception &e) {
RCLCPP_ERROR_STREAM_THROTTLE(logger_, *get_clock(), 5000,
"Failed to get device info " << e.what());
@@ -907,8 +911,9 @@ std::shared_ptr<ob::Device> OBCameraNodeDriver::selectDeviceByNetIP(
return list->getDevice(i, device_access_mode_);
}
} catch (ob::Error &e) {
RCLCPP_ERROR_STREAM_THROTTLE(logger_, *get_clock(), 5000,
"Failed to get device info " << orbbec_camera::formatObErrorWithStatus(e));
RCLCPP_ERROR_STREAM_THROTTLE(
logger_, *get_clock(), 5000,
"Failed to get device info " << orbbec_camera::formatObErrorWithStatus(e));
continue;
} catch (std::exception &e) {
RCLCPP_ERROR_STREAM_THROTTLE(logger_, *get_clock(), 5000,
@@ -1196,7 +1201,8 @@ bool OBCameraNodeDriver::applyForceIpConfig() {
RCLCPP_ERROR(logger_, "[ForceIP] Failed to apply config (SDK returned false)");
}
} catch (const ob::Error &e) {
RCLCPP_ERROR(logger_, "[ForceIP] ob::Error: %s", orbbec_camera::formatObErrorWithStatus(e).c_str());
RCLCPP_ERROR(logger_, "[ForceIP] ob::Error: %s",
orbbec_camera::formatObErrorWithStatus(e).c_str());
} catch (const std::exception &e) {
RCLCPP_ERROR(logger_, "[ForceIP] std::exception: %s", e.what());
} catch (...) {
@@ -1328,7 +1334,7 @@ void OBCameraNodeDriver::startDevice(const std::shared_ptr<ob::DeviceList> &list
}
auto pid = device->getDeviceInfo()->getPid();
if (GEMINI_335LG_PID == pid) {
if (GEMINI_335LG_PID == pid || GEMINI_338LG_PID == pid) {
ob_camera_node_->startGmslTrigger();
}
if (isGemini305SeriesPID(pid)) {
@@ -1336,7 +1342,8 @@ void OBCameraNodeDriver::startDevice(const std::shared_ptr<ob::DeviceList> &list
ob_camera_node_->startStreams();
}
} catch (ob::Error &e) {
RCLCPP_ERROR_STREAM(logger_, "Failed to initialize device " << orbbec_camera::formatObErrorWithStatus(e));
RCLCPP_ERROR_STREAM(
logger_, "Failed to initialize device " << orbbec_camera::formatObErrorWithStatus(e));
start_device_failed = true;
} catch (std::exception &e) {
RCLCPP_ERROR_STREAM(logger_, "Failed to initialize device " << e.what());
@@ -1409,7 +1416,8 @@ void OBCameraNodeDriver::updatePresetFirmware(std::string path) {
}
}
} catch (ob::Error &e) {
RCLCPP_ERROR_STREAM(logger_, "Failed to update Preset Firmware " << orbbec_camera::formatObErrorWithStatus(e));
RCLCPP_ERROR_STREAM(logger_, "Failed to update Preset Firmware "
<< orbbec_camera::formatObErrorWithStatus(e));
} catch (std::exception &e) {
RCLCPP_ERROR_STREAM(logger_, "Failed to update Preset Firmware " << e.what());
} catch (...) {
+7 -5
View File
@@ -27,11 +27,13 @@ namespace {
bool isGemini330SeriesForDisparity(uint32_t pid) {
return pid == GEMINI_335_PID || pid == GEMINI_336_PID || pid == GEMINI_330_PID ||
pid == GEMINI_335L_PID || pid == GEMINI_336L_PID || pid == GEMINI_330L_PID ||
pid == GEMINI_335LG_PID || pid == GEMINI_335LE_PID;
pid == GEMINI_335LG_PID || pid == GEMINI_335LE_PID || pid == GEMINI_338_PID ||
pid == GEMINI_338Lg_PID || pid == GEMINI_338Le_PID || pid == GEMINI_338L_PID ||
pid == GEMINI_331L_PID;
}
bool isSupportedDisparityResolutionForPid(uint32_t pid, int width, int height) {
if (pid == GEMINI_335LE_PID) {
if (pid == GEMINI_335LE_PID || pid == GEMINI_338LE_PID) {
return (width == 1280 && height == 800) || (width == 640 && height == 400) ||
(width == 424 && height == 266) || (width == 320 && height == 200);
}
@@ -41,11 +43,11 @@ bool isSupportedDisparityResolutionForPid(uint32_t pid, int width, int height) {
}
std::string getDisparityResolutionHintByPid(uint32_t pid) {
if (pid == GEMINI_335LE_PID) {
return "Supported resolutions for Gemini 335Le: 1280x800/640x400/424x266/320x200";
if (pid == GEMINI_335LE_PID || pid == GEMINI_338LE_PID) {
return "Supported resolutions for the current device: 1280x800/640x400/424x266/320x200";
}
return "Supported resolutions for Gemini 335/336/330/335L/336L/335Lg/330L: "
return "Supported resolutions for the current device: "
"1280x800/1280x720/640x400/424x266";
}
+3 -1
View File
@@ -84,7 +84,9 @@ class MultiCameraSubscriber : public rclcpp::Node {
pid == GEMINI_335L_PID || pid == GEMINI_330L_PID || pid == GEMINI_336L_PID ||
pid == GEMINI_335LG_PID || pid == GEMINI_336LG_PID || pid == GEMINI_335LE_PID ||
pid == GEMINI_336LE_PID || pid == CUSTOM_ADVANTECH_GEMINI_336_PID ||
pid == CUSTOM_ADVANTECH_GEMINI_336L_PID || pid == GEMINI_338_PID;
pid == CUSTOM_ADVANTECH_GEMINI_336L_PID || pid == GEMINI_338_PID ||
pid == GEMINI_338Lg_PID || pid == GEMINI_338Le_PID || pid == GEMINI_338L_PID ||
pid == GEMINI_331L_PID;
}
void params_init() {
std::ifstream file(