fixed depth align

This commit is contained in:
Joe Dong
2024-05-06 10:34:19 +08:00
parent cd577ceec7
commit bf807269c4
4 changed files with 61 additions and 17 deletions
+28 -1
View File
@@ -386,7 +386,7 @@ float depthPrecisionFromString(const std::string &depth_precision_level_str) {
if (depth_precision_level_str.size() < 2) {
RCLCPP_WARN_STREAM(rclcpp::get_logger("utils"),
"Invalid depth precision level: " << depth_precision_level_str
<< ". Using default precision level 1mm");
<< ". Using default precision level 1mm");
return 1.0;
}
std::string depth_precision_level_str_num =
@@ -697,4 +697,31 @@ bool isGemini2R(int pid) {
}
return false;
}
OBStreamType obStreamTypeFromString(const std::string &stream_type) {
std::string upper_stream_type = stream_type;
std::transform(upper_stream_type.begin(), upper_stream_type.end(), upper_stream_type.begin(),
::toupper);
if (upper_stream_type == "VIDEO") {
return OB_STREAM_VIDEO;
} else if (upper_stream_type == "IR") {
return OB_STREAM_IR;
} else if (upper_stream_type == "COLOR") {
return OB_STREAM_COLOR;
} else if (upper_stream_type == "DEPTH") {
return OB_STREAM_DEPTH;
} else if (upper_stream_type == "ACCEL") {
return OB_STREAM_ACCEL;
} else if (upper_stream_type == "GYRO") {
return OB_STREAM_GYRO;
} else if (upper_stream_type == "IR_LEFT") {
return OB_STREAM_IR_LEFT;
} else if (upper_stream_type == "IR_RIGHT") {
return OB_STREAM_IR_RIGHT;
} else if (upper_stream_type == "RAW_PHASE") {
return OB_STREAM_RAW_PHASE;
} else {
return OB_STREAM_UNKNOWN;
}
}
} // namespace orbbec_camera