Skip to main content

Agent ROS Bridge - Universal ROS1/ROS2 bridge for AI agents to control robots and embodied intelligence systems

Project description

Agent ROS Bridge

Universal ROS1/ROS2 bridge for AI agents to control robots and embodied intelligence systems.

CI PyPI License


๐Ÿ” Security First

Required before running: Set a JWT secret for authentication.

# Generate a secure secret
export JWT_SECRET=$(openssl rand -base64 32)

See SECURITY.md for complete security guidelines.


Quick Start

Production (requires ROS1 or ROS2)

pip install agent-ros-bridge
python run_bridge.py  # Auto-detects ROS1 Noetic or ROS2 Humble/Jazzy

Demo/Testing (Local Only - No ROS Required)

โš ๏ธ Security Note: Mock mode disables authentication for testing. Only run on localhost.

# Bind to localhost only (secure for testing)
export BRIDGE_HOST=127.0.0.1
export MOCK_MODE=true

pip install agent-ros-bridge
python examples/quickstart/mock_bridge.py  # Simulated robot

Native ROS (Recommended for Development)

Install from PyPI (Recommended):

pip install agent-ros-bridge

# Run with native ROS
source /opt/ros/humble/setup.bash  # or noetic, jazzy
python run_bridge.py

Or install from source:

git clone https://github.com/webthree549-bot/agent-ros-bridge.git
cd agent-ros-bridge
pip install -e .

Dual ROS1 + ROS2 (simultaneous):

# Source both ROS environments
source /opt/ros/noetic/setup.bash
source /opt/ros/humble/setup.bash

# Run dual bridge
python run_bridge_dual_ros.py

See docs/NATIVE_ROS.md for detailed native installation.

Web Dashboard

# Start bridge (in another terminal)
cd examples/quickstart && ./run.sh

# Start dashboard
python dashboard/server.py
# Open http://localhost:8080 in browser

Fleet Orchestration (Multi-Robot)

# Start fleet orchestrator with 4 simulated robots
cd examples/fleet && ./run.sh

# Query fleet status
wscat -c ws://localhost:8771
> {"command": {"action": "fleet.status"}}
> {"command": {"action": "fleet.metrics"}}
> {"command": {"action": "fleet.submit_task", "parameters": {"type": "navigate", "target": "zone_a"}}}

Arm Robot Control (Manipulation)

# Control UR5 arm
cd examples/arm && ./run.sh --arm-type ur --demo pick_place

# Control xArm
cd examples/arm && ./run.sh --arm-type xarm

# Interactive control
cd examples/arm && ./run.sh --arm-type ur --demo interactive
# Then: wscat -c ws://localhost:8772

ROS Actions (Navigation, Planning)

# Navigation action demo
cd examples/actions && ./run.sh --action navigate

# Manipulation trajectory demo
cd examples/actions && ./run.sh --action manipulate

# Interactive action control
cd examples/actions && ./run.sh --action interactive
# Then: wscat -c ws://localhost:8773
# Send: {"command": {"action": "actions.navigate", "parameters": {"x": 5.0, "y": 3.0}}}

Prometheus Metrics (Monitoring)

# Start metrics server
cd examples/metrics && ./run.sh

# View metrics
curl http://localhost:9090/metrics

# For Grafana:
# 1. Import dashboards/grafana-dashboard.json
# 2. Add Prometheus data source: http://localhost:9090

Project Structure

agent-ros-bridge/                 # Repository root
โ”œโ”€โ”€ agent_ros_bridge/            # โญ Core source package
โ”‚   โ”œโ”€โ”€ gateway_v2/              # Main gateway implementation
โ”‚   โ”‚   โ”œโ”€โ”€ core.py              # Bridge class
โ”‚   โ”‚   โ”œโ”€โ”€ auth.py              # Authentication
โ”‚   โ”‚   โ”œโ”€โ”€ transports/          # Communication protocols
โ”‚   โ”‚   โ””โ”€โ”€ connectors/          # ROS connectors
โ”‚   โ”œโ”€โ”€ fleet/                   # Fleet orchestration
โ”‚   โ”œโ”€โ”€ plugins/                 # Robot plugins (arm, etc.)
โ”‚   โ”œโ”€โ”€ actions/                 # ROS actions support
โ”‚   โ””โ”€โ”€ metrics/                 # Prometheus metrics
โ”œโ”€โ”€ tests/                       # Test suite
โ”œโ”€โ”€ examples/                    # โญ Runnable examples (7 demos)
โ”‚   โ”œโ”€โ”€ quickstart/              #   Basic bridge usage
โ”‚   โ”œโ”€โ”€ fleet/                   #   Multi-robot coordination
โ”‚   โ”œโ”€โ”€ auth/                    #   JWT authentication
โ”‚   โ”œโ”€โ”€ mqtt_iot/                #   IoT sensor integration
โ”‚   โ”œโ”€โ”€ actions/                 #   ROS navigation/actions
โ”‚   โ”œโ”€โ”€ arm/                     #   Robotic arm control
โ”‚   โ””โ”€โ”€ metrics/                 #   Prometheus monitoring
โ”œโ”€โ”€ docs/                        # Documentation (40,000+ words)
โ”œโ”€โ”€ scripts/                     # Utility scripts
โ”œโ”€โ”€ config/                      # Configuration templates
โ”œโ”€โ”€ docker/                      # Docker containers
โ”œโ”€โ”€ dashboard/                   # Web dashboard
โ”œโ”€โ”€ Makefile                     # Build automation
โ””โ”€โ”€ pyproject.toml              # Package configuration

See Repository Structure for complete details.

Features

  • Multi-Protocol: WebSocket, gRPC, MQTT, TCP
  • Multi-Robot: Manage fleets of robots
  • Fleet Orchestration: Task allocation, load balancing, coordination
  • Arm Robot Control: UR, xArm, Franka manipulation support
  • ROS Actions: Navigation, motion planning, long-running tasks
  • Prometheus Metrics: Production monitoring with Grafana dashboards
  • Multi-ROS: Connect to multiple ROS1/ROS2 endpoints simultaneously
  • Dual ROS: Run ROS1 + ROS2 in the same bridge instance
  • Remote ROS: Connect to robots over the network
  • Plugin System: Build custom applications
  • ROS Support: ROS1 Noetic, ROS2 Humble/Jazzy/Iron
  • Cloud-Native: Docker, Kubernetes ready

Development

The repository maintains strict separation between source code and build artifacts:

# Clone and setup
git clone https://github.com/webthree549-bot/agent-ros-bridge.git
cd agent-ros-bridge

# Install in development mode
make install-dev

# Development workflow
make format      # Format code
make test        # Run tests
make check       # Lint + test

# Clean build artifacts
make clean       # Remove all generated files
make build       # Create wheel and sdist

See CONTRIBUTING.md and Repository Structure for details.

Documentation

Document Description
User Manual Complete guide (23,000+ words) - Installation, tutorials, troubleshooting
API Reference Full API docs - Classes, methods, examples
Native ROS Ubuntu/ROS installation and setup
Multi-ROS Fleet management and coordination
Docker vs Native Deployment strategy comparison
DDS Architecture ROS2/DDS relationship explained
Repository Structure Clean source/build separation

Quick Links:

Installation

Via PyPI

pip install agent-ros-bridge

Via ClawHub

openclaw skills add agent-ros-bridge

From Source

git clone https://github.com/webthree549-bot/agent-ros-bridge.git
cd agent-ros-bridge
pip install -e ".[dev]"

Usage

Python API

from agent_ros_bridge import Bridge
from agent_ros_bridge.transports.websocket import WebSocketTransport

bridge = Bridge()
bridge.transport_manager.register(WebSocketTransport({"port": 8765}))
await bridge.start()

CLI

agent-ros-bridge --demo
agent-ros-bridge --config ./config.yaml

License

MIT License


Made with โค๏ธ by the Agent ROS Bridge Team

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

agent_ros_bridge-0.2.2.tar.gz (106.8 kB view details)

Uploaded Source

Built Distribution

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

agent_ros_bridge-0.2.2-py3-none-any.whl (55.6 kB view details)

Uploaded Python 3

File details

Details for the file agent_ros_bridge-0.2.2.tar.gz.

File metadata

  • Download URL: agent_ros_bridge-0.2.2.tar.gz
  • Upload date:
  • Size: 106.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for agent_ros_bridge-0.2.2.tar.gz
Algorithm Hash digest
SHA256 2e8885a270f1e06acbd0b1758cceb8fdfef6ed186b10e2109ab3ffdabe52951a
MD5 674a3b2349cc53cd63f98fe5e4f592d8
BLAKE2b-256 4d045d745459cd6e6f8fbd3b86598dc530b0e84fa00310eb6aef46b9b43040ab

See more details on using hashes here.

File details

Details for the file agent_ros_bridge-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_ros_bridge-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b1bd2a85758a4fc31e5e743410fd90044931b6c3ae6ceebe86ffb08a1dee1482
MD5 37ab8c42621cc554baa15861b6e2c289
BLAKE2b-256 888add42ba07155c66f82266de99dcd4b6677ac38aa7f2d5bd6aa5e2c3f24eb1

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