Skip to main content

Remote Gym-style Python client for a World Engine simulation server: connect(token) -> reset/step over HTTP.

Project description

world-engine-client

Remote Gym-style Python client for a World Engine simulation server — a Gaussian-Splatting real-to-sim robot simulation framework. Your Python connects with a token, becomes the (single) controller, and drives the MuJoCo physics with reset/step, while every browser watching the server's viewer.html sees the episode live.

pip install world-engine-client

Dependencies: numpy only. The import name is world_engine_client (the world_engine module name belongs to the simulation server package).

Usage

Server side (prints the control token):

world-engine --scenes-dir scenes serve --mode simulator \
    --scene <scene> --task <task> --allow-remote-control

Client side:

import world_engine_client as we_client

env = we_client.connect("<control token>", url="http://<host>:8080")
obs, info = env.reset(seed=0)
for _ in range(200):
    action = my_policy(obs)                      # [-1,1]^4: [dx, dy, dz, gripper]
    obs, reward, terminated, truncated, info = env.step(action)
    if terminated or truncated:
        obs, info = env.reset()
env.close()

obs is a dict of numpy arrays: proprio (8: ee pos + quat wxyz + gripper), joint_positions, object_state (pos+quat per body, sorted-id order) plus object_ids. Camera-image observations ride the server's headless-renderer path and are not yet exposed here (see the server repo's docs/remote_inference_api.md for the design).

Semantics

  • Exactly one controller may be bound; connect(token, takeover=True) revokes a dead session.
  • After terminated/truncated you must reset() (Gym semantics — the server refuses further steps with reset_required).
  • RemoteEnv is a context manager: with we_client.connect(...) as env: releases the controller lock on exit.
  • Errors are typed (TokenError, ControllerConflictError, ResetRequiredError) and carry the server's "Possible fixes" hints.

Development

pip install -e . && python -m pytest

The wire-contract tests (real client against a real server) live in the server repo: tests/test_remote_control.py.

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

world_engine_client-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

world_engine_client-0.1.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file world_engine_client-0.1.0.tar.gz.

File metadata

  • Download URL: world_engine_client-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for world_engine_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9f724a27d22ab9137a3fed0f11365322fce134e12ab94dfc4937231429955094
MD5 b1c5eb7997d0f7a7fa5d325449aa541f
BLAKE2b-256 279afea09097b0f418b77321afe7d70f87cc7b997d85188546b0e28bdbb9b06c

See more details on using hashes here.

Provenance

The following attestation bundles were made for world_engine_client-0.1.0.tar.gz:

Publisher: publish.yml on Grounded-Intelligence-Initiative/world-engine-client-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file world_engine_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for world_engine_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 205789dad0c61cfc7f945de848f3725883653da88b3c7361908629cd3206de1e
MD5 8c7bfbb9587a902b6028f6972c0f7020
BLAKE2b-256 21e13c3d5f573e3bcc8c6ed305277dcaebd53af7f3122bbe590bb7996acefdf8

See more details on using hashes here.

Provenance

The following attestation bundles were made for world_engine_client-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Grounded-Intelligence-Initiative/world-engine-client-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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