update
This commit is contained in:
parent
28664a53bd
commit
7d5fe68319
@ -54,7 +54,7 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
file(READ "${CMAKE_SOURCE_DIR}/VERSION" AIMRT_VERSION)
|
||||
file(READ "${PROJECT_SOURCE_DIR}/VERSION" AIMRT_VERSION)
|
||||
string(STRIP "${AIMRT_VERSION}" AIMRT_VERSION)
|
||||
|
||||
set(INSTALL_CONFIG_NAME ${PROJECT_NAME}-config)
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
[English](CODE_OF_CONDUCT.md) | 中文
|
||||
|
||||
# 社区行为准则
|
||||
|
@ -41,4 +41,9 @@ if exist .\build\install (
|
||||
|
||||
cmake --build build --config Release --target install --parallel %NUMBER_OF_PROCESSORS%
|
||||
|
||||
if %errorlevel% neq 0 (
|
||||
echo build failed
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
endlocal
|
||||
|
@ -28,6 +28,7 @@ if(NOT nghttp2_POPULATED)
|
||||
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
set(BUILD_STATIC_LIBS ON)
|
||||
set(ENABLE_LIB_ONLY ON)
|
||||
|
||||
# Avoid name conflict
|
||||
set(nghttp2_CMAKE_FILE "${nghttp2_SOURCE_DIR}/CMakeLists.txt")
|
||||
|
@ -38,7 +38,7 @@ PROJECT_NAME = AimRT
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 0.8.0
|
||||
PROJECT_NUMBER = 0.9.0
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
@ -9,7 +9,7 @@
|
||||
project = 'AimRT'
|
||||
copyright = '2024, Agibot'
|
||||
author = 'Agibot'
|
||||
release = 'v0.8.0'
|
||||
release = 'v0.9.0'
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
||||
|
@ -6,7 +6,8 @@
|
||||
```{toctree}
|
||||
:maxdepth: 1
|
||||
|
||||
v0_8_0.md
|
||||
v0_9_0.md
|
||||
|
||||
```
|
||||
|
||||
|
||||
@ -17,4 +18,7 @@ v0_8_0.md
|
||||
|
||||
v0_6_0.md
|
||||
v0_7_0.md
|
||||
v0_8_0.md
|
||||
v0_8_1.md
|
||||
|
||||
```
|
||||
|
7
document/sphinx-cn/release_notes/v0_8_1.md
Normal file
7
document/sphinx-cn/release_notes/v0_8_1.md
Normal file
@ -0,0 +1,7 @@
|
||||
# v0.8.1
|
||||
|
||||
|
||||
**重要修改**:
|
||||
- 修复读取 VERSION 文件的错误
|
||||
- 修复 aimrt_py 打包过程中的错误
|
||||
- 修复 nghttp2 依赖问题
|
14
document/sphinx-cn/release_notes/v0_9_0.md
Normal file
14
document/sphinx-cn/release_notes/v0_9_0.md
Normal file
@ -0,0 +1,14 @@
|
||||
# v0.9.0
|
||||
|
||||
|
||||
**重要修改**:
|
||||
- 优化了 zenoh 插件:
|
||||
- 添加了 zenoh rpc 后端;
|
||||
- 现在可以传入 zenoh 原生配置;
|
||||
- mqtt 新增配置项以支持加密传输
|
||||
|
||||
|
||||
|
||||
**次要修改**:
|
||||
- 缩短了一些 examples 的文件路径长度;
|
||||
- 修复了一些轻微问题;
|
@ -8,9 +8,9 @@ AimRT 提供了以下 CPP 接口使用示例:
|
||||
- {{ '[executor]({}/src/examples/cpp/executor)'.format(code_site_root_path_url) }}
|
||||
- {{ '[logger]({}/src/examples/cpp/logger)'.format(code_site_root_path_url) }}
|
||||
- {{ '[parameter]({}/src/examples/cpp/parameter)'.format(code_site_root_path_url) }}
|
||||
- {{ '[protobuf_channel]({}/src/examples/cpp/protobuf_channel)'.format(code_site_root_path_url) }}
|
||||
- {{ '[protobuf_rpc]({}/src/examples/cpp/protobuf_rpc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[ros2_channel]({}/src/examples/cpp/ros2_channel)'.format(code_site_root_path_url) }}
|
||||
- {{ '[pb_chn]({}/src/examples/cpp/pb_chn)'.format(code_site_root_path_url) }}
|
||||
- {{ '[pb_rpc]({}/src/examples/cpp/pb_rpc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[ros2_chn]({}/src/examples/cpp/ros2_chn)'.format(code_site_root_path_url) }}
|
||||
- {{ '[ros2_rpc]({}/src/examples/cpp/ros2_rpc)'.format(code_site_root_path_url) }}
|
||||
|
||||
关于这些示例的说明:
|
||||
|
@ -5,8 +5,8 @@ AimRT 提供了以下 Python 接口使用示例:
|
||||
|
||||
- {{ '[python examples]({}/src/examples/py)'.format(code_site_root_path_url) }}
|
||||
- {{ '[helloworld]({}/src/examples/py/helloworld)'.format(code_site_root_path_url) }}
|
||||
- {{ '[protobuf_channel]({}/src/examples/py/protobuf_channel)'.format(code_site_root_path_url) }}
|
||||
- {{ '[protobuf_rpc]({}/src/examples/py/protobuf_rpc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[pb_chn]({}/src/examples/py/pb_chn)'.format(code_site_root_path_url) }}
|
||||
- {{ '[pb_rpc]({}/src/examples/py/pb_rpc)'.format(code_site_root_path_url) }}
|
||||
|
||||
关于这些示例的说明:
|
||||
- 每个示例都有自己独立的 readme 文档,详情请点击示例链接进入后查看;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
## 快速开始
|
||||
|
||||
通过此部分文档,您可以了解到如何引用、安装 AimRT,并通过创建一个`Hello World`程序来快速体验AimRT。
|
||||
通过此部分文档,您可以了解到如何引用、安装 AimRT,并通过创建一个`Hello World`程序来快速体验 AimRT。
|
||||
|
||||
```{toctree}
|
||||
:maxdepth: 1
|
||||
@ -16,7 +16,7 @@ quick_start/helloworld_py.md
|
||||
|
||||
## 概念
|
||||
|
||||
通过此部分文档,您可以了解到AimRT中的一些核心概念和设计思想。
|
||||
通过此部分文档,您可以了解到 AimRT 中的一些核心概念和设计思想。
|
||||
|
||||
|
||||
```{toctree}
|
||||
|
@ -9,12 +9,12 @@
|
||||
- {{ '[aimrt_module_ros2_interface/channel/ros2_channel.h]({}/src/interface/aimrt_module_ros2_interface/channel/ros2_channel.h)'.format(code_site_root_path_url) }}
|
||||
|
||||
参考示例:
|
||||
- {{ '[protobuf_channel]({}/src/examples/cpp/protobuf_channel)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_publisher_module.cc]({}/src/examples/cpp/protobuf_channel/module/normal_publisher_module/normal_publisher_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_subscriber_module.cc]({}/src/examples/cpp/protobuf_channel/module/normal_subscriber_module/normal_subscriber_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[ros2_channel]({}/src/examples/cpp/ros2_channel)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_publisher_module.cc]({}/src/examples/cpp/ros2_channel/module/normal_publisher_module/normal_publisher_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_subscriber_module.cc]({}/src/examples/cpp/ros2_channel/module/normal_subscriber_module/normal_subscriber_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[pb_chn]({}/src/examples/cpp/pb_chn)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_publisher_module.cc]({}/src/examples/cpp/pb_chn/module/normal_publisher_module/normal_publisher_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_subscriber_module.cc]({}/src/examples/cpp/pb_chn/module/normal_subscriber_module/normal_subscriber_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[ros2_chn]({}/src/examples/cpp/ros2_chn)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_publisher_module.cc]({}/src/examples/cpp/ros2_chn/module/normal_publisher_module/normal_publisher_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_subscriber_module.cc]({}/src/examples/cpp/ros2_chn/module/normal_subscriber_module/normal_subscriber_module.cc)'.format(code_site_root_path_url) }}
|
||||
|
||||
## 协议
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
- {{ '[aimrt_module_cpp_interface/rpc/rpc_co_filter.h]({}/src/interface/aimrt_module_cpp_interface/rpc/rpc_co_filter.h)'.format(code_site_root_path_url) }}
|
||||
|
||||
参考示例:
|
||||
- {{ '[protobuf_rpc]({}/src/examples/cpp/protobuf_rpc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[pb_rpc]({}/src/examples/cpp/pb_rpc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[ros2_rpc]({}/src/examples/cpp/ros2_rpc)'.format(code_site_root_path_url) }}
|
||||
|
||||
|
||||
@ -334,7 +334,7 @@ void HelloWorldModule::Foo() {
|
||||
|
||||
|
||||
更多示例请参考:
|
||||
- {{ '[protobuf_rpc_sync_client]({}/src/examples/cpp/protobuf_rpc/module/normal_rpc_sync_client_module/normal_rpc_sync_client_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[pb_rpc_sync_client]({}/src/examples/cpp/pb_rpc/module/normal_rpc_sync_client_module/normal_rpc_sync_client_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[ros2_rpc_sync_client]({}/src/examples/cpp/ros2_rpc/module/normal_rpc_sync_client_module/normal_rpc_sync_client_module.cc)'.format(code_site_root_path_url) }}
|
||||
|
||||
|
||||
@ -398,7 +398,7 @@ void HelloWorldModule::Foo() {
|
||||
|
||||
|
||||
更多示例请参考:
|
||||
- {{ '[protobuf_rpc_async_client]({}/src/examples/cpp/protobuf_rpc/module/normal_rpc_async_client_module/normal_rpc_async_client_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[pb_rpc_async_client]({}/src/examples/cpp/pb_rpc/module/normal_rpc_async_client_module/normal_rpc_async_client_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[ros2_rpc_async_client]({}/src/examples/cpp/ros2_rpc/module/normal_rpc_async_client_module/normal_rpc_async_client_module.cc)'.format(code_site_root_path_url) }}
|
||||
|
||||
|
||||
@ -465,7 +465,7 @@ void HelloWorldModule::Foo() {
|
||||
|
||||
|
||||
更多示例请参考:
|
||||
- {{ '[protobuf_rpc_future_client]({}/src/examples/cpp/protobuf_rpc/module/normal_rpc_future_client_module/normal_rpc_future_client_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[pb_rpc_future_client]({}/src/examples/cpp/pb_rpc/module/normal_rpc_future_client_module/normal_rpc_future_client_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[ros2_rpc_future_client]({}/src/examples/cpp/ros2_rpc/module/normal_rpc_future_client_module/normal_rpc_future_client_module.cc)'.format(code_site_root_path_url) }}
|
||||
|
||||
|
||||
@ -526,7 +526,7 @@ co::Task<void> HelloWorldModule::Foo() {
|
||||
|
||||
|
||||
更多示例请参考:
|
||||
- {{ '[protobuf_rpc_co_client]({}/src/examples/cpp/protobuf_rpc/module/normal_rpc_co_client_module/normal_rpc_co_client_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[pb_rpc_co_client]({}/src/examples/cpp/pb_rpc/module/normal_rpc_co_client_module/normal_rpc_co_client_module.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[ros2_rpc_co_client]({}/src/examples/cpp/ros2_rpc/module/normal_rpc_co_client_module/normal_rpc_co_client_module.cc)'.format(code_site_root_path_url) }}
|
||||
|
||||
|
||||
@ -609,7 +609,7 @@ bool HelloWorldModule::Initialize(aimrt::CoreRef core) {
|
||||
|
||||
|
||||
更多示例请参考:
|
||||
- {{ '[protobuf_rpc_sync_service]({}/src/examples/cpp/protobuf_rpc/module/normal_rpc_sync_server_module/service.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[pb_rpc_sync_service]({}/src/examples/cpp/pb_rpc/module/normal_rpc_sync_server_module/service.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[ros2_rpc_sync_service]({}/src/examples/cpp/ros2_rpc/module/normal_rpc_sync_server_module/service.cc)'.format(code_site_root_path_url) }}
|
||||
|
||||
|
||||
@ -658,7 +658,7 @@ bool HelloWorldModule::Initialize(aimrt::CoreRef core) {
|
||||
|
||||
|
||||
更多示例请参考:
|
||||
- {{ '[protobuf_rpc_async_service]({}/src/examples/cpp/protobuf_rpc/module/normal_rpc_async_server_module/service.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[pb_rpc_async_service]({}/src/examples/cpp/pb_rpc/module/normal_rpc_async_server_module/service.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[ros2_rpc_async_service]({}/src/examples/cpp/ros2_rpc/module/normal_rpc_async_server_module/service.cc)'.format(code_site_root_path_url) }}
|
||||
|
||||
|
||||
@ -704,7 +704,7 @@ bool HelloWorldModule::Initialize(aimrt::CoreRef core) {
|
||||
```
|
||||
|
||||
更多示例请参考:
|
||||
- {{ '[protobuf_rpc_co_service]({}/src/examples/cpp/protobuf_rpc/module/normal_rpc_co_server_module/service.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[pb_rpc_co_service]({}/src/examples/cpp/pb_rpc/module/normal_rpc_co_server_module/service.cc)'.format(code_site_root_path_url) }}
|
||||
- {{ '[ros2_rpc_co_service]({}/src/examples/cpp/ros2_rpc/module/normal_rpc_co_server_module/service.cc)'.format(code_site_root_path_url) }}
|
||||
|
||||
## Context
|
||||
|
@ -11,8 +11,8 @@
|
||||
- {{ '[helloworld]({}/src/examples/cpp/helloworld)'.format(code_site_root_path_url) }}
|
||||
- {{ '[helloworld_app_registration_mode]({}/src/examples/cpp/helloworld/app/helloworld_app_registration_mode)'.format(code_site_root_path_url) }}
|
||||
- {{ '[helloworld_app]({}/src/examples/cpp/helloworld/app/helloworld_app)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_publisher_app]({}/src/examples/cpp/protobuf_channel/app/normal_publisher_app)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_subscriber_app]({}/src/examples/cpp/protobuf_channel/app/normal_subscriber_app)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_publisher_app]({}/src/examples/cpp/pb_chn/app/normal_publisher_app)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_subscriber_app]({}/src/examples/cpp/pb_chn/app/normal_subscriber_app)'.format(code_site_root_path_url) }}
|
||||
|
||||
|
||||
## 简介
|
||||
@ -229,8 +229,8 @@ int32_t main(int32_t argc, char** argv) {
|
||||
|
||||
更多示例请参考:
|
||||
- {{ '[helloworld_app]({}/src/examples/cpp/helloworld/app/helloworld_app)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_publisher_app]({}/src/examples/cpp/protobuf_channel/app/normal_publisher_app)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_subscriber_app]({}/src/examples/cpp/protobuf_channel/app/normal_subscriber_app)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_publisher_app]({}/src/examples/cpp/pb_chn/app/normal_publisher_app)'.format(code_site_root_path_url) }}
|
||||
- {{ '[normal_subscriber_app]({}/src/examples/cpp/pb_chn/app/normal_subscriber_app)'.format(code_site_root_path_url) }}
|
||||
|
||||
|
||||
## Pkg 模式
|
||||
|
@ -4,8 +4,8 @@
|
||||
## 相关链接
|
||||
|
||||
参考示例:
|
||||
- {{ '[examples_py_protobuf_channel_publisher_app.py]({}/src/examples/py/protobuf_channel/examples_py_protobuf_channel_publisher_app.py)'.format(code_site_root_path_url) }}
|
||||
- {{ '[examples_py_protobuf_channel_subscriber_app.py]({}/src/examples/py/protobuf_channel/examples_py_protobuf_channel_subscriber_app.py)'.format(code_site_root_path_url) }}
|
||||
- {{ '[examples_py_pb_chn_publisher_app.py]({}/src/examples/py/pb_chn/examples_py_pb_chn_publisher_app.py)'.format(code_site_root_path_url) }}
|
||||
- {{ '[examples_py_pb_chn_subscriber_app.py]({}/src/examples/py/pb_chn/examples_py_pb_chn_subscriber_app.py)'.format(code_site_root_path_url) }}
|
||||
|
||||
|
||||
## protobuf 协议
|
||||
|
@ -4,8 +4,8 @@
|
||||
## 相关链接
|
||||
|
||||
参考示例:
|
||||
- {{ '[examples_py_protobuf_rpc_client_app.py]({}/src/examples/py/protobuf_rpc/examples_py_protobuf_rpc_client_app.py)'.format(code_site_root_path_url) }}
|
||||
- {{ '[examples_py_protobuf_rpc_server_app.py]({}/src/examples/py/protobuf_rpc/examples_py_protobuf_rpc_server_app.py)'.format(code_site_root_path_url) }}
|
||||
- {{ '[examples_py_pb_rpc_client_app.py]({}/src/examples/py/pb_rpc/examples_py_pb_rpc_client_app.py)'.format(code_site_root_path_url) }}
|
||||
- {{ '[examples_py_pb_rpc_server_app.py]({}/src/examples/py/pb_rpc/examples_py_pb_rpc_server_app.py)'.format(code_site_root_path_url) }}
|
||||
|
||||
## protobuf 协议
|
||||
|
||||
|
@ -17,18 +17,19 @@
|
||||
|
||||
插件的配置项如下:
|
||||
|
||||
| 节点 | 类型 | 是否可选| 默认值 | 作用 |
|
||||
| ---- | ---- | ---- | ---- | ---- |
|
||||
| broker_addr | string | 必选 | "" | mqtt broker 的地址 |
|
||||
| client_id | string | 必选 | "" | 本节点的 mqtt client id |
|
||||
| max_pkg_size_k | int | 可选 | 1024 | 最大包尺寸,单位:KB |
|
||||
| 节点 | 类型 | 是否可选 | 默认值 | 作用 |
|
||||
| -------------- | ------ | -------- | ------ | ----------------------- |
|
||||
| broker_addr | string | 必选 | "" | mqtt broker 的地址 |
|
||||
| client_id | string | 必选 | "" | 本节点的 mqtt client id |
|
||||
| max_pkg_size_k | int | 可选 | 1024 | 最大包尺寸,单位:KB |
|
||||
| truststore | string | 可选 | "" | broker的CA证书路径 |
|
||||
|
||||
|
||||
关于**mqtt_plugin**的配置,使用注意点如下:
|
||||
- `broker_addr`表示 mqtt broker 的地址,使用者必须保证有 mqtt 的 broker 运行在该地址,否则启动会失败。
|
||||
- `client_id`表示本节点连接 mqtt broker 时的 client id。
|
||||
- `max_pkg_size_k`表示传输数据时的最大包尺寸,默认 1 MB。注意,必须 broker 也要支持该尺寸才行。
|
||||
|
||||
- `truststore`表示 broker 的 CA 证书路径,例如`/etc/emqx/certs/cacert.pem` 。当`broker_addr`的协议被配置为`ssl`或者`mqtts`时,该选项生效,用于指定 CA 证书路径,否则自动忽略该选项。
|
||||
|
||||
**mqtt_plugin**插件基于[paho.mqtt.c](https://github.com/eclipse/paho.mqtt.c)封装,在使用时,Channel 订阅回调、RPC Server 处理方法、RPC Client 返回时,使用的都是**paho.mqtt.c**提供的线程,当使用者在回调中阻塞了线程时,有可能导致无法继续接收/发送消息。正如 Module 接口文档中所述,一般来说,如果回调中的任务非常轻量,那就可以直接在回调里处理;但如果回调中的任务比较重,那最好调度到其他专门执行任务的执行器里处理。
|
||||
|
||||
@ -53,17 +54,17 @@ aimrt:
|
||||
`mqtt`类型的 RPC 后端是**mqtt_plugin**中提供的一种 RPC 后端,用于通过 mqtt 的方式来调用和处理 AimRT RPC 请求。其所有的配置项如下:
|
||||
|
||||
|
||||
| 节点 | 类型 | 是否可选 | 默认值 | 作用 |
|
||||
|------------------------------------|---------|-------|------|----------------------------------------------|
|
||||
| timeout_executor | string | 可选 | "" | Client 端发起 RPC 超时情况下的执行器 |
|
||||
| clients_options | array | 可选 | [] | Client 端发起 RPC 请求时的规则 |
|
||||
| clients_options[i].func_name | string | 必选 | "" | RPC Func 名称,支持正则表达式 |
|
||||
| clients_options[i].server_mqtt_id | string | 可选 | "" | RPC Func 发起调用时请求的 mqtt 服务端 id |
|
||||
| clients_options[i].qos | int | 可选 | 2 | RPC Client 端 mqtt qos,取值范围:0/1/2 |
|
||||
| servers_options | array | 可选 | [] | 服务端处理 RPC 请求时的规则 |
|
||||
| servers_options[i].func_name | string | 必选 | "" | RPC Func 名称,支持正则表达式 |
|
||||
| servers_options[i].allow_share | bool | 可选 | true | 该 RPC 服务是否允许共享订阅,不允许的话该服务只能通过指定 server id 进行调用 |
|
||||
| servers_options[i].qos | int | 可选 | 2 | RPC Server 端 mqtt qos,取值范围:0/1/2 |
|
||||
| 节点 | 类型 | 是否可选 | 默认值 | 作用 |
|
||||
| --------------------------------- | ------ | -------- | ------ | ---------------------------------------------------------------------------- |
|
||||
| timeout_executor | string | 可选 | "" | Client 端发起 RPC 超时情况下的执行器 |
|
||||
| clients_options | array | 可选 | [] | Client 端发起 RPC 请求时的规则 |
|
||||
| clients_options[i].func_name | string | 必选 | "" | RPC Func 名称,支持正则表达式 |
|
||||
| clients_options[i].server_mqtt_id | string | 可选 | "" | RPC Func 发起调用时请求的 mqtt 服务端 id |
|
||||
| clients_options[i].qos | int | 可选 | 2 | RPC Client 端 mqtt qos,取值范围:0/1/2 |
|
||||
| servers_options | array | 可选 | [] | 服务端处理 RPC 请求时的规则 |
|
||||
| servers_options[i].func_name | string | 必选 | "" | RPC Func 名称,支持正则表达式 |
|
||||
| servers_options[i].allow_share | bool | 可选 | true | 该 RPC 服务是否允许共享订阅,不允许的话该服务只能通过指定 server id 进行调用 |
|
||||
| servers_options[i].qos | int | 可选 | 2 | RPC Server 端 mqtt qos,取值范围:0/1/2 |
|
||||
|
||||
以下是一个简单的客户端的示例:
|
||||
```yaml
|
||||
@ -192,14 +193,14 @@ Server -> Client 的 Mqtt 数据包格式整体分 4 段:
|
||||
`mqtt`类型的 Channel 后端是**mqtt_plugin**中提供的一种 Channel 后端,用于通过 mqtt 的方式来发布和订阅消息。其所有的配置项如下:
|
||||
|
||||
|
||||
| 节点 | 类型 | 是否可选| 默认值 | 作用 |
|
||||
| ---- | ---- | ---- | ---- | ---- |
|
||||
| pub_topics_options | array | 可选 | [] | 发布 Topic 时的规则 |
|
||||
| pub_topics_options[i].topic_name | string | 必选 | "" | Topic 名称,支持正则表达式 |
|
||||
| pub_topics_options[i].qos | int | 必选 | 2 | Publish 端 mqtt qos,取值范围:0/1/2 |
|
||||
| sub_topics_options | array | 可选 | [] | 发布 Topic 时的规则 |
|
||||
| sub_topics_options[i].topic_name | string | 必选 | "" | Topic 名称,支持正则表达式 |
|
||||
| sub_topics_options[i].qos | int | 必选 | 2 | Subscribe 端 mqtt qos,取值范围:0/1/2 |
|
||||
| 节点 | 类型 | 是否可选 | 默认值 | 作用 |
|
||||
| -------------------------------- | ------ | -------- | ------ | -------------------------------------- |
|
||||
| pub_topics_options | array | 可选 | [] | 发布 Topic 时的规则 |
|
||||
| pub_topics_options[i].topic_name | string | 必选 | "" | Topic 名称,支持正则表达式 |
|
||||
| pub_topics_options[i].qos | int | 必选 | 2 | Publish 端 mqtt qos,取值范围:0/1/2 |
|
||||
| sub_topics_options | array | 可选 | [] | 发布 Topic 时的规则 |
|
||||
| sub_topics_options[i].topic_name | string | 必选 | "" | Topic 名称,支持正则表达式 |
|
||||
| sub_topics_options[i].qos | int | 必选 | 2 | Subscribe 端 mqtt qos,取值范围:0/1/2 |
|
||||
|
||||
|
||||
以下是一个简单的发布端的示例:
|
||||
|
@ -9,15 +9,47 @@
|
||||
|
||||
## 插件概述
|
||||
|
||||
**zenoh_plugin**是一个基于[zenoh.c](https://github.com/eclipse-zenoh/zenoh-c)实现的轻量级的、高效的、实时的数据传输插件,它旨在为分布式系统提供低延迟、高吞吐量的数据传输和处理能力。此插件提供了以下组件:
|
||||
- `zenoh`类型 Channel 后端
|
||||
**zenoh_plugin** 是一个轻量级的、高效的、实时的数据传输插件,它旨在为分布式系统提供低延迟、高吞吐量的数据传输和处理能力。当需要以下业务场景的时候,zenoh 插件将非常合适:
|
||||
- `服务发现`机制的通信系统;
|
||||
- 灵活的网络拓扑结构;
|
||||
- 低延迟、高吞吐量的网络通信和数据传输;
|
||||
|
||||
此插件为 AimRT 提供以下组件:
|
||||
- `zenoh` 类型 Rpc 后端
|
||||
- `zenoh` 类型 Channel 后端
|
||||
|
||||
|
||||
在当前版本,本插件没有插件级的配置。由于 zenoh 自带的服务发现机制,用户不必手动配置对端地址。
|
||||
|
||||
插件的配置项如下:
|
||||
|
||||
| 节点 | 类型 | 是否可选 | 默认值 | 作用 |
|
||||
| :-------------: | :----: | :------: | :----: | :-------------------------: |
|
||||
| native_cfg_path | string | 可选 | "" | 使用zenoh提供的原生配置文件 |
|
||||
| limit_domain | string | 可选 | "" | 对插件的通信域进行限制 |
|
||||
|
||||
关于**zenoh_plugin**的配置,使用注意点如下:
|
||||
- `native_cfg_path` 表示 zenoh 提供的原生配置文件的路径,可以通过配置该文件来灵活配置 zenoh 的网络结构。如果不填写则默认使用 zenoh 官方提供的默认配置,具体配置内容请参考 zenoh 官方关于[configuration](https://zenoh.io/docs/manual/configuration/)的说明,您也可以直接修改 {{ '[zenoh_native_config.json5]({}/src/examples/plugins/zenoh_plugin/install/linux/bin/cfg/zenoh_native_config.json5)'.format(code_site_root_path_url) }}文件来自定义配置,这里列举几个常用的配置项:
|
||||
|
||||
| 配置项 | 作用 | zenoh_native_config中的配置值 |
|
||||
| :---------------------------: | :-------------------------------------------------------------------: | :---------------------------: |
|
||||
| scouting.scouting. enabled | 是否开启多播,这将允许多个 zenoh 节点自动发现彼此 | true |
|
||||
| scouting.scouting. address | 配置多播地址 | 224.0.0.224:7446 |
|
||||
| scouting.scouting. interface | 配置所用的网络接口 | auto |
|
||||
| listen.endpoints | 需要主动监听的地址 | - |
|
||||
| transport.unicast.lowlatency | 是否启动最低时延,若开启将有助于提升传输速率,注意其不能与qos同时开启 | true |
|
||||
| transport.unicast.qos.enabled | 是否启动服务质量,注意其不能与lowlatency同时开启 | false |
|
||||
|
||||
|
||||
**请注意**,该插件在编译过程依赖于[Rust](https://www.rust-lang.org/),请确保运行环境中存在 Rust 编译器,否则该插件将不会编译。
|
||||
- limit_domain 表示插件的通信域,其兼容 zenoh 强大的Key & Key Expression。如果不填写则使用插件的默认的通信域(即消息的 topic ),只有相`匹配`的域才能进行通信,具体的书写格式如下:
|
||||
|
||||
```shell
|
||||
|
||||
#请不要以"/"开始,中间以"/"分隔,结尾不要带"/" (与zenoh官方书写方式一致),如:
|
||||
|
||||
xxx/yyy/zzz
|
||||
|
||||
```
|
||||
最简单的一种匹配就是二者域相同,除此之外,zenoh 官方提供了更灵活的匹配机制,具体可查阅 zenoh 官方关于[key](https://zenoh.io/docs/manual/abstractions/)的解释。
|
||||
|
||||
以下是一个简单的示例:
|
||||
|
||||
@ -27,12 +59,123 @@ aimrt:
|
||||
plugins:
|
||||
- name: zenoh_plugin
|
||||
path: ./libaimrt_zenoh_plugin.so
|
||||
options:
|
||||
native_cfg_path: ./cfg/zenoh_native_config.json5
|
||||
```
|
||||
|
||||
|
||||
## zenoh 类型 Rpc 后端
|
||||
`zenoh`类型的 Rpc后端是**zenoh_plugin**中提供的一种 Rpc 后端,主要用来构建请求-响应模型。其所有的配置项如下:
|
||||
|
||||
| 节点 | 类型 | 是否可选 | 默认值 | 作用 |
|
||||
| ---------------- | ------ | -------- | ------ | ---------------------------------- |
|
||||
| timeout_executor | string | 可选 | "" | Client 端发起 RPC 超时情况下的执行器 |
|
||||
|
||||
以下是一个简单的客户端的示例:
|
||||
|
||||
```yaml
|
||||
aimrt:
|
||||
plugin:
|
||||
plugins:
|
||||
- name: zenoh_plugin
|
||||
path: ./libaimrt_zenoh_plugin.so
|
||||
options:
|
||||
native_cfg_path: ./cfg/zenoh_native_config.json5
|
||||
executor:
|
||||
executors:
|
||||
- name: timeout_handle
|
||||
type: time_wheel
|
||||
options:
|
||||
bind_executor: work_thread_pool
|
||||
rpc:
|
||||
backends:
|
||||
- type: zenoh
|
||||
options:
|
||||
timeout_executor: timeout_handle
|
||||
clients_options:
|
||||
- func_name: "(.*)"
|
||||
enable_backends: [zenoh]
|
||||
|
||||
```
|
||||
|
||||
以下是一个简单的服务端的示例:
|
||||
|
||||
```yaml
|
||||
|
||||
aimrt:
|
||||
plugin:
|
||||
plugins:
|
||||
- name: zenoh_plugin
|
||||
path: ./libaimrt_zenoh_plugin.so
|
||||
options:
|
||||
native_cfg_path: ./cfg/zenoh_native_config.json5
|
||||
rpc:
|
||||
backends:
|
||||
- type: zenoh
|
||||
servers_options:
|
||||
- func_name: "(.*)"
|
||||
enable_backends: [zenoh]
|
||||
|
||||
```
|
||||
以上示例中,Client 端和 Server 端都采用服务发现机制,即在统一网络中的两个端点可自动发现彼此并建立连接。
|
||||
|
||||
在整个 RPC 过程中,底层使用的 Zenoh Topic 名称格式如下:
|
||||
- Server 端
|
||||
- 订阅 Req 使用的 topic:
|
||||
- `req/aimrt_rpc/${func_name}/${limit_domain}>`
|
||||
- 发布 Rsp 使用的 topic:`rsp/aimrt_rpc/${func_name}/${limit_domain}`
|
||||
- Client 端
|
||||
- 发布 Req 使用的 topic:
|
||||
- `req/aimrt_rpc/${func_name}/ ${limit_domain}`
|
||||
- 订阅 Rsp 使用的 topic:`rsp_/imrt_rpc/${func_name}/${limit_domain}`
|
||||
|
||||
`${func_name}`是 url 编码后的 AimRT RPC 方法名称。
|
||||
|
||||
|
||||
例如,对于一个 client 的请求来说,若 func 名称为`/aimrt.protocols.example.ExampleService/GetBarData`, limit_domain 没有配置,则`最终的topic名称为`:req/aimrt_rpc/%2Faimrt.protocols.example.ExampleService%2FGetBarData`。
|
||||
|
||||
|
||||
|
||||
Client -> Server 的 Zenoh 数据包格式整体分 5 段:
|
||||
- 序列化类型,一般是`pb`或`json`
|
||||
- client 端想要 server 端回复 rsp 的 zenoh topic 名称。client 端自己需要订阅这个 zenoh topic
|
||||
- msg id,4 字节,server 端会原封不动的封装到 rsp 包里,供 client 端定位 rsp 对应哪个 req
|
||||
- context 区
|
||||
- context 数量,1 字节,最大 255 个 context
|
||||
- context_1 key, 2 字节长度 + 数据区
|
||||
- context_2 key, 2 字节长度 + 数据区
|
||||
- ...
|
||||
- msg 数据
|
||||
|
||||
```
|
||||
| n(0~255) [1 byte] | content type [n byte]
|
||||
| m(0~255) [1 byte] | rsp topic name [m byte]
|
||||
| msg id [4 byte]
|
||||
| context num [1 byte]
|
||||
| context_1 key size [2 byte] | context_1 key data [key_1_size byte]
|
||||
| context_1 val size [2 byte] | context_1 val data [val_1_size byte]
|
||||
| context_2 key size [2 byte] | context_2 key data [key_2_size byte]
|
||||
| context_2 val size [2 byte] | context_2 val data [val_2_size byte]
|
||||
| ...
|
||||
| msg data [remaining byte]
|
||||
```
|
||||
|
||||
Server -> Client 的 Zenoh 数据包格式整体分 4 段:
|
||||
- 序列化类型,一般是`pb`或`json`
|
||||
- msg id,4 字节,req 中的 msg id
|
||||
- status code,4 字节,框架错误码,如果这个部分不为零,则代表服务端发生了错误,数据段将没有内容
|
||||
- msg 数据
|
||||
|
||||
```
|
||||
| n(0~255) [1 byte] | content type [n byte]
|
||||
| msg id [4 byte]
|
||||
| status code [4 byte]
|
||||
| msg data [remaining byte]
|
||||
```
|
||||
|
||||
## zenoh 类型 Channel 后端
|
||||
|
||||
`zenoh`类型的 Channel 后端是**zenoh_plugin**中提供的一种 Channel 后端,主要用来构建发布和订阅模型,当前版本暂时没有可配置项。
|
||||
|
||||
`zenoh`类型的 Channel 后端是**zenoh_plugin**中提供的一种Channel后端,主要用来构建发布和订阅模型。
|
||||
|
||||
以下是一个简单的发布端的示例:
|
||||
```yaml
|
||||
@ -41,6 +184,8 @@ aimrt:
|
||||
plugins:
|
||||
- name: zenoh_plugin
|
||||
path: ./libaimrt_zenoh_plugin.so
|
||||
options:
|
||||
native_cfg_path: ./cfg/zenoh_native_config.json5
|
||||
channel:
|
||||
backends:
|
||||
- type: zenoh
|
||||
@ -57,6 +202,8 @@ aimrt:
|
||||
plugins:
|
||||
- name: zenoh_plugin
|
||||
path: ./libaimrt_zenoh_plugin.so
|
||||
options:
|
||||
native_cfg_path: ./cfg/zenoh_native_config.json5
|
||||
channel:
|
||||
backends:
|
||||
- type: zenoh
|
||||
@ -65,11 +212,11 @@ channel:
|
||||
enable_backends: [zenoh]
|
||||
```
|
||||
|
||||
以上示例中都使用 zeonh 的服务发现机制,即在统一网络中的两个端点可自动发现彼此并建立连接,因此在配置过程中不需要用户手动输入任何参数,降低使用复杂度。
|
||||
以上示例中都使用 zeonh 的服务发现机制,即在统一网络中的两个端点可自动发现彼此并建立连接。
|
||||
|
||||
在这个过程中,底层使用的 Zenoh Topic 名称格式为:`channel/${topic_name}/${message_type}`。其中,`${topic_name}`为 AimRT 的 Topic 名称,`${message_type}`为 url 编码后的 AimRT 消息名称。这个 Topic 被设置成为 Zenoh 的键表达式(Keyxpr),这是 Zenoh 的提供的资源标识符,只有键表达式匹配的订阅者和发布者才能够进行通信。
|
||||
在这个过程中,底层使用的 Topic 名称格式为:`channel/${topic_name}/${message_type}${limit_domain}`。其中,`${topic_name}`为 AimRT 的 Topic 名称,`${message_type}`为 url 编码后的 AimRT 消息名称, `${limit_domain}`为插件的限制域。这个 Topic 被设置成为 Zenoh 最终的键表达式(Keyxpr),这是 Zenoh 的提供的资源标识符,只有键表达式匹配的订阅者和发布者才能够进行通信。
|
||||
|
||||
例如,AimRT Topic 名称为`test_topic`,消息类型为`pb:aimrt.protocols.example.ExampleEventMsg`,则最终 Zenoh 的 topic 名称为:`channel/test_topic/pb%3Aaimrt.protocols.example.ExampleEventMsg`。如果订阅者和发布者的 Topic 均为`channel/test_topic/pb%3Aaimrt.protocols.example.ExampleEventMsg`,则二者可以进行通信。
|
||||
例如,AimRT Topic 名称为`test_topic`,消息类型为`pb:aimrt.protocols.example.ExampleEventMsg`,限制域为`room1/A2`,则最终 Zenoh 的 topic 名称为:`channel/test_topic/pb%3Aaimrt.protocols.example.ExampleEventMsgroom1/A2`。如果订阅者和发布者的 Topic 均为`channel/test_topic/pb%3Aaimrt.protocols.example.ExampleEventMsgroom1/A2`,则二者可以进行通信。
|
||||
|
||||
在AimRT发布端发布数据到订阅端这个链路上,Zenoh 数据包格式整体分 3 段:
|
||||
- 序列化类型,一般是`pb`或`json`
|
||||
|
@ -70,7 +70,8 @@ add_subdirectory(src)
|
||||
```
|
||||
|
||||
### File 2 : /cmake/GetAimRT.cmake
|
||||
此文件用于获取 AimRT。
|
||||
此文件用于获取 AimRT,注意需要将`GIT_TAG`版本改为你想引用的版本:
|
||||
|
||||
```cmake
|
||||
include(FetchContent)
|
||||
|
||||
|
@ -28,12 +28,15 @@ AimRT 兼容 linux、windows 等主流操作系统,编译器需要能够支持
|
||||
- 在编译构建时,AimRT 可能通过源码方式引用一些第三方依赖,如果出现网络问题,可以参考[CMake](../concepts/cmake.md)文档进行处理。
|
||||
- 在打开某些选项、编译某些插件时,AimRT 可能需要额外引用一些第三方依赖,细节请参考对应插件的文档、CMake 代码文件或构建时的提示。以下是一些示例:
|
||||
- 如果要编译 ROS2 相关接口/插件,AimRT 会通过`find_package`的方式在本地寻找 rclcpp 等依赖,请确保本地安装有[ROS2 Humble](https://docs.ros.org/en/humble/)。
|
||||
- 如果要构建 Python 接口、cli 工具等,AimRT 会通过`find_package`的方式在本地寻找 Python 依赖,请确保本地安装有 Python3。
|
||||
- 如果要构建 Python 接口、cli 工具等,AimRT 会通过`find_package`的方式在本地寻找 Python 依赖,请确保本地安装有 Python3 及相关的 python 包,缺失相应包在 CMake 生成过程中会告警不会编译相应内容。
|
||||
- Zenoh 插件需要本地安装有 rust 环境,在 Ubuntu 上可通过 `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` 进行安装,没有 rust 环境则不会编译 zenoh 插件。
|
||||
- Iceoryx 插件依赖 libacl,在 ubuntu 上可通过 `sudo apt install libacl1-dev` 进行安装,选项开启但缺失相应包会报错。
|
||||
- Boost 依赖由于其内容较大,CMake 会首先检查本地是否有 1.82.0 及以上版本的 boost,如果有则使用本地安装的 boost,如果没有则进行下载。
|
||||
|
||||
|
||||
## 通过源码引用
|
||||
|
||||
您可以参考以下 CMake 代码引用 AimRT:
|
||||
您可以参考以下 CMake 代码引用 AimRT,注意需要将`GIT_TAG`版本改为你想引用的版本:
|
||||
```cmake
|
||||
include(FetchContent)
|
||||
|
||||
|
@ -9,11 +9,11 @@ add_subdirectory(executor)
|
||||
add_subdirectory(parameter)
|
||||
|
||||
if(AIMRT_BUILD_WITH_PROTOBUF)
|
||||
add_subdirectory(protobuf_channel)
|
||||
add_subdirectory(protobuf_rpc)
|
||||
add_subdirectory(pb_chn)
|
||||
add_subdirectory(pb_rpc)
|
||||
endif()
|
||||
|
||||
if(AIMRT_BUILD_WITH_ROS2)
|
||||
add_subdirectory(ros2_channel)
|
||||
add_subdirectory(ros2_chn)
|
||||
add_subdirectory(ros2_rpc)
|
||||
endif()
|
||||
|
@ -14,9 +14,9 @@ add_subdirectory(module/benchmark_publisher_module)
|
||||
add_subdirectory(module/benchmark_subscriber_module)
|
||||
|
||||
# pkg
|
||||
add_subdirectory(pkg/protobuf_channel_pkg)
|
||||
add_subdirectory(pkg/protobuf_channel_pub_pkg)
|
||||
add_subdirectory(pkg/protobuf_channel_sub_pkg)
|
||||
add_subdirectory(pkg/pb_chn_pkg)
|
||||
add_subdirectory(pkg/pb_chn_pub_pkg)
|
||||
add_subdirectory(pkg/pb_chn_sub_pkg)
|
||||
|
||||
# app
|
||||
add_subdirectory(app/normal_publisher_app)
|
||||
@ -38,6 +38,6 @@ add_custom_target(
|
||||
${CUR_SUPERIOR_NAMESPACE_UNDERLINE}_${CUR_DIR}_build_all ALL
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CUR_INSTALL_SOURCE_DIR}/bin ${CMAKE_BINARY_DIR}
|
||||
DEPENDS aimrt::runtime::main
|
||||
${CUR_SUPERIOR_NAMESPACE}::${CUR_DIR}::protobuf_channel_pkg
|
||||
${CUR_SUPERIOR_NAMESPACE}::${CUR_DIR}::protobuf_channel_pub_pkg
|
||||
${CUR_SUPERIOR_NAMESPACE}::${CUR_DIR}::protobuf_channel_sub_pkg)
|
||||
${CUR_SUPERIOR_NAMESPACE}::${CUR_DIR}::pb_chn_pkg
|
||||
${CUR_SUPERIOR_NAMESPACE}::${CUR_DIR}::pb_chn_pub_pkg
|
||||
${CUR_SUPERIOR_NAMESPACE}::${CUR_DIR}::pb_chn_sub_pkg)
|
@ -14,17 +14,17 @@
|
||||
- [event.proto](../../../protocols/example/event.proto)
|
||||
- [normal_publisher_module.cc](./module/normal_publisher_module/normal_publisher_module.cc)
|
||||
- [normal_subscriber_module.cc](./module/normal_subscriber_module/normal_subscriber_module.cc)
|
||||
- [protobuf_channel_pub_pkg/pkg_main.cc](./pkg/protobuf_channel_pub_pkg/pkg_main.cc)
|
||||
- [protobuf_channel_sub_pkg/pkg_main.cc](./pkg/protobuf_channel_sub_pkg/pkg_main.cc)
|
||||
- [pb_chn_pub_pkg/pkg_main.cc](./pkg/pb_chn_pub_pkg/pkg_main.cc)
|
||||
- [pb_chn_sub_pkg/pkg_main.cc](./pkg/pb_chn_sub_pkg/pkg_main.cc)
|
||||
|
||||
|
||||
配置文件:
|
||||
- [examples_cpp_protobuf_channel_cfg.yaml](./install/linux/bin/cfg/examples_cpp_protobuf_channel_cfg.yaml)
|
||||
- [examples_cpp_pb_chn_cfg.yaml](./install/linux/bin/cfg/examples_cpp_pb_chn_cfg.yaml)
|
||||
|
||||
|
||||
运行方式(linux):
|
||||
- 开启 `AIMRT_BUILD_EXAMPLES`、`AIMRT_BUILD_WITH_PROTOBUF` 选项编译 AimRT;
|
||||
- 直接运行 build 目录下`start_examples_cpp_protobuf_channel.sh`脚本启动进程;
|
||||
- 直接运行 build 目录下`start_examples_cpp_pb_chn.sh`脚本启动进程;
|
||||
- 键入`ctrl-c`停止进程;
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
- 此示例创建了以下两个模块:
|
||||
- `NormalPublisherModule`:会基于 `work_thread_pool` 执行器,以配置的频率、向配置的 topic 中发布 `ExampleEventMsg` 类型的消息;
|
||||
- `NormalSubscriberModule`:会订阅配置的 topic 下的 `ExampleEventMsg` 类型的消息;
|
||||
- 此示例将 `NormalPublisherModule` 和 `NormalSubscriberModule` 分别集成到 `protobuf_channel_pub_pkg` 和 `protobuf_channel_sub_pkg` 两个 Pkg 中,并在配置文件中加载这两个 Pkg 到一个 AimRT 进程中;
|
||||
- 此示例将 `NormalPublisherModule` 和 `NormalSubscriberModule` 分别集成到 `pb_chn_pub_pkg` 和 `pb_chn_sub_pkg` 两个 Pkg 中,并在配置文件中加载这两个 Pkg 到一个 AimRT 进程中;
|
||||
- 此示例使用 local 类型的 channel 后端进行通信;
|
||||
|
||||
|
||||
@ -51,21 +51,21 @@
|
||||
- [event.proto](../../../protocols/example/event.proto)
|
||||
- [normal_publisher_module.cc](./module/normal_publisher_module/normal_publisher_module.cc)
|
||||
- [normal_subscriber_module.cc](./module/normal_subscriber_module/normal_subscriber_module.cc)
|
||||
- [protobuf_channel_pkg/pkg_main.cc](./pkg/protobuf_channel_pkg/pkg_main.cc)
|
||||
- [pb_chn_pkg/pkg_main.cc](./pkg/pb_chn_pkg/pkg_main.cc)
|
||||
|
||||
|
||||
配置文件:
|
||||
- [examples_cpp_protobuf_channel_single_pkg_cfg.yaml](./install/linux/bin/cfg/examples_cpp_protobuf_channel_single_pkg_cfg.yaml)
|
||||
- [examples_cpp_pb_chn_single_pkg_cfg.yaml](./install/linux/bin/cfg/examples_cpp_pb_chn_single_pkg_cfg.yaml)
|
||||
|
||||
|
||||
运行方式(linux):
|
||||
- 开启 `AIMRT_BUILD_EXAMPLES`、`AIMRT_BUILD_WITH_PROTOBUF` 选项编译 AimRT;
|
||||
- 直接运行 build 目录下`start_examples_cpp_protobuf_channel_single_pkg.sh`脚本启动进程;
|
||||
- 直接运行 build 目录下`start_examples_cpp_pb_chn_single_pkg.sh`脚本启动进程;
|
||||
- 键入`ctrl-c`停止进程;
|
||||
|
||||
|
||||
说明:
|
||||
- 此示例与 **protobuf channel** 示例基本一致,唯一的区别是将 `NormalPublisherModule` 和 `NormalSubscriberModule` 集成到 `protobuf_channel_pkg` 一个 Pkg 中;
|
||||
- 此示例与 **protobuf channel** 示例基本一致,唯一的区别是将 `NormalPublisherModule` 和 `NormalSubscriberModule` 集成到 `pb_chn_pkg` 一个 Pkg 中;
|
||||
|
||||
|
||||
## protobuf channel publisher app
|
||||
@ -83,22 +83,22 @@
|
||||
- [event.proto](../../../protocols/example/event.proto)
|
||||
- [normal_publisher_app/main.cc](./app/normal_publisher_app/main.cc)
|
||||
- [normal_subscriber_module.cc](./module/normal_subscriber_module/normal_subscriber_module.cc)
|
||||
- [protobuf_channel_sub_pkg/pkg_main.cc](./pkg/protobuf_channel_sub_pkg/pkg_main.cc)
|
||||
- [pb_chn_sub_pkg/pkg_main.cc](./pkg/pb_chn_sub_pkg/pkg_main.cc)
|
||||
|
||||
|
||||
配置文件:
|
||||
- [examples_cpp_protobuf_channel_publisher_app_cfg.yaml](./install/linux/bin/cfg/examples_cpp_protobuf_channel_publisher_app_cfg.yaml)
|
||||
- [examples_cpp_pb_chn_publisher_app_cfg.yaml](./install/linux/bin/cfg/examples_cpp_pb_chn_publisher_app_cfg.yaml)
|
||||
|
||||
|
||||
运行方式(linux):
|
||||
- 开启 `AIMRT_BUILD_EXAMPLES`、`AIMRT_BUILD_WITH_PROTOBUF` 选项编译 AimRT;
|
||||
- 直接运行 build 目录下`start_examples_cpp_protobuf_channel_publisher_app.sh`脚本启动进程;
|
||||
- 直接运行 build 目录下`start_examples_cpp_pb_chn_publisher_app.sh`脚本启动进程;
|
||||
- 键入`ctrl-c`停止进程;
|
||||
|
||||
|
||||
说明:
|
||||
- 此示例在 App 模式下,直接创建 `NormalPublisherModule` 模块,获取 CoreRef 句柄,以配置的频率、向配置的 topic 中发布 `ExampleEventMsg` 类型的消息;
|
||||
- 此示例以继承 `ModuleBase` 的方式创建了`NormalSubscriberModule`模块,会订阅配置的 topic 下的 `ExampleEventMsg` 类型的消息,并集成到了 `protobuf_channel_sub_pkg` 中,在启动时加载;
|
||||
- 此示例以继承 `ModuleBase` 的方式创建了`NormalSubscriberModule`模块,会订阅配置的 topic 下的 `ExampleEventMsg` 类型的消息,并集成到了 `pb_chn_sub_pkg` 中,在启动时加载;
|
||||
- 此示例使用 local 类型的 channel 后端进行通信;
|
||||
- 此示例以 App 模式启动;
|
||||
|
||||
@ -118,23 +118,23 @@
|
||||
- [event.proto](../../../protocols/example/event.proto)
|
||||
- [normal_subscriber_app/main.cc](./app/normal_subscriber_app/main.cc)
|
||||
- [normal_publisher_module.cc](./module/normal_publisher_module/normal_publisher_module.cc)
|
||||
- [protobuf_channel_pub_pkg/pkg_main.cc](./pkg/protobuf_channel_pub_pkg/pkg_main.cc)
|
||||
- [pb_chn_pub_pkg/pkg_main.cc](./pkg/pb_chn_pub_pkg/pkg_main.cc)
|
||||
|
||||
|
||||
|
||||
配置文件:
|
||||
- [examples_cpp_protobuf_channel_subscriber_app_cfg.yaml](./install/linux/bin/cfg/examples_cpp_protobuf_channel_subscriber_app_cfg.yaml)
|
||||
- [examples_cpp_pb_chn_subscriber_app_cfg.yaml](./install/linux/bin/cfg/examples_cpp_pb_chn_subscriber_app_cfg.yaml)
|
||||
|
||||
|
||||
运行方式(linux):
|
||||
- 开启 `AIMRT_BUILD_EXAMPLES`、`AIMRT_BUILD_WITH_PROTOBUF` 选项编译 AimRT;
|
||||
- 直接运行 build 目录下`start_examples_cpp_protobuf_channel_subscriber_app.sh`脚本启动进程;
|
||||
- 直接运行 build 目录下`start_examples_cpp_pb_chn_subscriber_app.sh`脚本启动进程;
|
||||
- 键入`ctrl-c`停止进程;
|
||||
|
||||
|
||||
说明:
|
||||
- 此示例在 App 模式下,直接创建 `NormalSubscriberModule` 模块,获取 CoreRef 句柄,会订阅配置的 topic 下的 `ExampleEventMsg` 类型的消息;
|
||||
- 此示例以继承 `ModuleBase` 的方式创建了`NormalPublisherModule`模块,以配置的频率、向配置的 topic 中发布 `ExampleEventMsg` 类型的消息,并集成到了 `protobuf_channel_pub_pkg` 中,在启动时加载;
|
||||
- 此示例以继承 `ModuleBase` 的方式创建了`NormalPublisherModule`模块,以配置的频率、向配置的 topic 中发布 `ExampleEventMsg` 类型的消息,并集成到了 `pb_chn_pub_pkg` 中,在启动时加载;
|
||||
- 此示例使用 local 类型的 channel 后端进行通信;
|
||||
- 此示例以 App 模式启动;
|
||||
|
@ -36,9 +36,9 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./protobuf_channel_pub_pkg.dll
|
||||
- path: ./libpb_chn_pub_pkg.so
|
||||
enable_modules: [BenchmarkPublisherModule]
|
||||
- path: ./protobuf_channel_sub_pkg.dll
|
||||
- path: ./libpb_chn_sub_pkg.so
|
||||
enable_modules: [BenchmarkSubscriberModule]
|
||||
modules:
|
||||
- name: BenchmarkPublisherModule
|
@ -36,7 +36,7 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./protobuf_channel_pkg.dll
|
||||
- path: ./libpb_chn_pkg.so
|
||||
enable_modules: [BenchmarkPublisherModule, BenchmarkSubscriberModule]
|
||||
modules:
|
||||
- name: BenchmarkPublisherModule
|
@ -26,9 +26,9 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./ros2_channel_pub_pkg.dll
|
||||
- path: ./libpb_chn_pub_pkg.so
|
||||
enable_modules: [NormalPublisherModule]
|
||||
- path: ./ros2_channel_sub_pkg.dll
|
||||
- path: ./libpb_chn_sub_pkg.so
|
||||
enable_modules: [NormalSubscriberModule]
|
||||
modules:
|
||||
- name: NormalPublisherModule
|
@ -26,7 +26,7 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./libprotobuf_channel_sub_pkg.so
|
||||
- path: ./libpb_chn_sub_pkg.so
|
||||
enable_modules: [NormalSubscriberModule]
|
||||
modules:
|
||||
- name: NormalPublisherModule
|
@ -26,7 +26,7 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./ros2_channel_pkg.dll
|
||||
- path: ./libpb_chn_pkg.so
|
||||
enable_modules: [NormalPublisherModule, NormalSubscriberModule]
|
||||
modules:
|
||||
- name: NormalPublisherModule
|
@ -26,7 +26,7 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./libprotobuf_channel_pub_pkg.so
|
||||
- path: ./libpb_chn_pub_pkg.so
|
||||
enable_modules: [NormalPublisherModule]
|
||||
modules:
|
||||
- name: NormalPublisherModule
|
3
src/examples/cpp/pb_chn/install/linux/bin/start_examples_cpp_pb_chn.sh
Executable file
3
src/examples/cpp/pb_chn/install/linux/bin/start_examples_cpp_pb_chn.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./aimrt_main --cfg_file_path=./cfg/examples_cpp_pb_chn_cfg.yaml
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./aimrt_main --cfg_file_path=./cfg/examples_cpp_pb_chn_benchmark_cfg.yaml
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./aimrt_main --cfg_file_path=./cfg/examples_cpp_pb_chn_benchmark_single_pkg_cfg.yaml
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./normal_publisher_app ./cfg/examples_cpp_pb_chn_publisher_app_cfg.yaml
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./aimrt_main --cfg_file_path=./cfg/examples_cpp_pb_chn_single_pkg_cfg.yaml
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./normal_subscriber_app ./cfg/examples_cpp_pb_chn_subscriber_app_cfg.yaml
|
@ -36,9 +36,9 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./libprotobuf_channel_pub_pkg.so
|
||||
- path: ./pb_chn_pub_pkg.dll
|
||||
enable_modules: [BenchmarkPublisherModule]
|
||||
- path: ./libprotobuf_channel_sub_pkg.so
|
||||
- path: ./pb_chn_sub_pkg.dll
|
||||
enable_modules: [BenchmarkSubscriberModule]
|
||||
modules:
|
||||
- name: BenchmarkPublisherModule
|
@ -36,7 +36,7 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./libprotobuf_channel_pkg.so
|
||||
- path: ./pb_chn_pkg.dll
|
||||
enable_modules: [BenchmarkPublisherModule, BenchmarkSubscriberModule]
|
||||
modules:
|
||||
- name: BenchmarkPublisherModule
|
@ -26,9 +26,9 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./libros2_channel_pub_pkg.so
|
||||
- path: ./pb_chn_pub_pkg.dll
|
||||
enable_modules: [NormalPublisherModule]
|
||||
- path: ./libros2_channel_sub_pkg.so
|
||||
- path: ./pb_chn_sub_pkg.dll
|
||||
enable_modules: [NormalSubscriberModule]
|
||||
modules:
|
||||
- name: NormalPublisherModule
|
@ -26,7 +26,7 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./libros2_channel_pkg.so
|
||||
- path: ./pb_chn_pkg.dll
|
||||
enable_modules: [NormalPublisherModule, NormalSubscriberModule]
|
||||
modules:
|
||||
- name: NormalPublisherModule
|
@ -0,0 +1,2 @@
|
||||
|
||||
.\aimrt_main.exe --cfg_file_path=./cfg/examples_cpp_pb_chn_cfg.yaml
|
@ -0,0 +1,2 @@
|
||||
|
||||
.\aimrt_main.exe --cfg_file_path=./cfg/examples_cpp_pb_chn_benchmark_cfg.yaml
|
@ -0,0 +1,2 @@
|
||||
|
||||
.\aimrt_main.exe --cfg_file_path=./cfg/examples_cpp_pb_chn_benchmark_single_pkg_cfg.yaml
|
@ -0,0 +1,2 @@
|
||||
|
||||
.\aimrt_main.exe --cfg_file_path=./cfg/examples_cpp_pb_chn_single_pkg_cfg.yaml
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "benchmark.pb.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_channel::benchmark_publisher_module {
|
||||
namespace aimrt::examples::cpp::pb_chn::benchmark_publisher_module {
|
||||
|
||||
std::string GenerateRandomString(int min_length, int max_length) {
|
||||
static constexpr std::string_view kChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
@ -217,4 +217,4 @@ void BenchmarkPublisherModule::StartSinglePlan(uint32_t plan_id, BenchPlan plan)
|
||||
aimrt::channel::Publish(signal_publisher_, end_signal);
|
||||
}
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_channel::benchmark_publisher_module
|
||||
} // namespace aimrt::examples::cpp::pb_chn::benchmark_publisher_module
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "aimrt_module_cpp_interface/module_base.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_channel::benchmark_publisher_module {
|
||||
namespace aimrt::examples::cpp::pb_chn::benchmark_publisher_module {
|
||||
|
||||
class BenchmarkPublisherModule : public aimrt::ModuleBase {
|
||||
public:
|
||||
@ -59,4 +59,4 @@ class BenchmarkPublisherModule : public aimrt::ModuleBase {
|
||||
std::vector<BenchPlan> bench_plans_;
|
||||
};
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_channel::benchmark_publisher_module
|
||||
} // namespace aimrt::examples::cpp::pb_chn::benchmark_publisher_module
|
@ -15,7 +15,7 @@
|
||||
|
||||
#include "yaml-cpp/yaml.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_channel::benchmark_subscriber_module {
|
||||
namespace aimrt::examples::cpp::pb_chn::benchmark_subscriber_module {
|
||||
|
||||
bool BenchmarkSubscriberModule::Initialize(aimrt::CoreRef core) {
|
||||
core_ = core;
|
||||
@ -219,4 +219,4 @@ p999 latency: {} us
|
||||
p999_latency / 1000.0);
|
||||
}
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_channel::benchmark_subscriber_module
|
||||
} // namespace aimrt::examples::cpp::pb_chn::benchmark_subscriber_module
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "benchmark.pb.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_channel::benchmark_subscriber_module {
|
||||
namespace aimrt::examples::cpp::pb_chn::benchmark_subscriber_module {
|
||||
|
||||
class BenchmarkSubscriberModule : public aimrt::ModuleBase {
|
||||
public:
|
||||
@ -69,4 +69,4 @@ class BenchmarkSubscriberModule : public aimrt::ModuleBase {
|
||||
std::vector<TopicRecord> topic_record_vec_;
|
||||
};
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_channel::benchmark_subscriber_module
|
||||
} // namespace aimrt::examples::cpp::pb_chn::benchmark_subscriber_module
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "event.pb.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_channel::normal_publisher_module {
|
||||
namespace aimrt::examples::cpp::pb_chn::normal_publisher_module {
|
||||
|
||||
bool NormalPublisherModule::Initialize(aimrt::CoreRef core) {
|
||||
core_ = core;
|
||||
@ -100,4 +100,4 @@ void NormalPublisherModule::MainLoop() {
|
||||
stop_sig_.set_value();
|
||||
}
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_channel::normal_publisher_module
|
||||
} // namespace aimrt::examples::cpp::pb_chn::normal_publisher_module
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "aimrt_module_cpp_interface/module_base.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_channel::normal_publisher_module {
|
||||
namespace aimrt::examples::cpp::pb_chn::normal_publisher_module {
|
||||
|
||||
class NormalPublisherModule : public aimrt::ModuleBase {
|
||||
public:
|
||||
@ -42,4 +42,4 @@ class NormalPublisherModule : public aimrt::ModuleBase {
|
||||
aimrt::channel::PublisherRef publisher_;
|
||||
};
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_channel::normal_publisher_module
|
||||
} // namespace aimrt::examples::cpp::pb_chn::normal_publisher_module
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "yaml-cpp/yaml.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_channel::normal_subscriber_module {
|
||||
namespace aimrt::examples::cpp::pb_chn::normal_subscriber_module {
|
||||
|
||||
bool NormalSubscriberModule::Initialize(aimrt::CoreRef core) {
|
||||
core_ = core;
|
||||
@ -49,4 +49,4 @@ void NormalSubscriberModule::EventHandle(
|
||||
AIMRT_INFO("Receive new pb event, ctx: {}, data: {}", ctx.ToString(), aimrt::Pb2CompactJson(*data));
|
||||
}
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_channel::normal_subscriber_module
|
||||
} // namespace aimrt::examples::cpp::pb_chn::normal_subscriber_module
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "event.pb.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_channel::normal_subscriber_module {
|
||||
namespace aimrt::examples::cpp::pb_chn::normal_subscriber_module {
|
||||
|
||||
class NormalSubscriberModule : public aimrt::ModuleBase {
|
||||
public:
|
||||
@ -37,4 +37,4 @@ class NormalSubscriberModule : public aimrt::ModuleBase {
|
||||
aimrt::channel::SubscriberRef subscriber_;
|
||||
};
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_channel::normal_subscriber_module
|
||||
} // namespace aimrt::examples::cpp::pb_chn::normal_subscriber_module
|
@ -9,7 +9,7 @@
|
||||
#include "normal_publisher_module/normal_publisher_module.h"
|
||||
#include "normal_subscriber_module/normal_subscriber_module.h"
|
||||
|
||||
using namespace aimrt::examples::cpp::protobuf_channel;
|
||||
using namespace aimrt::examples::cpp::pb_chn;
|
||||
|
||||
static std::tuple<std::string_view, std::function<aimrt::ModuleBase*()>> aimrt_module_register_array[]{
|
||||
{"NormalPublisherModule", []() -> aimrt::ModuleBase* {
|
@ -9,7 +9,7 @@
|
||||
#include "normal_publisher_module/normal_publisher_module.h"
|
||||
#include "normal_subscriber_module/normal_subscriber_module.h"
|
||||
|
||||
using namespace aimrt::examples::cpp::protobuf_channel;
|
||||
using namespace aimrt::examples::cpp::pb_chn;
|
||||
|
||||
static std::tuple<std::string_view, std::function<aimrt::ModuleBase*()>> aimrt_module_register_array[]{
|
||||
{"NormalPublisherModule", []() -> aimrt::ModuleBase* {
|
@ -9,7 +9,7 @@
|
||||
#include "normal_publisher_module/normal_publisher_module.h"
|
||||
#include "normal_subscriber_module/normal_subscriber_module.h"
|
||||
|
||||
using namespace aimrt::examples::cpp::protobuf_channel;
|
||||
using namespace aimrt::examples::cpp::pb_chn;
|
||||
|
||||
static std::tuple<std::string_view, std::function<aimrt::ModuleBase*()>> aimrt_module_register_array[]{
|
||||
{"NormalSubscriberModule", []() -> aimrt::ModuleBase* {
|
@ -18,9 +18,9 @@ add_subdirectory(module/normal_rpc_sync_server_module)
|
||||
add_subdirectory(module/normal_rpc_async_server_module)
|
||||
|
||||
# pkg
|
||||
add_subdirectory(pkg/protobuf_rpc_pkg)
|
||||
add_subdirectory(pkg/protobuf_rpc_client_pkg)
|
||||
add_subdirectory(pkg/protobuf_rpc_server_pkg)
|
||||
add_subdirectory(pkg/pb_rpc_pkg)
|
||||
add_subdirectory(pkg/pb_rpc_client_pkg)
|
||||
add_subdirectory(pkg/pb_rpc_server_pkg)
|
||||
|
||||
# install
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
@ -38,6 +38,6 @@ add_custom_target(
|
||||
${CUR_SUPERIOR_NAMESPACE_UNDERLINE}_${CUR_DIR}_build_all ALL
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CUR_INSTALL_SOURCE_DIR}/bin ${CMAKE_BINARY_DIR}
|
||||
DEPENDS aimrt::runtime::main
|
||||
${CUR_SUPERIOR_NAMESPACE}::${CUR_DIR}::protobuf_rpc_pkg
|
||||
${CUR_SUPERIOR_NAMESPACE}::${CUR_DIR}::protobuf_rpc_client_pkg
|
||||
${CUR_SUPERIOR_NAMESPACE}::${CUR_DIR}::protobuf_rpc_server_pkg)
|
||||
${CUR_SUPERIOR_NAMESPACE}::${CUR_DIR}::pb_rpc_pkg
|
||||
${CUR_SUPERIOR_NAMESPACE}::${CUR_DIR}::pb_rpc_client_pkg
|
||||
${CUR_SUPERIOR_NAMESPACE}::${CUR_DIR}::pb_rpc_server_pkg)
|
@ -17,18 +17,18 @@
|
||||
- [normal_rpc_sync_client_module.cc](./module/normal_rpc_sync_client_module/normal_rpc_sync_client_module.cc)
|
||||
- [normal_rpc_sync_server_module.cc](./module/normal_rpc_sync_server_module/normal_rpc_sync_server_module.cc)
|
||||
- [service.cc](./module/normal_rpc_sync_server_module/service.cc)
|
||||
- [protobuf_rpc_client_pkg/pkg_main.cc](./pkg/protobuf_rpc_client_pkg/pkg_main.cc)
|
||||
- [protobuf_rpc_server_pkg/pkg_main.cc](./pkg/protobuf_rpc_server_pkg/pkg_main.cc)
|
||||
- [pb_rpc_client_pkg/pkg_main.cc](./pkg/pb_rpc_client_pkg/pkg_main.cc)
|
||||
- [pb_rpc_server_pkg/pkg_main.cc](./pkg/pb_rpc_server_pkg/pkg_main.cc)
|
||||
|
||||
|
||||
配置文件:
|
||||
- [examples_cpp_protobuf_rpc_sync_cfg.yaml](./install/linux/bin/cfg/examples_cpp_protobuf_rpc_sync_cfg.yaml)
|
||||
- [examples_cpp_pb_rpc_sync_cfg.yaml](./install/linux/bin/cfg/examples_cpp_pb_rpc_sync_cfg.yaml)
|
||||
|
||||
|
||||
|
||||
运行方式(linux):
|
||||
- 开启 `AIMRT_BUILD_EXAMPLES`、`AIMRT_BUILD_WITH_PROTOBUF` 选项编译 AimRT;
|
||||
- 直接运行 build 目录下`start_examples_cpp_protobuf_rpc_sync.sh`脚本启动进程;
|
||||
- 直接运行 build 目录下`start_examples_cpp_pb_rpc_sync.sh`脚本启动进程;
|
||||
- 键入`ctrl-c`停止进程;
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
- 此示例创建了以下两个模块:
|
||||
- `NormalRpcSyncClientModule`:会基于 `work_thread_pool` 执行器,以配置的频率,通过同步 Client 接口,向 `ExampleService` 发起 RPC 请求;
|
||||
- `NormalRpcSyncServerModule`:会注册 `ExampleService` 服务端,通过同步 Server 接口,提供 echo 功能;
|
||||
- 此示例将 `NormalRpcSyncClientModule` 和 `NormalRpcSyncServerModule` 分别集成到 `protobuf_rpc_client_pkg` 和 `protobuf_rpc_server_pkg` 两个 Pkg 中,并在配置文件中加载这两个 Pkg 到一个 AimRT 进程中;
|
||||
- 此示例将 `NormalRpcSyncClientModule` 和 `NormalRpcSyncServerModule` 分别集成到 `pb_rpc_client_pkg` 和 `pb_rpc_server_pkg` 两个 Pkg 中,并在配置文件中加载这两个 Pkg 到一个 AimRT 进程中;
|
||||
- 此示例使用 local 类型的 rpc 后端进行通信,并配置了 `timeout_handle` 执行器作为超时执行器;
|
||||
|
||||
|
||||
@ -57,18 +57,18 @@
|
||||
- [normal_rpc_async_client_module.cc](./module/normal_rpc_async_client_module/normal_rpc_async_client_module.cc)
|
||||
- [normal_rpc_async_server_module.cc](./module/normal_rpc_async_server_module/normal_rpc_async_server_module.cc)
|
||||
- [service.cc](./module/normal_rpc_async_server_module/service.cc)
|
||||
- [protobuf_rpc_client_pkg/pkg_main.cc](./pkg/protobuf_rpc_client_pkg/pkg_main.cc)
|
||||
- [protobuf_rpc_server_pkg/pkg_main.cc](./pkg/protobuf_rpc_server_pkg/pkg_main.cc)
|
||||
- [pb_rpc_client_pkg/pkg_main.cc](./pkg/pb_rpc_client_pkg/pkg_main.cc)
|
||||
- [pb_rpc_server_pkg/pkg_main.cc](./pkg/pb_rpc_server_pkg/pkg_main.cc)
|
||||
|
||||
|
||||
配置文件:
|
||||
- [examples_cpp_protobuf_rpc_async_cfg.yaml](./install/linux/bin/cfg/examples_cpp_protobuf_rpc_async_cfg.yaml)
|
||||
- [examples_cpp_pb_rpc_async_cfg.yaml](./install/linux/bin/cfg/examples_cpp_pb_rpc_async_cfg.yaml)
|
||||
|
||||
|
||||
|
||||
运行方式(linux):
|
||||
- 开启 `AIMRT_BUILD_EXAMPLES`、`AIMRT_BUILD_WITH_PROTOBUF` 选项编译 AimRT;
|
||||
- 直接运行 build 目录下`start_examples_cpp_protobuf_rpc_async.sh`脚本启动进程;
|
||||
- 直接运行 build 目录下`start_examples_cpp_pb_rpc_async.sh`脚本启动进程;
|
||||
- 键入`ctrl-c`停止进程;
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
- 此示例创建了以下两个模块:
|
||||
- `NormalRpcAsyncClientModule`:会基于 `work_thread_pool` 执行器,以配置的频率,通过异步 Client 接口,向 `ExampleService` 发起 RPC 请求;
|
||||
- `NormalRpcAsyncServerModule`:会注册 `ExampleService` 服务端,通过异步 Server 接口,提供 echo 功能;
|
||||
- 此示例将 `NormalRpcAsyncClientModule` 和 `NormalRpcAsyncServerModule` 分别集成到 `protobuf_rpc_client_pkg` 和 `protobuf_rpc_server_pkg` 两个 Pkg 中,并在配置文件中加载这两个 Pkg 到一个 AimRT 进程中;
|
||||
- 此示例将 `NormalRpcAsyncClientModule` 和 `NormalRpcAsyncServerModule` 分别集成到 `pb_rpc_client_pkg` 和 `pb_rpc_server_pkg` 两个 Pkg 中,并在配置文件中加载这两个 Pkg 到一个 AimRT 进程中;
|
||||
- 此示例使用 local 类型的 rpc 后端进行通信,并配置了 `timeout_handle` 执行器作为超时执行器;
|
||||
|
||||
|
||||
@ -96,18 +96,18 @@
|
||||
- [normal_rpc_future_client_module.cc](./module/normal_rpc_future_client_module/normal_rpc_future_client_module.cc)
|
||||
- [normal_rpc_sync_server_module.cc](./module/normal_rpc_sync_server_module/normal_rpc_sync_server_module.cc)
|
||||
- [service.cc](./module/normal_rpc_sync_server_module/service.cc)
|
||||
- [protobuf_rpc_client_pkg/pkg_main.cc](./pkg/protobuf_rpc_client_pkg/pkg_main.cc)
|
||||
- [protobuf_rpc_server_pkg/pkg_main.cc](./pkg/protobuf_rpc_server_pkg/pkg_main.cc)
|
||||
- [pb_rpc_client_pkg/pkg_main.cc](./pkg/pb_rpc_client_pkg/pkg_main.cc)
|
||||
- [pb_rpc_server_pkg/pkg_main.cc](./pkg/pb_rpc_server_pkg/pkg_main.cc)
|
||||
|
||||
|
||||
配置文件:
|
||||
- [examples_cpp_protobuf_rpc_future_cfg.yaml](./install/linux/bin/cfg/examples_cpp_protobuf_rpc_future_cfg.yaml)
|
||||
- [examples_cpp_pb_rpc_future_cfg.yaml](./install/linux/bin/cfg/examples_cpp_pb_rpc_future_cfg.yaml)
|
||||
|
||||
|
||||
|
||||
运行方式(linux):
|
||||
- 开启 `AIMRT_BUILD_EXAMPLES`、`AIMRT_BUILD_WITH_PROTOBUF` 选项编译 AimRT;
|
||||
- 直接运行 build 目录下`start_examples_cpp_protobuf_rpc_future.sh`脚本启动进程;
|
||||
- 直接运行 build 目录下`start_examples_cpp_pb_rpc_future.sh`脚本启动进程;
|
||||
- 键入`ctrl-c`停止进程;
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@
|
||||
- 此示例创建了以下两个模块:
|
||||
- `NormalRpcFutureClientModule`:会基于 `work_thread_pool` 执行器,以配置的频率,通过 future 型 Client 接口,向 `ExampleService` 发起 RPC 请求;
|
||||
- `NormalRpcSyncServerModule`:会注册 `ExampleService` 服务端,通过同步 Server 接口,提供 echo 功能;
|
||||
- 此示例将 `NormalRpcFutureClientModule` 和 `NormalRpcSyncServerModule` 分别集成到 `protobuf_rpc_client_pkg` 和 `protobuf_rpc_server_pkg` 两个 Pkg 中,并在配置文件中加载这两个 Pkg 到一个 AimRT 进程中;
|
||||
- 此示例将 `NormalRpcFutureClientModule` 和 `NormalRpcSyncServerModule` 分别集成到 `pb_rpc_client_pkg` 和 `pb_rpc_server_pkg` 两个 Pkg 中,并在配置文件中加载这两个 Pkg 到一个 AimRT 进程中;
|
||||
- 此示例使用 local 类型的 rpc 后端进行通信,并配置了 `timeout_handle` 执行器作为超时执行器;
|
||||
|
||||
|
||||
@ -137,18 +137,18 @@
|
||||
- [normal_rpc_co_client_module.cc](./module/normal_rpc_co_client_module/normal_rpc_co_client_module.cc)
|
||||
- [normal_rpc_co_server_module.cc](./module/normal_rpc_co_server_module/normal_rpc_co_server_module.cc)
|
||||
- [service.cc](./module/normal_rpc_co_server_module/service.cc)
|
||||
- [protobuf_rpc_client_pkg/pkg_main.cc](./pkg/protobuf_rpc_client_pkg/pkg_main.cc)
|
||||
- [protobuf_rpc_server_pkg/pkg_main.cc](./pkg/protobuf_rpc_server_pkg/pkg_main.cc)
|
||||
- [pb_rpc_client_pkg/pkg_main.cc](./pkg/pb_rpc_client_pkg/pkg_main.cc)
|
||||
- [pb_rpc_server_pkg/pkg_main.cc](./pkg/pb_rpc_server_pkg/pkg_main.cc)
|
||||
|
||||
|
||||
配置文件:
|
||||
- [examples_cpp_protobuf_rpc_co_cfg.yaml](./install/linux/bin/cfg/examples_cpp_protobuf_rpc_co_cfg.yaml)
|
||||
- [examples_cpp_pb_rpc_co_cfg.yaml](./install/linux/bin/cfg/examples_cpp_pb_rpc_co_cfg.yaml)
|
||||
|
||||
|
||||
|
||||
运行方式(linux):
|
||||
- 开启 `AIMRT_BUILD_EXAMPLES`、`AIMRT_BUILD_WITH_PROTOBUF` 选项编译 AimRT;
|
||||
- 直接运行 build 目录下`start_examples_cpp_protobuf_rpc_co.sh`脚本启动进程;
|
||||
- 直接运行 build 目录下`start_examples_cpp_pb_rpc_co.sh`脚本启动进程;
|
||||
- 键入`ctrl-c`停止进程;
|
||||
|
||||
|
||||
@ -157,7 +157,7 @@
|
||||
- `NormalRpcCoClientModule`:会基于 `work_thread_pool` 执行器,以配置的频率,通过协程 Client 接口,向 `ExampleService` 发起 RPC 请求;
|
||||
- `NormalRpcCoServerModule`:会注册 `ExampleService` 服务端,通过协程 Server 接口,提供 echo 功能;
|
||||
- 此示例在 Rpc Client 端和 Server 端分别注册了两个 Filter 用于打印请求日志和计算耗时;
|
||||
- 此示例将 `NormalRpcCoClientModule` 和 `NormalRpcCoServerModule` 分别集成到 `protobuf_rpc_client_pkg` 和 `protobuf_rpc_server_pkg` 两个 Pkg 中,并在配置文件中加载这两个 Pkg 到一个 AimRT 进程中;
|
||||
- 此示例将 `NormalRpcCoClientModule` 和 `NormalRpcCoServerModule` 分别集成到 `pb_rpc_client_pkg` 和 `pb_rpc_server_pkg` 两个 Pkg 中,并在配置文件中加载这两个 Pkg 到一个 AimRT 进程中;
|
||||
- 此示例使用 local 类型的 rpc 后端进行通信,并配置了 `timeout_handle` 执行器作为超时执行器;
|
||||
|
||||
|
||||
@ -179,20 +179,20 @@
|
||||
- [normal_rpc_co_client_module.cc](./module/normal_rpc_co_client_module/normal_rpc_co_client_module.cc)
|
||||
- [normal_rpc_co_server_module.cc](./module/normal_rpc_co_server_module/normal_rpc_co_server_module.cc)
|
||||
- [service.cc](./module/normal_rpc_co_server_module/service.cc)
|
||||
- [protobuf_rpc_pkg/pkg_main.cc](./pkg/protobuf_rpc_pkg/pkg_main.cc)
|
||||
- [pb_rpc_pkg/pkg_main.cc](./pkg/pb_rpc_pkg/pkg_main.cc)
|
||||
|
||||
|
||||
|
||||
配置文件:
|
||||
- [examples_cpp_protobuf_rpc_single_pkg_cfg.yaml](./install/linux/bin/cfg/examples_cpp_protobuf_rpc_single_pkg_cfg.yaml)
|
||||
- [examples_cpp_pb_rpc_single_pkg_cfg.yaml](./install/linux/bin/cfg/examples_cpp_pb_rpc_single_pkg_cfg.yaml)
|
||||
|
||||
|
||||
|
||||
运行方式(linux):
|
||||
- 开启 `AIMRT_BUILD_EXAMPLES`、`AIMRT_BUILD_WITH_PROTOBUF` 选项编译 AimRT;
|
||||
- 直接运行 build 目录下`start_examples_cpp_protobuf_rpc_single_pkg.sh`脚本启动进程;
|
||||
- 直接运行 build 目录下`start_examples_cpp_pb_rpc_single_pkg.sh`脚本启动进程;
|
||||
- 键入`ctrl-c`停止进程;
|
||||
|
||||
|
||||
说明:
|
||||
- 此示例与 **protobuf rpc co** 示例基本一致,唯一的区别是将 `NormalRpcCoClientModule` 和 `NormalRpcCoServerModule` 集成到 `protobuf_rpc_pkg` 一个 Pkg 中;
|
||||
- 此示例与 **protobuf rpc co** 示例基本一致,唯一的区别是将 `NormalRpcCoClientModule` 和 `NormalRpcCoServerModule` 集成到 `pb_rpc_pkg` 一个 Pkg 中;
|
@ -29,9 +29,9 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./libprotobuf_rpc_client_pkg.so
|
||||
- path: ./libpb_rpc_client_pkg.so
|
||||
enable_modules: [NormalRpcAsyncClientModule]
|
||||
- path: ./libprotobuf_rpc_server_pkg.so
|
||||
- path: ./libpb_rpc_server_pkg.so
|
||||
enable_modules: [NormalRpcAsyncServerModule]
|
||||
modules:
|
||||
- name: NormalRpcAsyncClientModule
|
@ -37,9 +37,9 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./libprotobuf_rpc_client_pkg.so
|
||||
- path: ./libpb_rpc_client_pkg.so
|
||||
enable_modules: [BenchmarkRpcClientModule]
|
||||
- path: ./libprotobuf_rpc_server_pkg.so
|
||||
- path: ./libpb_rpc_server_pkg.so
|
||||
enable_modules: [NormalRpcCoServerModule]
|
||||
modules:
|
||||
- name: BenchmarkRpcClientModule
|
@ -37,7 +37,7 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./libprotobuf_rpc_pkg.so
|
||||
- path: ./libpb_rpc_pkg.so
|
||||
enable_modules: [BenchmarkRpcClientModule, NormalRpcCoServerModule]
|
||||
modules:
|
||||
- name: BenchmarkRpcClientModule
|
@ -29,9 +29,9 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./protobuf_rpc_client_pkg.dll
|
||||
- path: ./libpb_rpc_client_pkg.so
|
||||
enable_modules: [NormalRpcCoClientModule]
|
||||
- path: ./protobuf_rpc_server_pkg.dll
|
||||
- path: ./libpb_rpc_server_pkg.so
|
||||
enable_modules: [NormalRpcCoServerModule]
|
||||
modules:
|
||||
- name: NormalRpcCoClientModule
|
@ -29,9 +29,9 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./libprotobuf_rpc_client_pkg.so
|
||||
- path: ./libpb_rpc_client_pkg.so
|
||||
enable_modules: [NormalRpcFutureClientModule]
|
||||
- path: ./libprotobuf_rpc_server_pkg.so
|
||||
- path: ./libpb_rpc_server_pkg.so
|
||||
enable_modules: [NormalRpcSyncServerModule]
|
||||
modules:
|
||||
- name: NormalRpcFutureClientModule
|
@ -29,7 +29,7 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./protobuf_rpc_pkg.dll
|
||||
- path: ./libpb_rpc_pkg.so
|
||||
enable_modules: [NormalRpcCoClientModule, NormalRpcCoServerModule]
|
||||
modules:
|
||||
- name: NormalRpcCoClientModule
|
@ -29,9 +29,9 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./libprotobuf_rpc_client_pkg.so
|
||||
- path: ./libpb_rpc_client_pkg.so
|
||||
enable_modules: [NormalRpcSyncClientModule]
|
||||
- path: ./libprotobuf_rpc_server_pkg.so
|
||||
- path: ./libpb_rpc_server_pkg.so
|
||||
enable_modules: [NormalRpcSyncServerModule]
|
||||
modules:
|
||||
- name: NormalRpcSyncClientModule
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./aimrt_main --cfg_file_path=./cfg/examples_cpp_pb_rpc_async_cfg.yaml
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./aimrt_main --cfg_file_path=./cfg/examples_cpp_pb_rpc_benchmark_cfg.yaml
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./aimrt_main --cfg_file_path=./cfg/examples_cpp_pb_rpc_benchmark_single_pkg_cfg.yaml
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./aimrt_main --cfg_file_path=./cfg/examples_cpp_pb_rpc_co_cfg.yaml
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./aimrt_main --cfg_file_path=./cfg/examples_cpp_pb_rpc_future_cfg.yaml
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./aimrt_main --cfg_file_path=./cfg/examples_cpp_pb_rpc_single_pkg_cfg.yaml
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./aimrt_main --cfg_file_path=./cfg/examples_cpp_pb_rpc_sync_cfg.yaml
|
@ -29,9 +29,9 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./libprotobuf_rpc_client_pkg.so
|
||||
- path: ./pb_rpc_client_pkg.dll
|
||||
enable_modules: [NormalRpcCoClientModule]
|
||||
- path: ./libprotobuf_rpc_server_pkg.so
|
||||
- path: ./pb_rpc_server_pkg.dll
|
||||
enable_modules: [NormalRpcCoServerModule]
|
||||
modules:
|
||||
- name: NormalRpcCoClientModule
|
@ -29,7 +29,7 @@ aimrt:
|
||||
enable_backends: [local]
|
||||
module:
|
||||
pkgs:
|
||||
- path: ./libprotobuf_rpc_pkg.so
|
||||
- path: ./pb_rpc_pkg.dll
|
||||
enable_modules: [NormalRpcCoClientModule, NormalRpcCoServerModule]
|
||||
modules:
|
||||
- name: NormalRpcCoClientModule
|
@ -0,0 +1,2 @@
|
||||
|
||||
.\aimrt_main.exe --cfg_file_path=./cfg/examples_cpp_pb_rpc_co_cfg.yaml
|
@ -0,0 +1,2 @@
|
||||
|
||||
.\aimrt_main.exe --cfg_file_path=./cfg/examples_cpp_pb_rpc_single_pkg_cfg.yaml
|
@ -15,7 +15,7 @@
|
||||
|
||||
#include "yaml-cpp/yaml.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_rpc::benchmark_rpc_client_module {
|
||||
namespace aimrt::examples::cpp::pb_rpc::benchmark_rpc_client_module {
|
||||
|
||||
std::string GenerateRandomString(int min_length, int max_length) {
|
||||
static constexpr std::string_view kChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
@ -403,4 +403,4 @@ co::Task<void> BenchmarkRpcClientModule::StartBenchPlan(
|
||||
co_return;
|
||||
}
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_rpc::benchmark_rpc_client_module
|
||||
} // namespace aimrt::examples::cpp::pb_rpc::benchmark_rpc_client_module
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "rpc.aimrt_rpc.pb.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_rpc::benchmark_rpc_client_module {
|
||||
namespace aimrt::examples::cpp::pb_rpc::benchmark_rpc_client_module {
|
||||
|
||||
class BenchmarkRpcClientModule : public aimrt::ModuleBase {
|
||||
public:
|
||||
@ -70,4 +70,4 @@ class BenchmarkRpcClientModule : public aimrt::ModuleBase {
|
||||
std::vector<BenchPlan> bench_plans_;
|
||||
};
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_rpc::benchmark_rpc_client_module
|
||||
} // namespace aimrt::examples::cpp::pb_rpc::benchmark_rpc_client_module
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "yaml-cpp/yaml.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_client_module {
|
||||
namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_client_module {
|
||||
|
||||
bool NormalRpcAsyncClientModule::Initialize(aimrt::CoreRef core) {
|
||||
core_ = core;
|
||||
@ -106,4 +106,4 @@ void NormalRpcAsyncClientModule::MainLoopFunc() {
|
||||
std::bind(&NormalRpcAsyncClientModule::MainLoopFunc, this));
|
||||
}
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_client_module
|
||||
} // namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_client_module
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include "rpc.aimrt_rpc.pb.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_client_module {
|
||||
namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_client_module {
|
||||
|
||||
class NormalRpcAsyncClientModule : public aimrt::ModuleBase {
|
||||
public:
|
||||
@ -44,4 +44,4 @@ class NormalRpcAsyncClientModule : public aimrt::ModuleBase {
|
||||
double rpc_frq_ = 1.0;
|
||||
};
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_client_module
|
||||
} // namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_client_module
|
@ -3,10 +3,10 @@
|
||||
|
||||
#include "normal_rpc_async_server_module/global.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_server_module {
|
||||
namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_server_module {
|
||||
|
||||
aimrt::logger::LoggerRef global_logger;
|
||||
void SetLogger(aimrt::logger::LoggerRef logger) { global_logger = logger; }
|
||||
aimrt::logger::LoggerRef GetLogger() { return global_logger; }
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_server_module
|
||||
} // namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_server_module
|
@ -5,9 +5,9 @@
|
||||
|
||||
#include "aimrt_module_cpp_interface/logger/logger.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_co_server_module {
|
||||
namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_server_module {
|
||||
|
||||
void SetLogger(aimrt::logger::LoggerRef);
|
||||
aimrt::logger::LoggerRef GetLogger();
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_co_server_module
|
||||
} // namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_server_module
|
@ -4,7 +4,7 @@
|
||||
#include "normal_rpc_async_server_module/normal_rpc_async_server_module.h"
|
||||
#include "normal_rpc_async_server_module/global.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_server_module {
|
||||
namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_server_module {
|
||||
|
||||
bool NormalRpcAsyncServerModule::Initialize(aimrt::CoreRef core) {
|
||||
core_ = core;
|
||||
@ -35,4 +35,4 @@ bool NormalRpcAsyncServerModule::Start() { return true; }
|
||||
|
||||
void NormalRpcAsyncServerModule::Shutdown() {}
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_server_module
|
||||
} // namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_server_module
|
@ -8,7 +8,7 @@
|
||||
#include "aimrt_module_cpp_interface/module_base.h"
|
||||
#include "normal_rpc_async_server_module/service.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_server_module {
|
||||
namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_server_module {
|
||||
|
||||
class NormalRpcAsyncServerModule : public aimrt::ModuleBase {
|
||||
public:
|
||||
@ -30,4 +30,4 @@ class NormalRpcAsyncServerModule : public aimrt::ModuleBase {
|
||||
std::shared_ptr<ExampleServiceAsyncServiceImpl> service_ptr_;
|
||||
};
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_server_module
|
||||
} // namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_server_module
|
@ -5,7 +5,7 @@
|
||||
#include "aimrt_module_protobuf_interface/util/protobuf_tools.h"
|
||||
#include "normal_rpc_async_server_module/global.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_server_module {
|
||||
namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_server_module {
|
||||
|
||||
void ExampleServiceAsyncServiceImpl::GetFooData(
|
||||
aimrt::rpc::ContextRef ctx,
|
||||
@ -33,4 +33,4 @@ void ExampleServiceAsyncServiceImpl::GetBarData(
|
||||
callback(aimrt::rpc::Status());
|
||||
}
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_server_module
|
||||
} // namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_server_module
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "rpc.aimrt_rpc.pb.h"
|
||||
|
||||
namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_server_module {
|
||||
namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_server_module {
|
||||
|
||||
class ExampleServiceAsyncServiceImpl : public aimrt::protocols::example::ExampleServiceAsyncService {
|
||||
public:
|
||||
@ -25,4 +25,4 @@ class ExampleServiceAsyncServiceImpl : public aimrt::protocols::example::Example
|
||||
std::function<void(aimrt::rpc::Status)>&& callback) override;
|
||||
};
|
||||
|
||||
} // namespace aimrt::examples::cpp::protobuf_rpc::normal_rpc_async_server_module
|
||||
} // namespace aimrt::examples::cpp::pb_rpc::normal_rpc_async_server_module
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user