Skip to main content

Small standalone tabletop blocks-world simulator.

Project description

SHRDLU World

Small standalone tabletop blocks-world simulator. It can run as a Python object, a headless HTTP service, or a browser viewer for manual control.

Install

pip install shrdlu-world

For local development:

cd ~/shrdlu-block-world
python -m pip install -e .

Run

# Browser viewer at http://127.0.0.1:18123/
shrdlu-simulator

# Equivalent module entrypoint
python3 -m shrdlu_blocks.simulator

# API only
shrdlu-simulator --headless

# Equivalent module entrypoint
python3 -m shrdlu_blocks.simulator --headless

Useful options:

  • --host HOST
  • --port PORT
  • --open-browser

Interface

Running python3 -m shrdlu_blocks.simulator starts a small browser UI for manual control of the scene.

Browser interface

The viewer includes:

  • a central canvas showing the current blocks-world scene
  • Select and Move modes for interacting with objects in the canvas
  • zoom controls and a reset button in the top bar
  • direct x and y inputs for move_grasper
  • buttons for raise_grasper, lower_grasper, open_grasper, and close_grasper
  • an object list for selecting the active object
  • highlight and unhighlight controls for the selected object
  • an event log showing recent actions and simulator responses

This UI is served from the same HTTP server as the JSON API, so the browser viewer and programmatic API stay in sync.

Python API

from shrdlu_blocks import ShrdluBlocksEnv

env = ShrdluBlocksEnv()
env.execute_action({"name": "move_grasper", "args": {"x": -0.1, "y": 0.4}})
env.execute_action({"name": "lower_grasper", "args": {}})
print(env.snapshot_text())

HTTP API

  • GET /api/state
  • POST /api/action
  • POST /api/reset

POST /api/action expects an action object:

{
  "action": {
    "name": "move_grasper",
    "args": {"x": -0.1, "y": 0.4}
  }
}

Supported action names:

  • move_grasper with x and y
  • lower_grasper
  • raise_grasper
  • close_grasper
  • open_grasper
  • highlight_object
  • unhighlight_object

Configuration

export SHRDLU_SIMULATOR_HOST=0.0.0.0
export SHRDLU_SIMULATOR_PORT=18123
export SHRDLU_WEB_OPEN_BROWSER=1

For remote use, forward the viewer port and open http://localhost:18123:

ssh -L 18123:localhost:18123 user@remote-host

Layout

  • shrdlu_blocks/simulator/: environment, controller, scene model, and HTTP server
  • shrdlu_blocks/viewer/: browser viewer and static assets
  • shrdlu_blocks/client.py: small HTTP client for a running service

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

shrdlu_world-0.1.2.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

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

shrdlu_world-0.1.2-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file shrdlu_world-0.1.2.tar.gz.

File metadata

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

File hashes

Hashes for shrdlu_world-0.1.2.tar.gz
Algorithm Hash digest
SHA256 48b435082427b79ec55a5912906b0b8a270fb15f9f3fd6a16402de6a396f2ed6
MD5 9475a8508d31b7d5076ca1e2781932b6
BLAKE2b-256 e204449b80b12393110fcb3fa2f14e170a9fd94184c2d93bf2c6f7e8136d3344

See more details on using hashes here.

Provenance

The following attestation bundles were made for shrdlu_world-0.1.2.tar.gz:

Publisher: release.yml on cat-claws/shrdlu-world

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

File details

Details for the file shrdlu_world-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: shrdlu_world-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 34.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shrdlu_world-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7aa8b2f523af7c72d0a666d54f9e7a8328b38be03a6b2c97534bd4edcf03bce8
MD5 afbda4570d7b98d6f3b6d443d8fec3dd
BLAKE2b-256 09ae4f2f687030c1256c28bda65a97ce6b23e4972f01eb12392a337af6c215d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for shrdlu_world-0.1.2-py3-none-any.whl:

Publisher: release.yml on cat-claws/shrdlu-world

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