Skip to main content
SpireMS logo

SpireMS

介绍

Spire消息系统,一个类似ROS的轻量化消息发布、订阅软件包,支持图像、雷达等传感器话题。

  1. 完美适配 Windows 和 Linux 系统,以及 C++、Python、Anaconda 的各类版本

  2. 一键部署安装,轻量化

  3. 可预先定义基础数据类型,也可以灵活适应新的类型

  4. 有中心模式,内置防崩溃机制,通信稳定可靠,没有订阅者不占用带宽

  5. Linux 系统下默认开启内存共享,图像传输超低延迟

    数据分发性能测试

具体内容请参考:SpireMS使用手册

安装教程

Python安装

  1. 安装(命令行执行)
pip install spirems
  1. 引入(Python代码)
from spirems import Subscriber, Publisher, def_msg

C++安装(Ubuntu系统)

  1. 依赖项安装,如果已经安装cmake、opencv则可以忽略以下2行
sudo apt update
sudo apt -y install cmake libopencv-dev
  1. 源码安装
git clone https://gitee.com/jario-jin/spirems.git
cd spirems/spirems_cpp
mkdir build && cd build
cmake ..
sudo make install
  1. 在自己项目的CMakeLists.txt中引入SpireMS
find_package(SpireMS REQUIRED)
include_directories(${SpireMS_INCLUDE_DIRS})
target_link_libraries(YourAppName ${SpireMS_LIBS})

使用说明

Python使用说明

  1. 启动Core服务
smscore
  1. 发布话题
from spirems import Publisher, def_msg
import time
pub = Publisher('/topic/hello', 'std_msgs::String')
msg = def_msg('std_msgs::String')
while True:
    msg['data'] = 'hello world!'
    pub.publish(msg)
    time.sleep(1)
  1. 订阅话题
from spirems import Subscriber

def callback_f(msg):
    print(msg['data'])

sub = Subscriber('/topic/hello', 'std_msgs::String', callback_f)

C++使用说明

  1. 启动Core服务(命令行方式,也可以用Python中的启动方式,启动一次即可)
smscore
  1. 发布话题
#include <sms_core.h>

int main(int argc, char *argv[])
{
    sms::Publisher pub("/topic/hello", "std_msgs::String");
    nlohmann::json msg = sms::def_msg("std_msgs::String");
    
    while (true)
    {
        msg["data"] = "hello world!";
        pub.publish(msg);
        sleep(1);
    }
}
  1. 订阅话题
#include <sms_core.h>

void callback(nlohmann::json msg)
{
    std::cout << msg["data"] << std::endl;
}

int main(int argc, char *argv[])
{
    sms::Subscriber sub("/topic/hello", "std_msgs::String", callback);
    sub.join();
    return 0;
}

命令行控制

  1. 显示所有话题
sms list
  1. 打印话题
sms echo /topic/hello
  1. 打印话题频率
sms hz /topic/hello
  1. 打印参数服务器所有参数
smsparam list
  1. 在线更新参数
smsparam set param_key param_value
  1. 导出所有参数
smsparam export output.json

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

Metadata

Release files for spirems 0.8.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for spirems 0.8.6
File Interpreter ABI Platform
spirems-0.8.6-py3-none-any.whl Python 3 none any Details

Release files / spirems-0.8.6-py3-none-any.whl

Download URL spirems-0.8.6-py3-none-any.whl
Size 1.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
d97c1b17764b834eeb05c6b6ac478457138b8ae37e00d610562320322b89fdcd
BLAKE2b-256 checksum
How to use checksums
47a7a1eda6595b45a3b427190236c6c63d62ae09f4bf0893996fa0dba4738148
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.10

Release history Release notifications | RSS feed

This release

0.8.6 This release

1 release file

0.8.3

1 release file

0.8.2

1 release file

0.8.1

1 release file

0.7.5

1 release file

0.4.6

1 release file

0.4.5

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.9

1 release file

0.3.7

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.9

1 release file

0.2.7

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page