当前位置: 首页>>代码示例>>C++>>正文


C++ SubscriberFilter::getTopic方法代码示例

本文整理汇总了C++中image_transport::SubscriberFilter::getTopic方法的典型用法代码示例。如果您正苦于以下问题:C++ SubscriberFilter::getTopic方法的具体用法?C++ SubscriberFilter::getTopic怎么用?C++ SubscriberFilter::getTopic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在image_transport::SubscriberFilter的用法示例。


在下文中一共展示了SubscriberFilter::getTopic方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: checkInputsSynchronized

 void checkInputsSynchronized()
 {
   int threshold = 3 * all_received_;
   if (left_received_ >= threshold || right_received_ >= threshold || 
       left_info_received_ >= threshold || right_info_received_ >= threshold) {
     ROS_WARN("[stereo_processor] Low number of synchronized left/right/left_info/right_info tuples received.\n"
              "Left images received:       %d (topic '%s')\n"
              "Right images received:      %d (topic '%s')\n"
              "Left camera info received:  %d (topic '%s')\n"
              "Right camera info received: %d (topic '%s')\n"
              "Synchronized tuples: %d\n"
              "Possible issues:\n"
              "\t* stereo_image_proc is not running.\n"
              "\t  Does `rosnode info %s` show any connections?\n"
              "\t* The cameras are not synchronized.\n"
              "\t  Try restarting the node with parameter _approximate_sync:=True\n"
              "\t* The network is too slow. One or more images are dropped from each tuple.\n"
              "\t  Try restarting the node, increasing parameter 'queue_size' (currently %d)",
              left_received_, left_sub_.getTopic().c_str(),
              right_received_, right_sub_.getTopic().c_str(),
              left_info_received_, left_info_sub_.getTopic().c_str(),
              right_info_received_, right_info_sub_.getTopic().c_str(),
              all_received_, ros::this_node::getName().c_str(), queue_size_);
   }
 }
开发者ID:Athria,项目名称:Thesis,代码行数:25,代码来源:stereo_processor.hpp

示例2: checkInputsSynchronized

 void checkInputsSynchronized()
 {
   int threshold = 3 * all_received_;
   if (image_received_ >= threshold || depth_received_ >= threshold || 
       image_info_received_ >= threshold || depth_info_received_ >= threshold) {
     ROS_WARN("[stereo_processor] Low number of synchronized image/depth/image_info/depth_info tuples received.\n"
              "Images received:            %d (topic '%s')\n"
              "Depth images received:      %d (topic '%s')\n"
              "Image camera info received: %d (topic '%s')\n"
              "Depth camera info received: %d (topic '%s')\n"
              "Synchronized tuples: %d\n",
              image_received_, image_sub_.getTopic().c_str(),
              depth_received_, depth_sub_.getTopic().c_str(),
              image_info_received_, image_info_sub_.getTopic().c_str(),
              depth_info_received_, depth_info_sub_.getTopic().c_str(),
              all_received_);
   }
 }
开发者ID:Athria,项目名称:Thesis,代码行数:18,代码来源:mono_depth_processor.hpp

示例3: connectCallback

// Connection callback that unsubscribes from the tracker if no one is subscribed.
void connectCallback(message_filters::Subscriber<CameraInfo> &sub_cam,
                     message_filters::Subscriber<GroundPlane> &sub_gp,
                     image_transport::SubscriberFilter &sub_col,
                     image_transport::SubscriberFilter &sub_dep,
                     image_transport::ImageTransport &it) {
    if(!pub_message.getNumSubscribers() && !pub_result_image.getNumSubscribers() && !pub_centres.getNumSubscribers() && !pub_detected_persons.getNumSubscribers()) {
        ROS_DEBUG("Upper Body Detector: No subscribers. Unsubscribing.");
        sub_cam.unsubscribe();
        sub_gp.unsubscribe();
        sub_col.unsubscribe();
        sub_dep.unsubscribe();
    } else {
        ROS_DEBUG("Upper Body Detector: New subscribers. Subscribing.");
        sub_cam.subscribe();
        sub_gp.subscribe();
        sub_col.subscribe(it,sub_col.getTopic().c_str(),1);
        sub_dep.subscribe(it,sub_dep.getTopic().c_str(),1);
    }
}
开发者ID:Aharobot,项目名称:spencer_people_tracking,代码行数:20,代码来源:main.cpp

示例4: connectCallback

// Connection callback that unsubscribes from the tracker if no one is subscribed.
void connectCallback(ros::Subscriber &sub_msg,
                     ros::NodeHandle &n,
                     string gp_topic,
                     string img_topic,
                     Subscriber<GroundPlane> &sub_gp,
                     Subscriber<CameraInfo> &sub_cam,
                     image_transport::SubscriberFilter &sub_col,
                     image_transport::ImageTransport &it){
    if(!pub_message.getNumSubscribers() && !pub_result_image.getNumSubscribers() && !pub_detected_persons.getNumSubscribers()) {
        ROS_DEBUG("HOG: No subscribers. Unsubscribing.");
        sub_msg.shutdown();
        sub_gp.unsubscribe();
        sub_cam.unsubscribe();
        sub_col.unsubscribe();
    } else {
        ROS_DEBUG("HOG: New subscribers. Subscribing.");
        if(strcmp(gp_topic.c_str(), "") == 0) {
            sub_msg = n.subscribe(img_topic.c_str(), 1, &imageCallback);
        }
        sub_cam.subscribe();
        sub_gp.subscribe();
        sub_col.subscribe(it,sub_col.getTopic().c_str(),1);
    }
}
开发者ID:3011204077,项目名称:spencer_people_tracking,代码行数:25,代码来源:main.cpp


注:本文中的image_transport::SubscriberFilter::getTopic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。