Skip to main content

Robot-to-Robot (R2R) Communication Protocol SDK in Python

Project description

Build Status PyPI version PyPI - Downloads

🤖 Robot-to-Robot (R2R) 🤖 Communication Protocol

R2R Protocol Banner

A standardized communication protocol for autonomous robots to exchange data, coordinate tasks, and collaborate in real-time environments.

License

The R2R Protocol enables seamless robot-to-robot interaction across industrial automation, swarm robotics, logistics, and multi-agent systems. It defines structured message formats, negotiation logic, discovery mechanisms, and extensible APIs.

R2R Protocol DifferentRobots

🧩 Features

✅ Structured JSON/Protobuf messaging

✅ Supports TCP/IP, UDP, MQTT, WebSocket

✅ Task negotiation (auction, consensus)

✅ Status & telemetry updates

✅ Optional authentication

✅ Extensible via plugins/modules

✅ Docker-ready

✅ GitHub Actions CI/CD integration

✅ Python SDK published on PyPI

📦 SDKs

Language Status Directory
🐍 Python ✅ Stable sdk/python
🦀 Rust ⏳ Coming Soon
🖥️ C++ ⏳ Coming Soon
🐹 Go ⏳ Coming Soon
🌐 JavaScript ⏳ Coming Soon

Want to contribute an SDK in your favorite language? Check out the contributing guide.

r2r-protocol System Architecture :

+-------------------+ | Monitoring UI | | (Optional Web App)| +--------+----------+ | | (HTTP/WebSocket) v +--------+----------+ +----------------------+ | Coordinator Server |<--->| Authentication Module| | - Task Assignment | | - Token/Cert Support | | - Robot Discovery | | - TLS Encryption | | - Negotiation Hub | +-----------+----------+ +--------+----------+ | | | | (WebSocket/TCP/MQTT) | v v +--------+----------+ +-----------+----------+ | Robot A | | Robot B | | - robot_id: bot_01 | | - robot_id: bot_02 | | - Capabilities | | - Capabilities | | - Status Updates | | - Task Execution | +--------+------------+ +----------+-----------+ | | | Send/Receive Messages | v v +--------+----------------------------+----------+ | Transport Layer | | - TCP/IP, UDP, WebSocket, MQTT, ROS2 (future) | +------------------+------------------------------+ | v +------------------+------------------------------+ | Message Processing Layer | | - Validate JSON/Protobuf | | - Route messages by type | | - Handle negotiation, commands, status updates | +-------------------------------------------------+ | v +------------------+------------------------------+ | SDK / Client Library | | - Python SDK (r2r-protocol package) | | - Easy-to-use APIs for sending/receiving | | - Docker-ready image for testing/deployment | +-------------------------------------------------+

📘 Documentation

See the full Protocol Specification.

🚀 Quick Start (Python SDK)

🔧 Install from PyPI

pip install r2r-protocol
from r2r_protocol import RobotClient

# Connect to R2R server
client = RobotClient(robot_id="bot_01", host="192.168.1.10")

# Send status update
client.send_status({
    "battery": 85,
    "position": {"x": 10.2, "y": 5.1},
    "task_progress": 0.75
})

🐳 Run with Docker

You can run the R2R SDK in a Docker container:

docker build -t r2r-sdk .
docker run -it r2r-sdk

This will start a sample client instance and verify that the SDK works.

⚙️ Development Setup

To contribute or extend the protocol:

  1. Clone the repo
git clone https://github.com/Tech-Parivartan/r2r-protocol.git 
cd r2r-protocol
  1. Set up Python environment
cd sdk/python
pip install -e .
  1. Install test dependencies
pip install pytest

🧪 Running Tests

Run unit tests using:

cd tests
python -m pytest test_messages.py

🛠️ Contributing

We welcome contributions! Please read our here to get started.

Ways to Help

  • Report bugs and suggest features
  • Write more comprehensive tests
  • Improve documentation and architecture diagrams
  • Build example applications and integrations

Please open an issue before submitting a PR so we can align on scope.

📜 License

The r2r-protocol is an open-source project by Tech Parivartan, under the Apache License 2.0. See the LICENSE file for details.

📬 Feedback & Support

Have questions, feature requests, or want to share how you're using R2R-Protocol?

Upcoming Features

  • Enhanced security features
  • Visualization tools for monitoring robot interactions
  • Support for more programming languages
  • Improved error handling and logging
  • Integration with popular robotics frameworks (ROS, OpenRAVE)

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

r2r_protocol-2.0.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

r2r_protocol-2.0.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file r2r_protocol-2.0.0.tar.gz.

File metadata

  • Download URL: r2r_protocol-2.0.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for r2r_protocol-2.0.0.tar.gz
Algorithm Hash digest
SHA256 aa33bc176b62e85228935aa4ba721a04b0d04689aa708973b3e429dd89c2af2d
MD5 c645fa18ddf0d93033cd38f2df3a4819
BLAKE2b-256 02926ab6214bcbe88696d670195f03919c95dd25cd5a57a0cd91c36496116e71

See more details on using hashes here.

File details

Details for the file r2r_protocol-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: r2r_protocol-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for r2r_protocol-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dfed72627fc7176ba793386e99e198b3a78707fc1508e164b6aff9525d0efe06
MD5 876bfaefe3457bc8ee7faac78715d7e7
BLAKE2b-256 3ba7a686a3494b6d064adc32f4c4417e70e335e2a79f3ef5f74014d6fd188fda

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