Open
Conversation
There was a problem hiding this comment.
Pull request overview
Updates BridgePublisher’s “lazy publishing” behavior so that when lazy publishing is disabled, messages are still published even if there are no subscribers.
Changes:
- Publish the main ROS message even with zero subscribers when
_lazyPublisheris disabled. - Publish the camera info message even with zero subscribers when
_lazyPublisheris disabled.
Comments suppressed due to low confidence (1)
depthai_bridge/include/depthai_bridge/BridgePublisher.hpp:247
- When
_lazyPublisheris false, this condition is always true even if_isImageMessageis false (e.g., Image publisher withoutcameraName). In that case_camInfoManager/_cameraInfoPublisherare never initialized, so this will dereference a null pointer and crash. Gate camera-info publication on_isImageMessage(and/or check the pointers) in addition to the lazy/subscriber logic.
if(!_lazyPublisher || infoSubCount > 0) {
auto localCameraInfo = _camInfoManager->getCameraInfo();
localCameraInfo.header.stamp = currMsg.header.stamp;
localCameraInfo.header.frame_id = currMsg.header.frame_id;
_cameraInfoPublisher->publish(localCameraInfo);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Author: Olivier Demers
Issue
Issue link (if present):
Issue description:
Related PRs
Changes
ROS distro: Humble
List of changes:
Testing
Hardware used: OAK-D-PRO-W-POE
Depthai library version: 3
Visuals from testing
Add screenshots/gifs/videos from RVIZ or other visualizers demonstrating the effect of the changes when applicable.