Skip to main content

Communication made insanely easy - A simple, fast, and reliable communication library for robotics

Project description

NitROS - Communication made insanely easy

Nitro + ROS - A simple, fast, and reliable communication library for robotics.

🎯 Why NitROS?

Before (ROS)

  1. Create msg file
  2. Edit CMakeLists.txt
  3. catkin_make
  4. Wait 5 minutes
  5. Fix build errors
  6. Write code

After (NitROS)

pip install nitros

Done in 3 lines of code! ✨

🚀 Quick Start

Basic Usage

from nitros import Publisher, Subscriber

# Publisher
pub = Publisher("topic_name")
pub.send({"x": 1, "y": 2.5})

# Subscriber
def callback(msg):
    print(msg)

sub = Subscriber("topic_name", callback)

Camera Streaming Example

Publisher:

import cv2
from nitros import Publisher

pub = Publisher("camera", compression="image")
cap = cv2.VideoCapture(0)

while True:
    ret, frame = cap.read()
    pub.send(frame)  # Done!

Subscriber:

import cv2
from nitros import Subscriber

def show(frame):
    cv2.imshow('Camera', frame)
    cv2.waitKey(1)

sub = Subscriber("camera", show)  # Done!

📦 Features

  • Zero configuration - Automatic peer discovery with mDNS
  • Type flexibility - Send dicts, lists, numpy arrays, PyTorch tensors
  • Built-in compression - JPEG for images (~10x), quantization+LZ4 for point clouds (~4-5x)
  • Reliable - TCP-based, guaranteed delivery
  • Simple API - Just Publisher and Subscriber
  • Fire and forget - send() never blocks, even without subscribers

📚 Data Types

Send anything

# Dict - just send it
pub.send({"x": 1, "y": 2.5})

# Numpy array - auto-detected
import numpy as np
pub.send(np.array([1, 2, 3]))

# PyTorch tensor - auto-detected
import torch
pub.send(torch.tensor([1, 2]))

Compression for large data

# Images - automatic JPEG compression (~10x reduction)
pub = Publisher("camera", compression="image")
pub.send(camera_frame)  # numpy array

# Point clouds - quantization + LZ4 (~4-5x reduction)
pub = Publisher("lidar", compression="pointcloud")
pub.send(point_cloud)  # numpy array

🔧 Installation

Basic (MessagePack only):

pip install nitros

Full installation (with all features):

pip install nitros[full]

Optional dependencies:

pip install nitros[compression]  # Image/pointcloud compression
pip install nitros[discovery]    # mDNS discovery
pip install nitros[numpy]        # Numpy support

🎨 Design Philosophy

  1. "Just works" - Minimal configuration, automatic discovery
  2. "Do one thing well" - Perfect communication only
  3. "Reliable by default" - TCP first, no packet loss
  4. "Progressive enhancement" - Start simple, advanced features when needed

📊 Comparison

vs ROS

✅ Learning curve: 5 minutes vs 5 hours ✅ No need to build msg files ✅ Minimal dependencies ✅ High reliability (TCP) ✅ Low resource usage

vs ZeroMQ

✅ Built-in compression (images, point clouds) ✅ Automatic discovery (no configuration needed) ✅ Automatic type detection ✅ Robotics-specialized

🛠️ Requirements

  • Python 3.7+
  • msgpack (required)
  • numpy (optional, for array support)
  • torch (optional, for tensor support)
  • opencv-python (optional, for image compression)
  • lz4 (optional, for pointcloud compression)
  • zeroconf (optional, for mDNS discovery)

📝 License

MIT License

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

nitros-0.1.0.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

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

nitros-0.1.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file nitros-0.1.0.tar.gz.

File metadata

  • Download URL: nitros-0.1.0.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.18

File hashes

Hashes for nitros-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fc667a40bbb0f2fd69ed6e6a46d8e6f6c6830059e030a5fe05a347029bf6b1b5
MD5 7a1afc18d1589eff44a17315f4b93411
BLAKE2b-256 428f9b524339a4c66bc4601ef45da98c908e32d90ce61b65f9bcad17b503f756

See more details on using hashes here.

File details

Details for the file nitros-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nitros-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.18

File hashes

Hashes for nitros-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48d934b284a26836cce67418da8b6675050cc778e7b164749f62461457dc2dd5
MD5 239631499fd1b5147200e8979c1684be
BLAKE2b-256 9c0f2c861b829420099de288a54896a56670c463919d46a43b1c38ba6b6d0c51

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