mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-13 19:40:19 +08:00
fixed align filter
This commit is contained in:
Binary file not shown.
@@ -565,5 +565,6 @@ class OBCameraNode {
|
|||||||
bool enable_heartbeat_ = false;
|
bool enable_heartbeat_ = false;
|
||||||
bool enable_color_undistortion_ = false;
|
bool enable_color_undistortion_ = false;
|
||||||
image_transport::Publisher color_undistortion_publisher_;
|
image_transport::Publisher color_undistortion_publisher_;
|
||||||
|
bool has_first_color_frame_ = false;
|
||||||
};
|
};
|
||||||
} // namespace orbbec_camera
|
} // namespace orbbec_camera
|
||||||
|
|||||||
@@ -1569,9 +1569,10 @@ void OBCameraNode::onNewFrameSetCallback(std::shared_ptr<ob::FrameSet> frame_set
|
|||||||
CHECK_NOTNULL(device_info.get());
|
CHECK_NOTNULL(device_info.get());
|
||||||
auto pid = device_info->pid();
|
auto pid = device_info->pid();
|
||||||
auto color_frame = frame_set->getFrame(OB_FRAME_COLOR);
|
auto color_frame = frame_set->getFrame(OB_FRAME_COLOR);
|
||||||
|
has_first_color_frame_ = has_first_color_frame_ || color_frame;
|
||||||
if (isGemini335PID(pid)) {
|
if (isGemini335PID(pid)) {
|
||||||
depth_frame_ = processDepthFrameFilter(depth_frame_);
|
depth_frame_ = processDepthFrameFilter(depth_frame_);
|
||||||
if (depth_registration_ && align_filter_ && depth_frame_ && color_frame) {
|
if (depth_registration_ && align_filter_ && depth_frame_ && has_first_color_frame_) {
|
||||||
auto new_frame = align_filter_->process(frame_set);
|
auto new_frame = align_filter_->process(frame_set);
|
||||||
if (new_frame) {
|
if (new_frame) {
|
||||||
auto new_frame_set = new_frame->as<ob::FrameSet>();
|
auto new_frame_set = new_frame->as<ob::FrameSet>();
|
||||||
@@ -1585,9 +1586,8 @@ 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_frame_ && !color_frame) {
|
if(depth_registration_ && align_filter_ && depth_frame_ && !has_first_color_frame_) {
|
||||||
RCLCPP_ERROR(logger_,
|
RCLCPP_WARN(logger_, "Waiting for the first color frame to align depth frame");
|
||||||
"Color frame is null, cannot align depth frame to color frame, droped");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user