Skip to content

Commit

Permalink
PR #2793 from Arun-Prasad-V: Publish /aligned_depth_to_color topic on…
Browse files Browse the repository at this point in the history
…ly when color frame present
  • Loading branch information
Nir-Az authored Jun 27, 2023
2 parents afbf534 + d617638 commit aecccac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion realsense2_camera/src/base_realsense_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ void BaseRealSenseNode::frame_callback(rs2::frame frame)
clip_depth(original_depth_frame, _clipping_distance);
}

rs2::video_frame original_color_frame = frameset.get_color_frame();

ROS_DEBUG("num_filters: %d", static_cast<int>(_filters.size()));
for (auto filter_it : _filters)
{
Expand Down Expand Up @@ -529,7 +531,7 @@ void BaseRealSenseNode::frame_callback(rs2::frame frame)
{
if (sent_depth_frame) continue;
sent_depth_frame = true;
if (_align_depth_filter->is_enabled())
if (original_color_frame && _align_depth_filter->is_enabled())
{
publishFrame(f, t, COLOR,
_depth_aligned_image,
Expand Down

0 comments on commit aecccac

Please sign in to comment.