mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-12 07:19:50 +08:00
Remove unnecessary judgments to avoid reducing the color frame rate
This commit is contained in:
@@ -1868,9 +1868,8 @@ void OBCameraNode::onNewFrameSetCallback(std::shared_ptr<ob::FrameSet> frame_set
|
|||||||
depth_laser_status = depth_frame->getMetadataValue(OB_FRAME_METADATA_TYPE_LASER_STATUS) == 1;
|
depth_laser_status = depth_frame->getMetadataValue(OB_FRAME_METADATA_TYPE_LASER_STATUS) == 1;
|
||||||
}
|
}
|
||||||
auto color_frame = frame_set->getFrame(OB_FRAME_COLOR);
|
auto color_frame = frame_set->getFrame(OB_FRAME_COLOR);
|
||||||
depth_frame = processDepthFrameFilter(depth_frame);
|
|
||||||
bool depth_aligned = false;
|
|
||||||
if (depth_frame) {
|
if (depth_frame) {
|
||||||
|
depth_frame = processDepthFrameFilter(depth_frame);
|
||||||
frame_set->pushFrame(depth_frame);
|
frame_set->pushFrame(depth_frame);
|
||||||
}
|
}
|
||||||
if (depth_registration_ && align_filter_ && depth_frame) {
|
if (depth_registration_ && align_filter_ && depth_frame) {
|
||||||
@@ -1878,7 +1877,6 @@ void OBCameraNode::onNewFrameSetCallback(std::shared_ptr<ob::FrameSet> frame_set
|
|||||||
auto new_frame_set = new_frame->as<ob::FrameSet>();
|
auto new_frame_set = new_frame->as<ob::FrameSet>();
|
||||||
CHECK_NOTNULL(new_frame_set.get());
|
CHECK_NOTNULL(new_frame_set.get());
|
||||||
frame_set = new_frame_set;
|
frame_set = new_frame_set;
|
||||||
depth_aligned = true;
|
|
||||||
} else {
|
} else {
|
||||||
RCLCPP_ERROR(logger_, "Failed to align depth frame to color frame");
|
RCLCPP_ERROR(logger_, "Failed to align depth frame to color frame");
|
||||||
return;
|
return;
|
||||||
@@ -1888,9 +1886,6 @@ void OBCameraNode::onNewFrameSetCallback(std::shared_ptr<ob::FrameSet> frame_set
|
|||||||
"Depth registration is disabled or align filter is null or depth frame is "
|
"Depth registration is disabled or align filter is null or depth frame is "
|
||||||
"null or color frame is null");
|
"null or color frame is null");
|
||||||
}
|
}
|
||||||
if (depth_registration_ && align_filter_ && !depth_aligned) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (enable_stream_[COLOR] && color_frame) {
|
if (enable_stream_[COLOR] && color_frame) {
|
||||||
std::unique_lock<std::mutex> lock(color_frame_queue_lock_);
|
std::unique_lock<std::mutex> lock(color_frame_queue_lock_);
|
||||||
|
|||||||
Reference in New Issue
Block a user