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)
- Create msg file
- Edit CMakeLists.txt
- catkin_make
- Wait 5 minutes
- Fix build errors
- 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
PublisherandSubscriber - 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
- "Just works" - Minimal configuration, automatic discovery
- "Do one thing well" - Perfect communication only
- "Reliable by default" - TCP first, no packet loss
- "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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc667a40bbb0f2fd69ed6e6a46d8e6f6c6830059e030a5fe05a347029bf6b1b5
|
|
| MD5 |
7a1afc18d1589eff44a17315f4b93411
|
|
| BLAKE2b-256 |
428f9b524339a4c66bc4601ef45da98c908e32d90ce61b65f9bcad17b503f756
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48d934b284a26836cce67418da8b6675050cc778e7b164749f62461457dc2dd5
|
|
| MD5 |
239631499fd1b5147200e8979c1684be
|
|
| BLAKE2b-256 |
9c0f2c861b829420099de288a54896a56670c463919d46a43b1c38ba6b6d0c51
|