Metadata-Version: 2.4
Name: orion-bridge
Version: 2.0.0
Summary: ORION Lab Bridge — Modular device bridge for industrial robotics
Author-email: Leonardo <a01174639@tec.mx>
License: MIT
Project-URL: Homepage, https://github.com/FILL_USER/orion-bridge
Project-URL: Documentation, https://github.com/FILL_USER/orion-bridge#readme
Project-URL: Issues, https://github.com/FILL_USER/orion-bridge/issues
Project-URL: Source, https://github.com/FILL_USER/orion-bridge
Keywords: robotics,industrial,automation,xarm,abb,plc,ros2,mujoco,industry-4.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: System :: Hardware
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: websockets>=12.0
Requires-Dist: rich>=13.0
Provides-Extra: xarm
Requires-Dist: xarm-python-sdk; extra == "xarm"
Provides-Extra: abb
Provides-Extra: plc
Requires-Dist: python-snap7; extra == "plc"
Provides-Extra: gazebo
Requires-Dist: roslibpy; extra == "gazebo"
Provides-Extra: mujoco
Requires-Dist: mujoco>=3.5.0; extra == "mujoco"
Provides-Extra: supabase
Requires-Dist: supabase; extra == "supabase"
Provides-Extra: http
Requires-Dist: flask; extra == "http"
Provides-Extra: all
Requires-Dist: xarm-python-sdk; extra == "all"
Requires-Dist: python-snap7; extra == "all"
Requires-Dist: roslibpy; extra == "all"
Requires-Dist: mujoco>=3.5.0; extra == "all"
Requires-Dist: supabase; extra == "all"
Requires-Dist: flask; extra == "all"

# ORION Bridge

**Modular device bridge connecting industrial robotics hardware to the ORION AI agent platform.**

[![PyPI version](https://badge.fury.io/py/orion-bridge.svg)](https://pypi.org/project/orion-bridge/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

---

## What is ORION Bridge?

ORION Bridge is a lightweight Python daemon that sits between physical (or simulated) lab equipment and the [ORION agent platform](https://orion-learning.com). It speaks the hardware protocols — xArm SDK, Snap7 for Siemens S7-1200 PLCs, ABB Robot Web Services — and exposes a unified WebSocket interface that the ORION AI understands.

The bridge runs on any machine with network access to your devices: a lab PC next to the robot arm, a Raspberry Pi on the factory floor, or your laptop for simulation. Once running, ORION can read live telemetry, execute actions, and run multi-step routines through natural language — without any changes to your hardware configuration.

Supported hardware backends out of the box: **UFACTORY xArm 6/7** (physical + MuJoCo simulation), **ABB robots** (via Robot Web Services), **Siemens S7-1200 PLCs** (via python-snap7), and a **local shell** for scripting and debugging. A ROS/Gazebo adapter is also available for simulation-heavy workflows.

---

## Quick Start

```bash
pip install orion-bridge[all]
orion
```

The interactive menu guides you through device setup and server connection. No config file needed for the first run — it generates one for you.

---

## Installation Options

Install only the drivers you need:

| Command | Installs |
|---|---|
| `pip install orion-bridge` | Core only (WebSocket transport, CLI) |
| `pip install orion-bridge[xarm]` | + UFACTORY xArm SDK |
| `pip install orion-bridge[plc]` | + Siemens S7-1200 (python-snap7) |
| `pip install orion-bridge[mujoco]` | + MuJoCo simulation engine |
| `pip install orion-bridge[gazebo]` | + ROS/Gazebo (roslibpy) |
| `pip install orion-bridge[http]` | + PLC HTTP sidecar API (Flask) |
| `pip install orion-bridge[all]` | Everything above |

---

## First Run

```
$ orion
```

The CLI opens an interactive menu:

```
[1] Add device       — register an xArm, ABB, PLC, or shell device
[2] Remove device    — remove a device from the list
[3] Configure server — pick a lab preset or enter a custom server URL + token
[4] Show status      — display current devices and connection info
[5] Save config      — write lab_config.json to disk
[6] Save & Start     — save and launch the bridge
[0] Exit
```

**Typical first-run flow:**

1. Choose **3** to configure the server — pick a preset or enter your ORION server URL and bridge token.
2. Choose **1** to add devices — select the device type (xArm, ABB, PLC, shell) and provide the IP address.
3. Choose **6** to save the configuration and start the bridge.

The bridge connects to all registered devices, then opens a WebSocket to the ORION server. The ORION AI can now see your devices and send commands.

**Skip the menu with a saved config:**

```bash
orion --config lab_config.json
```

**Run without a server (local testing):**

```bash
orion --local
```

---

## Configuration

After the first run, configuration is saved to `lab_config.json` in your working directory. You can edit this file directly or regenerate it through the menu.

Example `lab_config.json`:

```json
{
  "server": "wss://your-orion-server/ws/robot",
  "token": "your-bridge-token",
  "lab_name": "My Lab",
  "devices": [
    { "type": "xarm", "id": "xarm-lab1", "ip": "192.168.1.185" },
    { "type": "plc",  "id": "plc-station1", "ips": ["192.168.1.10"] }
  ]
}
```

Environment variables override the config file:

| Variable | Purpose |
|---|---|
| `WS_SERVER_URL` | Override server WebSocket URL |
| `WS_TOKEN` | Override bridge authentication token |
| `BRIDGE_ID` | Override bridge identifier (default: `lab-bridge-01`) |

---

## MuJoCo Simulation

Install with `pip install orion-bridge[mujoco]` to use the built-in MuJoCo physics simulation. xArm 6 and xArm 7 MJCF models are included in the package.

```json
{
  "type": "xarm",
  "id": "xarm7-sim",
  "handler": "mujoco",
  "viewer": true,
  "mjcf_path": "sim/models/xarm7/scene_xarm7.xml"
}
```

Set `"viewer": true` to open the MuJoCo interactive viewer window.

---

## Requirements

- **Python**: 3.10 or higher
- **OS**: Windows 10/11, macOS 12+, Linux (Ubuntu 20.04+)
- **Network**: Access to device IPs and the ORION server endpoint

Hardware-specific requirements are installed via optional extras (see Installation Options above).

---

## License

MIT License — see [LICENSE](LICENSE) for details.

---

## Links

- **ORION Platform**: [orion-learning.com](https://orion-learning.com)
- **PyPI**: [pypi.org/project/orion-bridge](https://pypi.org/project/orion-bridge/)
- **Issues**: [github.com/FILL_USER/orion-bridge/issues](https://github.com/FILL_USER/orion-bridge/issues)
- **Source**: [github.com/FILL_USER/orion-bridge](https://github.com/FILL_USER/orion-bridge)
