当前位置:网站首页>ROS知识点——消息过滤器 ( message_filters)
ROS知识点——消息过滤器 ( message_filters)
2022-07-02 14:49:00 【Jerry_Sea】
参考:
1)时间同步器
https://blog.csdn.net/u012700322/article/details/51784412
https://blog.csdn.net/fana8010/article/details/23880067(这篇文章是上一篇的原文)
2)基于策略的同步器
https://blog.csdn.net/muyiyushan/article/details/118418040(官网翻译,第7部分)
http://wiki.ros.org/message_filters#Policy-Based_Synchronizer_.5BROS_1.1.2B-.5D(官网,第7部分)
以下是针对参考1)中的第一篇内容:
bug1:3.1 连接
两句等价成一句,但为什么要分开成两句呢?因为只使用一句只能读取一个输入传给回调函数,所以需要使用两句,先用一句分开将多个数据封装好,然后再用一句将多个数据传给回调函数。
boost bind
bug2:4 时间一致器
The TimeSynchronizer filter synchronizes incoming channels by the timestamps contained in their headers
PointCloud2ROS点云数据消息结构:header里面有个stamp,比较不同数据源的stamp来进行时间同步。
以下是针对参考2)中的解释:
bug3:对“自己”代码的理解
typedef message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2, sensor_msgs::PointCloud2> SyncPolicyT;
//定义策略,message_filters::sync_policies::ApproximateTime策略使用一个基于时间戳的自适应算法匹配消息,匹配两个点云
void DualLidarCalib::start()
{
// 订阅器 sub and pub
parent_cloud_sub_ = new message_filters::Subscriber<sensor_msgs::PointCloud2>(nh_, parent_cloud_topic_, 10);
child_cloud_sub_ = new message_filters::Subscriber<sensor_msgs::PointCloud2>(nh_, child_cloud_topic_, 10);
//点云同步器 ApproximateTime takes a queue size as its constructor argument, hence MySyncPolicy(100)
cloud_synchronizer_ = new message_filters::Synchronizer<SyncPolicyT>(SyncPolicyT(100), *parent_cloud_sub_, *child_cloud_sub_);
//调用回调函数
cloud_synchronizer_->registerCallback(boost::bind(&DualLidarCalib::cloudCallback, this, _1, _2));
//registerCallback()输入为const boost::shared_ptr<M const>&
}
void DualLidarCalib::cloudCallback(const sensor_msgs::PointCloud2::ConstPtr& in_parent_cloud_msg,
const sensor_msgs::PointCloud2::ConstPtr& in_child_cloud_msg)
{
...
}
boost::bind()理解:
1)https://blog.csdn.net/holyjw/article/details/89883363(只用看“1. 通过functions和function pointers使用bind”)
2)https://blog.csdn.net/bj318318/article/details/116200356(只用看“1介绍”)
边栏推荐
- 綠竹生物沖刺港股:年期內虧損超5億 泰格醫藥與北京亦莊是股東
- 【Leetcode】14. Longest Common Prefix
- Dgraph: large scale dynamic graph dataset
- 详细介绍scrollIntoView()方法属性
- OpenHarmony如何启动远程设备的FA
- Fuyuan medicine is listed on the Shanghai Stock Exchange: the market value is 10.5 billion, and Hu Baifan is worth more than 4billion
- Does digicert SSL certificate support Chinese domain name application?
- Tech talk activity preview | building intelligent visual products based on Amazon kVs
- Deep learning image data automatic annotation [easy to understand]
- Linux Installation PostgreSQL + Patroni cluster problem
猜你喜欢
[leetcode] 14. Préfixe public le plus long
Use of openpose
剑指 Offer 22. 链表中倒数第k个节点
亚马逊云科技 Community Builder 申请窗口开启
Sword finger offer 27 Image of binary tree
Qwebengineview crash and alternatives
对接保时捷及3PL EDI案例
Configure ARP table entry restrictions and port security based on the interface (restrict users' private access to fool switches or illegal host access)
Linux Installation PostgreSQL + Patroni cluster problem
移动应用性能工具探索之路
随机推荐
Listing of chaozhuo Aviation Technology Co., Ltd.: raising 900million yuan, with a market value of more than 6billion yuan, becoming the first science and technology innovation board enterprise in Xia
你想要的宏基因组-微生物组知识全在这(2022.7)
什么是敏捷开发流程
綠竹生物沖刺港股:年期內虧損超5億 泰格醫藥與北京亦莊是股東
一年頂十年
Nexus简介及小白使用IDEA打包上传到Nexus3私服详细教程
13、Darknet YOLO3
【Leetcode】14. 最長公共前綴
Un an à dix ans
Error when uploading code to remote warehouse: remote origin already exists
[error record] error -32000 received from application: there are no running service protocol
chmod命令原理及用法详解[通俗易懂]
Connect Porsche and 3PL EDI cases
Detailed explanation of @accessories annotation of Lombok plug-in
QStyle实现自绘界面项目实战(二)
对接保时捷及3PL EDI案例
剑指 Offer 25. 合并两个排序的链表
Seven charts, learn to do valuable business analysis
Qwebengineview crash and alternatives
[leetcode] 14. Préfixe public le plus long