RMVL  2.4.0-dev
Robotic Manipulation and Vision Library
载入中...
搜索中...
未找到
rm::lpss::Node类 参考

轻量级发布订阅服务节点 更多...

#include <rmvl/lpss.hpp>

rm::lpss::Node 的协作图:

Public 成员函数

 Node (uint8_t domain_id=0)
 创建通用节点,默认域 ID 为 0
 ~Node ()
template<typename MsgType>
Publisher< MsgType > createPublisher (std::string_view topic) noexcept
 创建发布者
template<typename MsgType, typename SubscribeMsgCallback, typename = std::enable_if_t<std::is_invocable_v<SubscribeMsgCallback, const MsgType &>>>
Subscriber< MsgType > createSubscriber (std::string_view topic, SubscribeMsgCallback &&callback) noexcept
 创建订阅者
Guid guid () const noexcept
 获取节点唯一标识符

详细描述

轻量级发布订阅服务节点

  • 内置节点发现协议 RNDP (RMVL Node Discovery Protocol),用于节点间的自动发现与通信
  • 内置通信端点发现协议 REDP (RMVL Endpoint Discovery Protocol),用于发布者与订阅者间的自动发现与通信
    参见
    详情见 轻量发布订阅服务 —— LPSS

构造及析构函数说明

◆ Node()

rm::lpss::Node::Node ( uint8_t domain_id = 0)
explicit

创建通用节点,默认域 ID 为 0

参数
[in]domain_id域 ID

◆ ~Node()

rm::lpss::Node::~Node ( )

成员函数说明

◆ createPublisher()

template<typename MsgType>
Publisher< MsgType > rm::lpss::Node::createPublisher ( std::string_view topic)
noexcept

创建发布者

模板参数
MsgType消息类型
参数
[in]topic话题名称
返回
Publisher<MsgType> 发布者对象
函数调用图:

◆ createSubscriber()

template<typename MsgType, typename SubscribeMsgCallback, typename Enable>
Subscriber< MsgType > rm::lpss::Node::createSubscriber ( std::string_view topic,
SubscribeMsgCallback && callback )
noexcept

创建订阅者

模板参数
MsgType消息类型
SubscribeMsgCallback订阅回调函数类型
参数
[in]topic话题名称
[in]callback订阅回调函数
返回
Subscriber<MsgType> 订阅者对象
函数调用图:

◆ guid()

Guid rm::lpss::Node::guid ( ) const
inlinenoexcept

获取节点唯一标识符