mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-07 21:37:46 +08:00
add frame loss judgment but service switch color or depth does not work
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user