fix: update launch file to change device preset to depth work mode and enhance depth mode logging

This commit is contained in:
ob-yalian
2025-11-07 11:30:48 +08:00
parent da6630d0e5
commit a4ec07a07f
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -345,9 +345,14 @@ void OBCameraNode::setupDevices() {
RCLCPP_ERROR_STREAM(logger_, "Failed to load device preset");
}
}
if (!depth_work_mode_.empty()) {
RCLCPP_INFO_STREAM(logger_, "Set depth work mode: " << depth_work_mode_);
if (!depth_work_mode_.empty() &&
device_->isPropertySupported(OB_STRUCT_CURRENT_DEPTH_ALG_MODE, OB_PERMISSION_READ_WRITE)) {
auto depthModeList = device_->getDepthWorkModeList();
for (uint32_t i = 0; i < depthModeList->getCount(); i++) {
RCLCPP_INFO_STREAM(logger_, "depthModeList[" << i << "]: " << (*depthModeList)[i].name);
}
TRY_EXECUTE_BLOCK(device_->switchDepthWorkMode(depth_work_mode_.c_str()));
RCLCPP_INFO_STREAM(logger_, "Set depth work mode: " << depth_work_mode_);
}
if (!sync_mode_str_.empty()) {
auto sync_config = device_->getMultiDeviceSyncConfig();