ZeroROS middleware
Project description
Zero-dependency ROS-like middleware for Python
This library is intended to be used for small projects that require a simple middleware for communication between processes. It is not intended to be a replacement for ROS.
Why ZeroROS?
See these discussions in ROS Discourse and this one in reddit/ROS.
Installation
Use pip to install the library:
pip install zeroros
Usage
The library is composed of three main classes: Publisher, Subscriber and
MessageBroker.
MessageBroker
The MessageBroker class is used to create a message broker that can be used by
publishers and subscribers to communicate with each other.
from zeroros import MessageBroker
broker = MessageBroker()
Publisher
The Publisher class is used to publish messages to a topic. The constructor takes two
arguments: the topic name and the message type. The topic name is a string, while the
message type is a Python class. The message type is used to serialize and deserialize
messages.
from zeroros import Publisher
pub = Publisher("topic_name", String)
pub.publish("Hello world!")
Subscriber
The Subscriber class is used to subscribe to a topic and receive messages. The constructor
takes two arguments: the topic name and the message type. The topic name is a string, while
the message type is a Python class. The message type is used to serialize and deserialize
messages.
import time
from zeroros import Subscriber
def callback(msg):
print(msg)
sub = Subscriber("topic_name", String, callback)
while True:
# Do something else
time.sleep(1)
# Stop the subscriber
sub.stop()
Messages
The library comes with a few built-in messages that can be used out of the box. The following messages are available:
std_msgs.Stringstd_msgs.Intstd_msgs.Floatstd_msgs.Boolstd_msgs.Headergeometry_msgs.Vector3geometry_msgs.Vector3Stampedgeometry_msgs.Twistgeometry_msgs.Quaterniongeometry_msgs.Posegeometry_msgs.PoseStampedgeometry_msgs.PoseWithCovariancegeometry_msgs.TwistWithCovariancenav_msgs.Odometrynav_msgs.Pathsensors_msgs.LaserScan- More to come...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zeroros-1.1.0.tar.gz.
File metadata
- Download URL: zeroros-1.1.0.tar.gz
- Upload date:
- Size: 75.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02eef2bbcccbfae58acb2a1f7b1d3fa27003c159c9429e751ca4e1b3b1f45c9f
|
|
| MD5 |
7d4f6d91d096b2329b32ce0a6114e802
|
|
| BLAKE2b-256 |
8e3d1ac01ce9a782ece48cef29b9387c5c04d70b3f933766d930577afd2de591
|
File details
Details for the file zeroros-1.1.0-py3-none-any.whl.
File metadata
- Download URL: zeroros-1.1.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1eed0d69e849da08c196a26b42b6a239b01807d6c2c451e6bfd4edaf54402b53
|
|
| MD5 |
3c88644b045b4ad7797a3a5a3c15df41
|
|
| BLAKE2b-256 |
5a83f5e803aff516a4a2cd01cdfc21278109d2ee873cf6b0619f5fdf0484fc3c
|