Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish /aligned_depth_to_color topic only when color frame present #2793

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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