Skip to content

Commit

Permalink
implement CameraSubscriber::getNumPublishers (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeferguson authored Jan 22, 2024
1 parent 27dd6e0 commit 15eecd1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions image_transport/src/camera_subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,11 @@ std::string CameraSubscriber::getInfoTopic() const

size_t CameraSubscriber::getNumPublishers() const
{
// TODO(ros2) Fix this when ros2 has better subscriber counting.
// @todo Fix this when message_filters::Subscriber has getNumPublishers()
// if (impl_) {
// return std::max(impl_->image_sub_.getNumPublishers(), impl_->info_sub_.getNumPublishers());
// }
// if (impl_) return impl_->image_sub_.getNumPublishers();
if (impl_) {
return std::max(
impl_->image_sub_.getSubscriber().getNumPublishers(),
impl_->info_sub_.getSubscriber()->get_publisher_count());
}
return 0;
}

Expand Down

0 comments on commit 15eecd1

Please sign in to comment.