# Supported Robot Connection Types in GlobalConfig: WebRTC, Simulation, and Replay

> Explore supported robot connection types in DimOS GlobalConfig: WebRTC for live hardware, MuJoCo for simulation, and Replay for recorded data. Learn how to configure your robot connections.

- Repository: [Dimensional/dimos](https://github.com/dimensionalOS/dimos)
- Tags: documentation
- Published: 2026-03-15

---

**DimOS supports three robot connection types in GlobalConfig—WebRTC for live hardware, MuJoCo for physics simulation, and Replay for recorded data—controlled by the `unitree_connection_type` property.**

The DimOS framework provides a unified configuration interface for robot interactions through the `GlobalConfig` class. This centralized system allows developers to switch between physical robot control, simulation environments, and historical data replay by configuring supported robot connection types in GlobalConfig.

## How GlobalConfig Determines the Connection Type

The connection type resolution logic is encapsulated in the `unitree_connection_type` property defined in [`dimos/core/global_config.py`](https://github.com/dimensionalOS/dimos/blob/main/dimos/core/global_config.py). This property evaluates Boolean flags to return a string identifier that downstream components use to instantiate the appropriate transport layer.

The resolution follows a strict priority hierarchy:

- **`"replay"`**: Returned when `GlobalConfig.replay` is `True`. The system loads recorded sensor datasets from `GlobalConfig.replay_dir` instead of connecting to live hardware.
- **`"mujoco"`**: Returned when `GlobalConfig.simulation` is `True` and replay is disabled. This initializes a MuJoCo physics simulation environment.
- **`"webrtc"`**: Returned when both flags are `False`. This establishes a real-time connection to physical Unitree robots using the `unitree_webrtc_connect` library.

The implementation in [`dimos/core/global_config.py`](https://github.com/dimensionalOS/dimos/blob/main/dimos/core/global_config.py) follows this exact logic:

```python
@property
def unitree_connection_type(self) -> str:
    if self.replay:
        return "replay"
    if self.simulation:
        return "mujoco"
    return "webrtc"

```

## Configuration Flags and CLI Usage

Developers configure these robot connection types in GlobalConfig through command-line flags that populate the global state before runtime.

### Enabling Replay Mode

Activate replay mode to analyze historical sensor data without hardware dependencies:

```bash
dimos run unitree-go2-agentic --replay

```

### Enabling Simulation Mode

Launch a MuJoCo virtual robot for safe algorithm testing and development:

```bash
dimos run unitree-go2-agentic --simulation

```

### Default WebRTC Connection

Omit both flags to connect to a live robot via WebRTC, which serves as the default transport:

```bash
dimos run unitree-go2-agentic

```

## Implementing Connection Logic in Code

Robot-specific connection modules consume the `unitree_connection_type` property to instantiate the correct transport class.

### Inspecting the Connection Type Programmatically

Query the resolved connection type at runtime to verify the current mode:

```python
from dimos.core.global_config import global_config

print(global_config.unitree_connection_type)   # → "webrtc", "mujoco", or "replay"

```

### Conditional Connection Instantiation

In [`dimos/robot/unitree/go2/connection.py`](https://github.com/dimensionalOS/dimos/blob/main/dimos/robot/unitree/go2/connection.py) and [`dimos/robot/unitree/g1/connection.py`](https://github.com/dimensionalOS/dimos/blob/main/dimos/robot/unitree/g1/connection.py), the connection type drives class selection:

```python
from dimos.core.global_config import global_config
from dimos.robot.unitree.go2 import connection as go2_conn

if global_config.unitree_connection_type == "replay":
    conn = go2_conn.FakeWebRTCConnection()      # loads replay data

elif global_config.unitree_connection_type == "mujoco":
    conn = go2_conn.MujocoConnection()          # runs MuJoCo simulation

else:
    conn = go2_conn.RealWebRTCConnection()      # live robot via WebRTC

```

## Source Code Architecture

The connection type system spans three critical components:

- **[`dimos/core/global_config.py`](https://github.com/dimensionalOS/dimos/blob/main/dimos/core/global_config.py)**: Implements the `GlobalConfig` class and the `unitree_connection_type` property that maps Boolean flags to transport strings.
- **[`dimos/robot/unitree/go2/connection.py`](https://github.com/dimensionalOS/dimos/blob/main/dimos/robot/unitree/go2/connection.py)**: Uses the connection type to instantiate `FakeWebRTCConnection`, `MujocoConnection`, or `RealWebRTCConnection` for Unitree Go2 robots.
- **[`dimos/robot/unitree/g1/connection.py`](https://github.com/dimensionalOS/dimos/blob/main/dimos/robot/unitree/g1/connection.py)**: Provides analogous instantiation logic for the Unitree G1 robot family.

## Summary

- DimOS exposes three robot connection types in GlobalConfig through the **`unitree_connection_type`** property: **WebRTC** for live hardware, **MuJoCo** for simulation, and **Replay** for recorded data.
- The **[`dimos/core/global_config.py`](https://github.com/dimensionalOS/dimos/blob/main/dimos/core/global_config.py)** file implements priority-based resolution where replay takes precedence, followed by simulation, with WebRTC as the default fallback.
- CLI flags **`--replay`** and **`--simulation`** control the configuration state consumed by robot-specific connection modules in **`dimos/robot/unitree/`**.

## Frequently Asked Questions

### What is the default robot connection type in GlobalConfig?

When neither the `--replay` nor `--simulation` flags are provided, `GlobalConfig.unitree_connection_type` returns `"webrtc"`, establishing a direct WebRTC connection to physical Unitree robot hardware using the `unitree_webrtc_connect` library.

### How does DimOS handle conflicting connection flags?

The connection resolution logic in [`dimos/core/global_config.py`](https://github.com/dimensionalOS/dimos/blob/main/dimos/core/global_config.py) prioritizes replay mode over simulation. If `replay=True`, the property returns `"replay"` regardless of the simulation flag setting, ensuring recorded data playback takes precedence over virtual environments.

### Can I switch connection types programmatically without restarting?

While the `unitree_connection_type` property is dynamically computed, changing the underlying `GlobalConfig.replay` or `GlobalConfig.simulation` flags requires reinstantiating the connection class. The typical pattern in [`dimos/robot/unitree/go2/connection.py`](https://github.com/dimensionalOS/dimos/blob/main/dimos/robot/unitree/go2/connection.py) checks the property once during connection initialization.

### Which robots support these GlobalConfig connection types?

The current implementation supports these three connection types for Unitree Go2 and G1 robots, as defined in [`dimos/robot/unitree/go2/connection.py`](https://github.com/dimensionalOS/dimos/blob/main/dimos/robot/unitree/go2/connection.py) and [`dimos/robot/unitree/g1/connection.py`](https://github.com/dimensionalOS/dimos/blob/main/dimos/robot/unitree/g1/connection.py). The `GlobalConfig` interface is designed to extend these transport options to additional robot platforms.