Skip to content

Browser terminal: embed IPython in viser via terminado + xterm.js #145

Description

@siddhss5

Goal

Access the full IPython console from the browser — same tab as the 3D viewer, no separate terminal needed. Anyone with browser access can control the robot.

Approach

  • terminado — WebSocket-to-PTY bridge (what Jupyter uses). Wraps the existing IPython session.
  • xterm.js — terminal emulator in the browser. Connects to terminado WebSocket.
  • Embed xterm.js in a Viser tab via add_html.

Architecture

Browser
  ├── Viser 3D view (port 8080)
  ├── Chat tab (Viser GUI)
  ├── Sensors tab (Viser GUI)
  └── Terminal tab (xterm.js → terminado WebSocket on port 8081)

geodude process
  ├── IPython session (robot, ctx, chat available)
  ├── Viser server (port 8080)
  └── terminado server (port 8081, connected to IPython PTY)

What this enables

  • Send a URL → anyone can control the robot from a browser
  • LLM chat for non-programmers, terminal for power users, same session
  • Remote access to the real robot (via SSH tunnel or direct)
  • No local install needed for observers/collaborators

Scope

  • Single shared IPython instance (all browser clients see the same session)
  • Per-user instances (via JupyterHub) is a future enhancement for teaching

Lives in

geodude (console.py) — terminado wraps geodude's IPython, not a generic mj_viser feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions