当前位置:网站首页>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介绍”)
边栏推荐
- 智能垃圾桶(五)——点亮OLED
- LeetCode:1380. Lucky number in matrix -- simple
- 2、 Expansion of mock platform
- 人生的开始
- 剑指 Offer 26. 树的子结构
- 简单介绍BASE64Encoder的使用
- Qstype implementation of self drawing interface project practice (II)
- Atcoder beginer contest 169 (B, C, D unique decomposition, e mathematical analysis f (DP))
- 二、mock平台的扩展
- Win10系统使用pip安装juypter notebook过程记录(安装在系统盘以外的盘)
猜你喜欢

Sword finger offer 27 Image of binary tree

MOSFET器件手册关键参数解读

linux安装postgresql + patroni 集群问题

绿竹生物冲刺港股:年期内亏损超5亿 泰格医药与北京亦庄是股东

Jiuxian's IPO was terminated: Sequoia and Dongfang Fuhai were shareholders who had planned to raise 1billion yuan

Soul, a social meta universe platform, rushed to Hong Kong stocks: Tencent is a shareholder with an annual revenue of 1.28 billion

社交元宇宙平台Soul冲刺港股:年营收12.8亿 腾讯是股东

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

Amazon cloud technology community builder application window opens

使用知行之桥的API端口,提供资源供合作伙伴访问
随机推荐
IPtables中SNAT、DNAT和MASQUERADE的含义
What is agile development process
綠竹生物沖刺港股:年期內虧損超5億 泰格醫藥與北京亦莊是股東
Amazon cloud technology community builder application window opens
二、mock平台的扩展
In MySQL and Oracle, the boundary and range of between and precautions when querying the date
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
什么是敏捷开发流程
Timing / counter of 32 and 51 single chip microcomputer
Seven charts, learn to do valuable business analysis
How to transfer business data with BorgWarner through EDI?
【Leetcode】13. 罗马数字转整数
VMware install win10 image
一文看懂:数据指标体系的4大类型
剑指 Offer 21. 调整数组顺序使奇数位于偶数前面
Introduction to Hisilicon hi3798mv100 set top box chip [easy to understand]
The beginning of life
2020 "Lenovo Cup" National College programming online Invitational Competition and the third Shanghai University of technology programming competition (a sign in, B sign in, C sign in, D thinking +mst
Connect Porsche and 3PL EDI cases
福元医药上交所上市:市值105亿 胡柏藩身价超40亿