fix: update Camera Info Publishing Conditions

This commit is contained in:
slz
2026-03-30 16:25:35 +08:00
parent 90819d2470
commit c26c1d0caf
+2 -3
View File
@@ -365,8 +365,7 @@ void OBCameraNode::setupDevices() {
RCLCPP_INFO_STREAM(logger_, "Setting heartbeat to " << (enable_heartbeat_ ? "ON" : "OFF"));
TRY_TO_SET_PROPERTY(setBoolProperty, OB_PROP_HEARTBEAT_BOOL, enable_heartbeat_);
}
RCLCPP_INFO_STREAM(logger_, "Setting firmware log to "
<< (enable_firmware_log_ ? "ON" : "OFF"));
RCLCPP_INFO_STREAM(logger_, "Setting firmware log to " << (enable_firmware_log_ ? "ON" : "OFF"));
device_->enableFirmwareLog(enable_firmware_log_);
if (max_depth_limit_ > 0 &&
device_->isPropertySupported(OB_PROP_MAX_DEPTH_INT, OB_PERMISSION_READ_WRITE)) {
@@ -3750,7 +3749,7 @@ void OBCameraNode::onNewFrameCallback(const std::shared_ptr<ob::Frame> &frame,
camera_info.p.at(7) = -fy * ex.trans[1] / 1000.0 + 0.0;
}
CHECK_NOTNULL(image_publishers_[stream_index]);
if (!has_raw_image_subscriber && !enable_undistortion_publish) {
if (!has_raw_image_subscriber && !enable_undistortion_publish && !has_subscriber) {
return;
}
if (image.empty() || image.cols != width || image.rows != height) {