add frame loss judgment but service switch color or depth does not work

This commit is contained in:
jj
2024-10-21 14:46:31 +08:00
parent 0ad2053a06
commit b1d5b8ae18
4 changed files with 65 additions and 131 deletions
+5
View File
@@ -1734,6 +1734,7 @@ void OBCameraNode::onNewFrameSetCallback(std::shared_ptr<ob::FrameSet> frame_set
auto color_frame = frame_set->getFrame(OB_FRAME_COLOR);
if (isGemini335PID(pid)) {
depth_frame = processDepthFrameFilter(depth_frame);
bool depth_aligned = false;
if (depth_frame) {
frame_set->pushFrame(depth_frame);
}
@@ -1742,6 +1743,7 @@ void OBCameraNode::onNewFrameSetCallback(std::shared_ptr<ob::FrameSet> frame_set
auto new_frame_set = new_frame->as<ob::FrameSet>();
CHECK_NOTNULL(new_frame_set.get());
frame_set = new_frame_set;
depth_aligned = true;
} else {
RCLCPP_ERROR(logger_, "Failed to align depth frame to color frame");
return;
@@ -1751,6 +1753,9 @@ void OBCameraNode::onNewFrameSetCallback(std::shared_ptr<ob::FrameSet> frame_set
"Depth registration is disabled or align filter is null or depth frame is "
"null or color frame is null");
}
if (depth_registration_ && align_filter_ && !depth_aligned) {
return;
}
}
if (enable_stream_[COLOR] && color_frame) {