Skip to content

Software

Adaptive Bridge

From github.com/KaushalrajPuwar/adaptive-bridge (opens in a new tab)

  • Middleware
  • Tool
  • Apache-2.0

A ROS 2 proxy that splits each topic into critical and noncritical streams, so a slow subscriber no longer stalls the publisher or other consumers.

Facts

GitHub stars
3read on 27 Nov 2026
Last update
30 Sept 2026Newest commit on main
Maintenance
Activea commit in the last 90 days
Difficulty
Advanced
Hardware it needs, as the project states it
ROS 2 Jazzy on Ubuntu 24.04 with Python 3.12 or newer; Docker is needed only for the evaluation harness.

Checked on GitHub on 27 Nov 2026.

Licenses

Code
Apache-2.0 (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (Apache-2.0) at commit da1288e (opens in a new tab), on 16 Oct 2026.

Commercial use
Yes

At a glance

What it is
  • Subscribes to an input topic and republishes each message onto separate critical and noncritical output topics.
  • Probes subscriber health (round-trip time, loss, jitter) and classifies consumers with a state machine using hysteresis.
  • Applies per-topic policies such as token-bucket rate limiting, stale-drops and queue-overflow drops when a consumer degrades.
  • Includes a safety supervisor that switches the global mode on queue pressure, callback lag or internal errors.
  • Publishes structured JSON diagnostics at 1 Hz and optionally signs classifier control messages with HMAC.
  • Ships a Docker-based evaluation harness that runs baseline-vs-bridge experiments under bursty packet loss using tc/netem.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
Apache-2.0. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's README (opens in a new tab)
Maintenance
Active, last commit on 30 Sept 2026.

Use it

How to install it, in the creator's words: The project's README (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit da1288e

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by @KaushalrajPuwar, at commit da1288e, under Apache-2.0 (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

In ROS 2 based systems, every subscriber on a topic is coupled to every other subscriber through the DDS writer's shared history cache. When one subscriber falls behind, perhaps because it is connected over a degraded WiFi link, the entire write pipeline backs up. The publisher stalls, and every consumer of that topic, including safety-critical ones, suffers the same delay. Traditional QoS tuning, such as switching to BEST_EFFORT, helps only at the margins; it does not break the structural coupling between subscribers with fundamentally different latency requirements.

Adaptive Bridge solves this by inserting a lightweight proxy between the publisher and its subscribers. The proxy subscribes to the original topic and republishes each message onto two separate output topics: one for critical consumers and one for noncritical or degraded consumers. A classifier monitors subscriber health through active probes and adjusts per-topic rate limits and drop policies in real time. The critical path is preserved regardless of what happens on the noncritical side. This decoupling means that a visualisation node on a congested WiFi link can experience packet loss and rate limiting without affecting a safety-critical navigation node on the same data stream.


Table of Contents

Features
FeatureDescription
Topic splittingAny configured input topic → dual output topics (critical and noncritical)
Generic message typesWorks with any ROS 2 message type (LaserScan, Image, Imu, PointCloud2, custom types)
Real-time classificationActive probe-based subscriber health monitoring (RTT, loss, jitter) with configurable thresholds
State machineUNKNOWN → CRITICAL ↔ NONCRITICAL with hysteresis, flap suppression, and forced overrides
Policy-driven degradationToken-bucket rate limiting, stale-drops, queue-overflow drops, mode-based policies (NORMAL / DEGRADED / DISABLED / FAILURE)
Dual-vendor DDSFully tested on both Fast DDS (eProsima) and Cyclone DDS (Eclipse)
ObservabilityStructured JSON diagnostics payload at 1 Hz with monotonic sequence numbers
Safety supervisorGlobal mode machine (EMERGENCY / FAILURE) triggered by queue pressure, callback lag, internal error counts
SecurityOptional HMAC signing + replay protection for classifier control-plane signals
Evaluation harnessDocker-based reproducible experiments with Gilbert-Elliot bursty loss (tc/netem), one-command runner, and automated plots

Architecture Overview
flowchart TB
    subgraph Bridge["Adaptive Bridge"]
        direction TB
        Proxy["Proxy Node
            ─────────────
            • Pre-created pub/sub
            • Policy engine
            • Rate limiter"]
        Classifier["Classifier Node
            ─────────────
            • Probe-based health
            • State machine
            • Hysteresis"]
    end

    subgraph Publisher["Publisher"]
        P["Publisher
            (30 Hz)"]
    end

    subgraph Consumers["Consumers"]
        Critical["Critical Consumer
            ─────────────
            e.g. navigation"]
        Degraded["Degraded Consumer
            ─────────────
            e.g. viz over WiFi"]
    end

    P -- "/topic" --> Proxy
    Proxy -- "/critical" --> Critical
    Proxy -- "/noncritical" --> Degraded
    Proxy -. "subscriber health" .-> Classifier

Key design rule: All publishers are pre-created at startup and never recreated at runtime. Topic routes are frozen after initialization.


Prerequisites
  • ROS 2 Jazzy (Ubuntu 24.04 / Noble)
  • Python 3.12+
  • Colcon build system
  • Docker (for evaluation harness)
  • Python packages: pyyaml, matplotlib, numpy

Installation
Binary package (recommended)

If you have ROS 2 Jazzy installed from the official ROS 2 repositories:

sudo apt update
sudo apt install ros-jazzy-adaptive-bridge

Then source the ROS 2 environment:

source /opt/ros/jazzy/setup.bash

Verify the installation:

ros2 pkg prefix adaptive_bridge

The package is released for ROS 2 Jazzy as version 0.1.0.

Source installation

For development, modification, or using the latest source from GitHub:

# Create a ROS 2 workspace
mkdir -p ~/adaptive_bridge_ws/src
cd ~/adaptive_bridge_ws/src

# Clone the repository
git clone https://github.com/KaushalrajPuwar/adaptive-bridge.git

# Build
cd ~/adaptive_bridge_ws
source /opt/ros/jazzy/setup.bash
colcon build --packages-select adaptive_bridge

# Source the workspace
source install/setup.bash

Verify the source installation:

ros2 pkg prefix adaptive_bridge
Docker (for evaluation experiments)

The evaluation harness uses Docker and is separate from the normal ROS 2 package installation:

cd eval
sudo docker build -t adaptive_bridge_eval:latest -f docker/Dockerfile .

Quickstart
# Launch the full bridge stack (proxy + classifier)
ros2 launch adaptive_bridge test_bridge.launch.py

# In another terminal, check the classifier state
ros2 topic echo /adaptive_bridge/classifier/state

# In another terminal, check diagnostics
ros2 topic echo /adaptive_bridge/diagnostics

This starts the proxy with one configured topic (/scan → /adaptive_bridge/critical/scan + /adaptive_bridge/noncritical/scan) and the classifier at 2 Hz evaluation rate.


Configuration

The bridge is configured via a single YAML file. Three example profiles are provided:

# config/default.yaml: Full-featured: classifier on, probes 5 Hz
# config/minimal.yaml: Lightweight: lower resource usage
# config/stress.yaml: High-throughput: faster evaluation, tighter safety

Key configuration sections:

SectionPurpose
topicsTopic routes (input, critical output, noncritical output, message type)
qos_profilesNamed QoS templates (reliability, history, depth, durability)
classifierProbe-based health monitoring thresholds (RTT, loss, hysteresis)
probesActive probe protocol parameters (rate, timeout, window)
routing_policyPer-mode policies: normal, degraded, disabled, emergency, failure
safetySafety supervisor configuration (queue limits, overload behaviour)
securityHMAC signing and replay protection
diagnosticsDiagnostics publishing interval and verbosity

Custom config:

ros2 launch adaptive_bridge adaptive_bridge.launch.py config_path:=/path/to/your/config.yaml

Running the Evaluation Harness

A self-contained evaluation workspace lives at eval/. It runs reproducible baseline-vs-adaptive experiments under a Gilbert-Elliot bursty loss channel model using Docker containers and tc/netem.

cd eval

# Build the Docker image (one-time)
sudo docker build -t adaptive_bridge_eval:latest -f docker/Dockerfile .

# Run a clean baseline (60 s smoke test)
sudo python3 scripts/run_experiment.py \
    --scenario baseline_clean \
    --duration 60 \
    --skip-build

# Run an adaptive bridge experiment with impairment
sudo python3 scripts/run_experiment.py \
    --scenario bridge_moderate \
    --duration 180 \
    --skip-build

# Run on a different DDS vendor
sudo python3 scripts/run_experiment.py \
    --scenario bridge_moderate \
    --rmw rmw_cyclonedds_cpp \
    --skip-build

Available scenarios (defined in eval/scenarios.yaml):

ScenarioModeImpairmentDuration
baseline_cleanBaselineNone120 s
baseline_mildBaselineGE ~2.3%180 s
baseline_moderateBaselineGE ~7.1%180 s
baseline_strongBaselineGE ~9.2%180 s
bridge_cleanBridgeNone120 s
bridge_mildBridgeGE ~2.3%180 s
bridge_moderateBridgeGE ~7.1%180 s
bridge_strongBridgeGE ~9.2%180 s
bridge_toggleBridgeToggle moderate240 s
ablation_no_classifierBridgeGE ~7.1%180 s

Each run produces a structured results directory with CSVs, summary statistics, and plots:

results/YYYY-MM-DD_HH-MM-SS_<scenario>/
├── run_metadata.yaml      # Scenario, RMW, git commit, duration
├── system_info.yaml       # CPU, RAM, kernel, Docker version
├── metrics/               # CSV files: latency, throughput, drops, classifier
├── logs/                  # Docker container logs
├── raw/                   # tc rules, filters (qdisc state)
├── plots/                 # CDFs, time series, classifier timeline
└── summary/               # Stats, table, human-readable report

RMW Compatibility

Adaptive Bridge is tested on both major ROS 2 DDS implementations:

RMWSupportNotes
Fast DDS (eProsima)✅ FullDefault RMW. Pre-production tested with explicit max_samples=200 XML profile
Cyclone DDS (Eclipse)✅ FullTested with AllowMulticast=spdp for unicast data to enable tc/IP-based impairment. Uses byte-based WHC watermarks instead of Fast DDS's sample-count limits

Key behavioural differences documented (see docs/17_RMW_COMPATIBILITY_MATRIX.md):

AspectFast DDSCyclone DDS
publish() under backpressureReturns error immediately (non-blocking)Blocks until WHC drains
Writer pool limitmax_samples=200 (sample-count via XML)WhcHigh=600kiB (byte-based, native)
Retransmission strategyAggressive heartbeat-based (1.3M pkts/run)Conservative NACK-based (28K pkts/run)
Data distribution defaultUnicastMulticast (requires config change for tc filters)

Components Reference
ComponentFileDescription
Proxy Nodeproxy_node.pyCore bridge: subscribes to input topics, publishes dual critical/noncritical streams, enforces policy
Classifier Nodeclassifier_node.pyROS wrapper around the classifier core: probes subscriber health, publishes state
Classifier Coreclassifier_core.pyPure-Python state machine (UNKNOWN/CRITICAL/NONCRITICAL) with hysteresis
Diagnosticsdiagnostics.pySchema-versioned diagnostics payload with 1 Hz publishing
Policy Enginepolicy_engine.pyMaps classifier decisions → per-topic policy modes
Noncritical Policynoncritical_policy.pyToken-bucket rate limiter, stale drops, queue-overflow drops
Safety Supervisorsafety_supervisor.pyGlobal mode machine (NORMAL/DEGRADED/EMERGENCY/FAILURE)
Config Managerconfig_manager.pyYAML loading, schema validation, typed getters
QoS Managerqos_manager.pyNamed QoS profile resolution with three-tier fallback
Topic Registrytopic_registry.pyDeterministic topic-route builder, uniqueness enforcement
Probe Utilitiesutils/probes.pyActive probe client/responder, windowed metrics
Securityutils/security.pyHMAC signing + replay protection for control signals

Development
# Full clean build
rm -rf build install log
colcon build --packages-select adaptive_bridge
source install/setup.bash

# Run all tests (183+ tests, 0 failures expected)
colcon test --packages-select adaptive_bridge
colcon test-result --verbose

# Run pure unit tests only (no ROS graph)
pytest -q src/tests
Code Structure
src/adaptive_bridge/
├── adaptive_bridge/          # Core package
│   ├── proxy_node.py          ─ Main proxy
│   ├── classifier_node.py     ─ Classifier ROS wrapper
│   ├── classifier_core.py     ─ Classifier state machine
│   ├── config_manager.py      ─ Config loader
│   ├── config_types.py        ─ Typed config models
│   ├── qos_manager.py         ─ QoS resolution
│   ├── policy_engine.py       ─ Classifier → mode mapper
│   ├── noncritical_policy.py  ─ Rate limiter
│   ├── safety_supervisor.py   ─ Global mode machine
│   ├── diagnostics.py         ─ Diagnostics collector
│   ├── topic_registry.py      ─ Route builder
│   ├── models.py              ─ Shared data models
│   └── utils/
│       ├── probes.py          ─ Active probe client/responder
│       └── security.py        ─ HMAC signing
├── config/                    # Example YAML configs
├── launch/                    # ROS 2 launch files
└── test/                      # Lint tests
eval/                          # Evaluation workspace (Docker + tc/netem)
docs/                          # Architecture, design, results

Troubleshooting
SymptomCauseSolution
Containers not startingDocker daemon overloadWait 30 s and retry; add --skip-build to avoid image rebuild
No impairment visibleSHM enabled (default on some DDS configs)Ensure XML profile disables SHM. See fastdds_profiles.xml or cyclonedds_profiles.xml
Classifier shows UNKNOWNNo probe data receivedCheck probe responder is running; verify topic names match
Bridge not forwardingConfig file not foundPass absolute path via config_path:= parameter
Tests failingWS1 install not sourcedRun source install/setup.bash first
CYCLONEDDS_URI not workingURI format incorrectUse file:///absolute/path/to/file.xml with triple /// prefix

Contributing

Contributions are welcome post-development. See CONTRIBUTING.md (opens in a new tab) for guidelines on code standards, pull requests, and the development workflow.


License

Licensed under the Apache License 2.0. See LICENSE (opens in a new tab) for the full text.

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.