Skip to main content

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.

PyPI Wheels platforms Downloads License

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.String
  • std_msgs.Int
  • std_msgs.Float
  • std_msgs.Bool
  • std_msgs.Header
  • geometry_msgs.Vector3
  • geometry_msgs.Vector3Stamped
  • geometry_msgs.Twist
  • geometry_msgs.Quaternion
  • geometry_msgs.Pose
  • geometry_msgs.PoseStamped
  • geometry_msgs.PoseWithCovariance
  • geometry_msgs.TwistWithCovariance
  • nav_msgs.Odometry
  • nav_msgs.Path
  • sensors_msgs.LaserScan
  • More to come...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zeroros-1.1.1.tar.gz (75.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zeroros-1.1.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file zeroros-1.1.1.tar.gz.

File metadata

  • Download URL: zeroros-1.1.1.tar.gz
  • Upload date:
  • Size: 75.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for zeroros-1.1.1.tar.gz
Algorithm Hash digest
SHA256 06601e1e2c0dbeead84cceec14107277c25581083541d0fb727c94fb9abb8682
MD5 f3124f38d2f99ae8deab497ba1eddfed
BLAKE2b-256 5831159f9a1289cf6202cb336ea6a523ef1149afb632be44814547e8e5335979

See more details on using hashes here.

File details

Details for the file zeroros-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: zeroros-1.1.1-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

Hashes for zeroros-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 52279bbf0520bff14138438b37b860c1e9b521600e38624e05b145177c491aba
MD5 5e622b53f185853aa7a06dfe4835367d
BLAKE2b-256 ace13bfbd0da5c035246d8ad737fb656203c6da116fd7accf6f67893b6bf82cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page