中国科技核心期刊

中文核心期刊

CSCD来源期刊

空间控制技术与应用 ›› 2020, Vol. 46 ›› Issue (3): 49-.doi: 10.3969/j.issn.1674-1579.2020.03.007

• 论文与报告 • 上一篇    下一篇

基于发布订阅的进程间通信设计与实现

  

  • 出版日期:2020-06-22 发布日期:2020-07-10

Implementation of InterProcess Communication

  • Online:2020-06-22 Published:2020-07-10

摘要: 航天器的每一种行为都需要多种信息的综合,这使得有效传递传感器数据成为关键问题.机器人操作系统(ROS)将基于主题的发布订阅作为内部的一种通信机制,解决消息的传递问题.由于ROS使用C++编写,无法直接应用在嵌入式平台中.本文利用C语言实现了ROS中基于发布订阅的通信机制,将信息的传递过程虚拟化成很多节点,每个节点可以选择自己感兴趣的话题成为发布端或者订阅端.发布端/订阅端并不需要知道其他节点的信息,实现功能解耦.目前,该方法在Windows平台上进行了单机和多机间的测试,通信效果良好,完成了进程间数据的传递.

关键词: 多进程, 进程间, 发布订阅, socket通信, 多机通信

Abstract:  Each behavior of spacecraft needs a variety of information synthesis to make a judgment. How to effectively transfer the data of multiple sensors has become a concern for many people. The robot operating system used a topic based method to solve this problem. However, ROS is written by C++ language and can’t be directly used in embedded platform. In this paper, we regard information transference as nodes, and use C language to implement the communication mechanism. Each node can choose the topic interest to become the publisher or subscriber. The publisher and subscriber do not know the information of other nodes to realize function decoupling. AT present, the method achieves perfect result between single and multimachine on windows platform.

中图分类号: 

  • TP3