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


C++ NodeHandle::createWallTimer方法代码示例

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


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

示例1: privn

	NavGraphRosRetriever(ros::NodeHandle &n)
		: n(n)
	{
		ros::NodeHandle privn("~");
		GET_CONFIG(privn, n, "navgraph_file", cfg_navgraph_file_);

		if (cfg_navgraph_file_.empty()) {
			throw std::runtime_error("No navgraph file given");
		}

		boost::filesystem::path p(cfg_navgraph_file_);
		p = boost::filesystem::absolute(p);
		cfg_navgraph_file_ = p.string();
		ROS_INFO("Using navgraph path: %s", p.string().c_str());
		if (boost::filesystem::exists(p)) {
			boost::filesystem::remove(p);
		}
		boost::filesystem::create_directories(p.parent_path());

		sub_has_received_ = false;
		sub_navgraph_ = n.subscribe<fawkes_msgs::NavGraph>("navgraph", 10, &NavGraphRosRetriever::cb_navgraph, this);

		sub_init_timer_ =
			n.createWallTimer(ros::WallDuration(5.0), &NavGraphRosRetriever::cb_sub_init_timer, this);
	}
开发者ID:timn,项目名称:ros-rcll_fawkes_sim,代码行数:25,代码来源:fawkes_navgraph_retriever.cpp

示例2: SubscriberTest

 SubscriberTest()
 {
   // Setup a one-shot timer to initialize the node after a brief
   // delay so that /rosout is always fully initialized.
   ROS_INFO("Starting initialization timer...");
   init_timer_ = nh_.createWallTimer(ros::WallDuration(1.0),
                                     &SubscriberTest::initialize,
                                     this,
                                     true);
 }
开发者ID:kylerlaird,项目名称:tractobots,代码行数:10,代码来源:subscriber_test.cpp

示例3: Impl

CameraSubscriber::CameraSubscriber(ImageTransport& image_it, ros::NodeHandle& info_nh,
                                   const std::string& base_topic, uint32_t queue_size,
                                   const Callback& callback, const ros::VoidPtr& tracked_object,
                                   const TransportHints& transport_hints)
  : impl_(new Impl(queue_size))
{
  // Must explicitly remap the image topic since we then do some string manipulation on it
  // to figure out the sibling camera_info topic.
  std::string image_topic = info_nh.resolveName(base_topic);
  std::string info_topic = getCameraInfoTopic(image_topic);
  impl_->image_sub_.subscribe(image_it, image_topic, queue_size, transport_hints);
  impl_->info_sub_ .subscribe(info_nh, info_topic, queue_size, transport_hints.getRosHints());
  impl_->sync_.connectInput(impl_->image_sub_, impl_->info_sub_);
  // need for Boost.Bind here is kind of broken
  impl_->sync_.registerCallback(boost::bind(callback, _1, _2));

  // Complain every 10s if it appears that the image and info topics are not synchronized
  impl_->image_sub_.registerCallback(boost::bind(increment, &impl_->image_received_));
  impl_->info_sub_.registerCallback(boost::bind(increment, &impl_->info_received_));
  impl_->sync_.registerCallback(boost::bind(increment, &impl_->both_received_));
  impl_->check_synced_timer_ = info_nh.createWallTimer(ros::WallDuration(10.0),
                                                       boost::bind(&Impl::checkImagesSynchronized, impl_));
}
开发者ID:strawlab,项目名称:image_common,代码行数:23,代码来源:camera_subscriber.cpp


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