本文整理汇总了C++中image_transport::SubscriberFilter::getSubscriber方法的典型用法代码示例。如果您正苦于以下问题:C++ SubscriberFilter::getSubscriber方法的具体用法?C++ SubscriberFilter::getSubscriber怎么用?C++ SubscriberFilter::getSubscriber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类image_transport::SubscriberFilter
的用法示例。
在下文中一共展示了SubscriberFilter::getSubscriber方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
// Handles (un)subscribing when clients (un)subscribe
void PointCloud2Nodelet::connectCb()
{
boost::lock_guard<boost::mutex> lock(connect_mutex_);
if (pub_points2_.getNumSubscribers() == 0)
{
sub_l_image_ .unsubscribe();
sub_l_info_ .unsubscribe();
sub_r_info_ .unsubscribe();
sub_disparity_.unsubscribe();
}
else if (!sub_l_image_.getSubscriber())
{
ros::NodeHandle &nh = getNodeHandle();
// Queue size 1 should be OK; the one that matters is the synchronizer queue size.
sub_l_image_ .subscribe(*it_, "left/image_rect_color", 1);
sub_l_info_ .subscribe(nh, "left/camera_info", 1);
sub_r_info_ .subscribe(nh, "right/camera_info", 1);
sub_disparity_.subscribe(nh, "disparity", 1);
}
}
示例2: connectCb
// Handles (un)subscribing when clients (un)subscribe
void DisparityWideNodelet::connectCb()
{
boost::lock_guard<boost::mutex> lock(connect_mutex_);
if (pub_disparity_.getNumSubscribers() == 0)
{
sub_l_image_.unsubscribe();
sub_l_info_ .unsubscribe();
sub_r_image_.unsubscribe();
sub_r_info_ .unsubscribe();
}
else if (!sub_l_image_.getSubscriber())
{
ros::NodeHandle &nh = getNodeHandle();
// Queue size 1 should be OK; the one that matters is the synchronizer queue size.
/// @todo Allow remapping left, right?
image_transport::TransportHints hints("raw", ros::TransportHints(), getPrivateNodeHandle());
sub_l_image_.subscribe(*it_, "left_wide/image_rect", 1, hints);
sub_l_info_ .subscribe(nh, "left_wide/camera_info", 1);
sub_r_image_.subscribe(*it_, "right/image_rect", 1, hints);
sub_r_info_ .subscribe(nh, "right/camera_info", 1);
}
}