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

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. 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 follows this exact logic:

@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:

dimos run unitree-go2-agentic --replay

Enabling Simulation Mode

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

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:

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:

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 and dimos/robot/unitree/g1/connection.py, the connection type drives class selection:

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:

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 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 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 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 and dimos/robot/unitree/g1/connection.py. The GlobalConfig interface is designed to extend these transport options to additional robot platforms.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →