ROS::多话题消息同步

更新时间:2023-07-19 23:42:39 阅读: 评论:0

vtp
ROS::多话题消息同步
ROS::多话题消息同步
#include<ros/ros.h>
#include"nsor_msgs/LarScan.h"
#include"geometry_msgs/PoWithCovarianceStamped.h"
#include<message_filters/subscriber.h>
战色
#include<message_filters/synchronizer.h>
horrible的反义词
#include<message_filters/sync_policies/approximate_time.h>
#include<message_filters/time_synchronizer.h>
#include<boost/thread/thread.hpp>
cocktailampere#include<iostream>
科学的英语
void multi_callback(const nsor_msgs::LarScanConstPtr& scan,const geometry_msgs::PoWithCovarianceStampedConstPtr& po)
{
std::cout <<"同步完成!"<< std::endl;dock是什么
}
int main(int argc,char** argv)
英语手抄报版面设计图
{
ros::init(argc, argv,"multi_receiver");
dataceros::NodeHandle n;
message_filters::Subscriber<nsor_msgs::LarScan>subscriber_lar(n,"scan",1000,ros::TransportHints().tcpNoDelay());
message_filters::Subscriber<geometry_msgs::PoWithCovarianceStamped>subscriber_po(n,"car_po",1000,ros::TransportHints().tcpNoDelay());
typedef message_filters::sync_policies::ApproximateTime<nsor_msgs::LarScan, geometry_msgs::PoWithCovarianceStamped> syncPolicy;
//message_filters::TimeSynchronizer<nsor_msgs::LarScan,geometry_msgs::PoWithCovarianceStamped> sync(subscriber_lar, subscriber_pos e, 10);
message_filters::Synchronizer<syncPolicy>sync(syncPolicy(10), subscriber_lar, subscriber_po);
resumestd::cout <<"hahah"<< std::endl;
ros::spin();
return0;
}

本文发布于:2023-07-19 23:42:39,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/182661.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:话题   版面设计   消息   手抄报
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图