fix: remove unused calibration parameter assignment in setupPipelineConfig

This commit is contained in:
ob-yalian
2025-12-29 09:54:10 +08:00
parent a01ee1a533
commit 6907d34a1c
+19 -10
View File
@@ -217,7 +217,7 @@ void OBCameraNode::setupDevices() {
std::vector<int> values; std::vector<int> values;
values.reserve(4); values.reserve(4);
while (std::getline(iss, token, ',')) { while (std::getline(iss, token, ',')) {
values.push_back(std::stoi(token)); values.push_back(std::stoi(token));
} }
if (values.size() >= 4) { if (values.size() >= 4) {
@@ -226,17 +226,18 @@ void OBCameraNode::setupDevices() {
presetResolutionConfig.irDecimationFactor = values[2]; presetResolutionConfig.irDecimationFactor = values[2];
presetResolutionConfig.depthDecimationFactor = values[3]; presetResolutionConfig.depthDecimationFactor = values[3];
} else { } else {
RCLCPP_WARN_STREAM(logger_, "Invalid preset_resolution_config parameter. " RCLCPP_WARN_STREAM(
"Expected format: width,height,ir_decimation_factor,depth_decimation_factor"); logger_,
"Invalid preset_resolution_config parameter. "
"Expected format: width,height,ir_decimation_factor,depth_decimation_factor");
} }
RCLCPP_INFO_STREAM(logger_, "Setting preset resolution config to " RCLCPP_INFO_STREAM(
<< "width: " << presetResolutionConfig.width logger_, "Setting preset resolution config to "
<< ", height: " << presetResolutionConfig.height << "width: " << presetResolutionConfig.width
<< ", ir decimation factor: " << ", height: " << presetResolutionConfig.height << ", ir decimation factor: "
<< presetResolutionConfig.irDecimationFactor << presetResolutionConfig.irDecimationFactor << ", depth decimation factor: "
<< ", depth decimation factor: " << presetResolutionConfig.depthDecimationFactor);
<< presetResolutionConfig.depthDecimationFactor);
TRY_EXECUTE_BLOCK(device_->setStructuredData(OB_STRUCT_PRESET_RESOLUTION_CONFIG, TRY_EXECUTE_BLOCK(device_->setStructuredData(OB_STRUCT_PRESET_RESOLUTION_CONFIG,
(uint8_t *)&presetResolutionConfig, (uint8_t *)&presetResolutionConfig,
@@ -2205,6 +2206,14 @@ void OBCameraNode::setupPipelineConfig() {
auto device_info = device_->getDeviceInfo(); auto device_info = device_->getDeviceInfo();
CHECK_NOTNULL(device_info.get()); CHECK_NOTNULL(device_info.get());
auto pid = device_info->getPid(); auto pid = device_info->getPid();
if (depth_registration_ && enable_stream_[COLOR] && enable_stream_[DEPTH] &&
!isGemini335PID(pid)) {
OBAlignMode align_mode = align_mode_ == "HW" ? ALIGN_D2C_HW_MODE : ALIGN_D2C_SW_MODE;
RCLCPP_INFO_STREAM(logger_, "set align mode to " << magic_enum::enum_name(align_mode));
pipeline_config_->setAlignMode(align_mode);
RCLCPP_INFO_STREAM(logger_, "enable depth scale " << (enable_depth_scale_ ? "ON" : "OFF"));
pipeline_config_->setDepthScaleRequire(enable_depth_scale_);
}
for (const auto &stream_index : IMAGE_STREAMS) { for (const auto &stream_index : IMAGE_STREAMS) {
if (enable_stream_[stream_index]) { if (enable_stream_[stream_index]) {
RCLCPP_INFO_STREAM(logger_, "Enable " << stream_name_[stream_index] << " stream"); RCLCPP_INFO_STREAM(logger_, "Enable " << stream_name_[stream_index] << " stream");