Skip to main content

RoboSAPIENS Adaptive Platform (RAP)

The RoboSAPIENS Adaptive Platform (RAP) is a middleware framework for building self-adaptive robotic systems. It provides a structured runtime for implementing the MAPLE-K (Monitor, Analysis, Plan, Legitimate, Execute – Knowledge) autonomic control loop, enabling robotic applications to continuously observe their environment, reason about their state, and adapt their behavior at runtime — without human intervention.

RAP is developed as part of the RoboSAPIENS project, a European research initiative focused on trustworthy and self-adaptive human-robot systems. It is designed to be use-case agnostic: the same platform powers different RoboSAPIENS applications, from swarm robotics to human-robot collaboration scenarios.


rpclpy — Python Client Library for RAP

rpclpy is the official Python client library for RAP. It gives developers the building blocks to implement MAPLE-K loop nodes as distributed Python processes that communicate via events and messages, and share context through a common Knowledge base.

Python Redis PyPI

MAPLE-K Loop in RoboSAPIENS


┌──────────────────────────────────────────────────────────────────┐
│                     MAPLE-K Loop (RAP)                           │
│                                                                  │
│   ┌─────────┐   ┌─────────┐   ┌──────┐   ┌───────────┐           │
│   │ Monitor │──►│Analysis │──►│ Plan │──►│ Legitimate│──┐        │
│   └─────────┘   └─────────┘   └──────┘   └───────────┘  │        │
│                                                         ▼        │
│                                                    ┌─────────┐   │
│                                                    │ Execute │   │
│                                                    └─────────┘   │
│                                                                  │
│  ─────────────────────── Knowledge ──────────────────────────    │
└──────────────────────────────────────────────────────────────────┘

Each MAPLE-K element runs as an independent Node built with rpclpy. Nodes share state via the Knowledge layer, and coordinate transitions via Events and Messages — all managed through a distributed, multi-protocol communication backend.

Features

  • Node Communication: Publish/subscribe messaging and events with automatic metadata
  • Knowledge Management: Distributed key-value storage with object serialization
  • Redis Integration: Fast, reliable backend for all operations across multiple databases
  • Real-time Communication: Event-driven architecture with thread-safe operations
  • Flexible Protocols: Redis, MQTT, RabbitMQ, Kafka, WebSocket, TCP, Zenoh
  • Multiple Knowledge Backends: Redis, Memcached, Ignite, Hazelcast, Tarantool, Aerospike, SQLite
  • Logging & Monitoring: Built-in structured logging with configurable levels (terminal, file, MQTT, Redis)
  • UUID & Timestamps: Automatic message identification and timestamping
  • Dashboard: Built-in web dashboard via Dash for real-time monitoring

Installation

pip install rpclpy

Install optional extras based on what you need:

pip install rpclpy[mqtt]       # MQTT protocol / logging
pip install rpclpy[kafka]      # Kafka protocol / backend
pip install rpclpy[rabbitmq]   # RabbitMQ protocol
pip install rpclpy[websocket]  # WebSocket protocol
pip install rpclpy[dashboard]  # Web dashboard (Dash + Plotly)
pip install rpclpy[all]        # Everything

Repository Structure

rpclpy/
├── __init__.py               # Library entry point
├── node.py                   # Main Node class
├── CommunicationManager.py   # Multi-protocol pub/sub
├── KnowledgeManager.py       # Knowledge storage backends
├── LoggingAndTracking.py     # Logging infrastructure
├── DashboardApp.py           # Web monitoring dashboard
└── utils.py                  # Utility decorators

Prerequisites

  • Python 3.8+
  • Redis 6.0+ running on localhost:6379

Install Redis:

# Ubuntu/Debian
sudo apt update && sudo apt install redis-server
sudo systemctl start redis-server

# macOS
brew install redis && brew services start redis

# Docker
docker run --name redis-server -p 6379:6379 -d redis

Configuration

rpclpy is fully configuration-driven via a YAML file. Redis databases are separated by concern:

  • DB 0: Events (pub/sub)
  • DB 1: Messages (pub/sub)
  • DB 2: Knowledge (key-value)
Logger_Config:
  log_level: "INFO"
  format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
  logger_type: "terminal"   # terminal | file | mqtt | redis

Event_Manager_Config:
  protocol: "redis"
  host: "localhost"
  port: 6379
  db: 0

Message_Manager_Config:
  protocol: "redis"
  host: "localhost"
  port: 6379
  db: 1

Knowledge_Config:
  knowledge_type: "redis"
  host: "localhost"
  port: 6379
  db: 2

Local (in-process) mode — no broker required

For simulation, testing, or single-process deployments you can run an entire MAPLE-K loop without Redis (or any other broker) by selecting the local backend. All nodes in the process then share a global in-memory event bus and knowledge store. Event delivery is synchronous: publishing an event invokes the subscribed callbacks inline, so a single trigger drives the whole loop to completion before returning. Application code is unchanged — only the config differs:

Logger_Config:
  log_level: "INFO"
  format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
  logger_type: "terminal"

Event_Manager_Config:
  protocol: "local"

Message_Manager_Config:
  protocol: "local"

Knowledge_Config:
  knowledge_type: "local"

API Reference

Method Description
Node(config) Create a node from a config dict
node.start() Start event and message managers
node.shutdown() Stop all managers
node.publish_event(topic, data) Publish an event
node.register_event_callback(topic, fn) Subscribe to an event topic
node.publish_message(topic, data) Publish a direct message
node.register_message_callback(topic, fn) Subscribe to a message topic
node.write_knowledge(key, value) Store a value
node.read_knowledge(key) Retrieve a value

Architecture

Each node in the MAPLE-K loop is a separate rpclpy Node instance. They communicate in real time and share knowledge through a distributed backend.

  MAPLE-K Nodes (each is an rpclpy Node)

┌──────────┐  ┌──────────┐  ┌──────┐  ┌───────────┐  ┌─────────┐
│ Monitor  │  │ Analysis │  │ Plan │  │ Legitimate│  │ Execute │
└────┬─────┘  └────┬─────┘  └──┬───┘  └─────┬─────┘  └────┬────┘
     │             │           │            │             │
     └─────────────┴───────────┴────────────┴─────────────┘
                              Events / Messages
                                    │
                                    ▼
          ┌─────────────────────────────────────────────┐
          │               RAP Backend                   │
          │  ┌─────────┐  ┌─────────┐  ┌─────────────┐  │
          │  │ Events  │  │Messages │  │  Knowledge  │  │
          │  │ (DB 0)  │  │ (DB 1)  │  │   (DB 2)    │  │
          │  │ Pub/Sub │  │ Pub/Sub │  │  Key-Value  │  │
          │  └─────────┘  └─────────┘  └─────────────┘  │
          └─────────────────────────────────────────────┘

Use Cases — RAP Integration

1. PAL Robotics

2. NTNU Ship Navigation

3. DTI Screw Detection

4. TurtleBot


Troubleshooting

Redis connection failed:

redis-cli ping   # should return PONG
sudo systemctl start redis-server   # Linux
brew services start redis           # macOS

Import errors after install:

# Verify the install
python -c "import rpclpy; print(rpclpy.__version__)"

Version

Current version: 1.0.0

Changelog

  • v1.0.0 (2025-07-31): Initial release
    • Core node communication (events, messages, knowledge)
    • Multi-protocol support: Redis, MQTT, RabbitMQ, Kafka, WebSocket, TCP, Zenoh
    • Multiple knowledge backends
    • Thread-safe operations
    • Structured logging and web dashboard

Built with ❤️ by the RoboSAPIENS Team

For questions, support, or contributions, visit the GitHub repository.


License

This software is owned by The INTO-CPS Association and is available under the INTO-CPS License.

Metadata

Release files for rpclpy 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rpclpy 1.0.2
File Size Uploaded Provenance Actions
rpclpy-1.0.2.tar.gz 44.6 kB With provenance Details for rpclpy-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rpclpy 1.0.2
File Interpreter ABI Platform Actions
rpclpy-1.0.2-py3-none-any.whl Python 3 none any Details for rpclpy-1.0.2-py3-none-any.whl

Total release size: 82.4 kB

Release files / rpclpy-1.0.2.tar.gz

Download URL rpclpy-1.0.2.tar.gz
Size 44.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9047d4f90eda1143657b2f07d91db4cbf41bbb9dfca357767a5794f150845f9e
BLAKE2b-256 checksum
How to use checksums
a5bf915e666fe833bdb99a3c4f397ac1e17ebcf5fe403e5f29476a185180385e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Release files / rpclpy-1.0.2-py3-none-any.whl

Download URL rpclpy-1.0.2-py3-none-any.whl
Size 37.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c43cb276fea1bb3346831e2d70169842db0a0e35855432df1ba12a8737cdd79
BLAKE2b-256 checksum
How to use checksums
e5294ffcab6970c3ae36900172d3f821f904c0d4c8534e18ac708253efa0a82b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Security for rpclpy 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rpclpy-1.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page