Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
*.foxe filter=lfs diff=lfs merge=lfs -text binary
docs/capabilities/memory/assets/** filter=lfs diff=lfs merge=lfs -text
docs/capabilities/memory/assets/.gitattributes -filter -diff -merge text
# DimSim scene data and agent model
misc/DimSim/public/sims/*.json filter=lfs diff=lfs merge=lfs -text
misc/DimSim/public/agent-model/*.glb filter=lfs diff=lfs merge=lfs -text
58 changes: 58 additions & 0 deletions .github/workflows/dimsim-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: dimsim-check

on:
push:
branches: [main]
paths:
- 'misc/DimSim/**'
- '.github/workflows/dimsim-check.yml'
pull_request:
paths:
- 'misc/DimSim/**'
- '.github/workflows/dimsim-check.yml'

permissions: {}

jobs:
check:
timeout-minutes: 15
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: misc/DimSim
steps:
- uses: actions/checkout@v6
with:
lfs: true

- uses: actions/setup-node@v4
with:
node-version: 20

- uses: denoland/setup-deno@v2
with:
deno-version: v2.x

- name: Install npm deps
run: npm ci

- name: Build frontend
run: npm run build

- name: Type-check CLI
run: cd dimos-cli && deno check cli.ts mod.ts setup.ts

- name: Validate scenes template
run: |
for scene in $(jq -r '.scenes | keys[]' scenes.template.json); do
DESC=$(jq -r ".scenes.\"$scene\".description" scenes.template.json)
SIZE=$(jq -r ".scenes.\"$scene\".size" scenes.template.json)
if [ "$DESC" = "null" ] || [ "$SIZE" = "null" ]; then
echo "::error::Scene '$scene' missing description or size in scenes.template.json"
exit 1
fi
echo " $scene: $DESC (${SIZE} bytes)"
done
echo "Template valid."
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ __pycache__

# node env (used by devcontainers cli)
node_modules
package.json
package-lock.json
/package.json
/package-lock.json

# Ignore build artifacts
dist/
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ repos:
args: [--fix=lf]
exclude: \.patch$ # keep patch files byte-identical to upstream diffs
- id: check-json
exclude: ^misc/DimSim/public/sims/ # LFS-tracked
- id: check-toml
- id: check-yaml
- id: pretty-format-json
name: format json
args: [ --autofix, --no-sort-keys ]
exclude: ^misc/DimSim/public/sims/ # LFS-tracked

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 3.4.1
Expand Down
29 changes: 2 additions & 27 deletions dimos/simulation/dimsim/dimsim_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import time
from typing import IO

from dimos.constants import STATE_DIR
from dimos.core.global_config import GlobalConfig
from dimos.simulation.dimsim.deno_utils import ensure_deno, ensure_playwright_chromium
from dimos.utils.logging_config import setup_logger
Expand All @@ -28,8 +27,7 @@

_VIDEO_RATE = 50
_LIDAR_RATE = 1000
_DIMSIM_REPO_URL = "https://github.com/paul-nechifor/DimSim.git"
_DIMSIM_REPO_BRANCH = "run-from-repo"
_DIMSIM_DIR = Path(__file__).resolve().parents[3] / "misc" / "DimSim"


class DimSimProcess:
Expand All @@ -39,8 +37,7 @@ def __init__(self, global_config: GlobalConfig) -> None:

def start(self) -> None:
deno_path = ensure_deno()
repo_dir = _ensure_repo()
base_cmd = _deno_cmd(deno_path, repo_dir)
base_cmd = _deno_cmd(deno_path, _DIMSIM_DIR)

scene = self.global_config.dimsim_scene
port = self.global_config.dimsim_port
Expand Down Expand Up @@ -126,28 +123,6 @@ def _kill_port_holder(port: int) -> None:
logger.warning(f"Failed to check/kill port {port}: {e}")


def _ensure_repo() -> Path:
repo_dir = STATE_DIR / "dimsim_repo"
if (repo_dir / ".git").exists():
return repo_dir
STATE_DIR.mkdir(parents=True, exist_ok=True)
logger.info(f"Cloning DimSim into {repo_dir}")
subprocess.run(
[
"git",
"clone",
"--depth",
"1",
"--branch",
_DIMSIM_REPO_BRANCH,
_DIMSIM_REPO_URL,
str(repo_dir),
],
check=True,
)
return repo_dir


def _deno_cmd(deno_path: str, repo_dir: Path) -> list[str]:
cli_ts = repo_dir / "dimos-cli" / "cli.ts"
return [deno_path, "run", "--allow-all", "--unstable-net", str(cli_ts)]
7 changes: 7 additions & 0 deletions misc/DimSim/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
*.tar.gz
dist/
.DS_Store
**/.DS_Store
.deno/
scenes.json
55 changes: 55 additions & 0 deletions misc/DimSim/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# DimSim

Standalone 3D simulation runner for SimStudio scenes. Load a scene, spawn AI agents, run tasks — with full sensor support (RGB-D, LiDAR).

## Setup

```bash
npm install # installs everything (frontend + backend)
```

## Run

Terminal 1:
```bash
npm run server # Node.js VLM backend on :8000
```

Terminal 2:
```bash
npm run dev # Frontend on :5173
```

## Architecture

```
DimSim/
├── index.html ← Sim-mode UI (scene dropdown + full sensor controls)
├── server.js ← VLM backend (Express + OpenAI SDK)
├── src/
│ ├── main.js ← Entry point (imports engine.js)
│ ├── engine.js ← Full SimStudio engine (synced via copy-sources.sh)
│ ├── style.css ← Synced from SimStudio
│ ├── AiAvatar.js ← Agent class (synced)
│ └── ai/ ← VLM modules (synced)
├── public/
│ ├── sims/ ← Scene JSON files + manifest.json
│ └── agent-model/ ← Robot GLB models
├── vlm-server/
│ └── asset-library.json ← Persisted asset library data
├── copy-sources.sh ← Sync engine from SimStudio
└── update-sims.sh ← Rebuild scene manifest
```

## Sync from SimStudio

```bash
npm run sync
```

## Add/remove scenes

Drop `.json` files in `public/sims/`, then:
```bash
npm run update-sims
```
122 changes: 122 additions & 0 deletions misc/DimSim/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions misc/DimSim/dimos-cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# DimSim

3D simulation environment for the [dimos](https://github.com/dimensionalOS/dimos) robotics stack.

Browser-based Three.js + Rapier simulator with LCM transport, sensor publishing (RGB, depth, LiDAR, odometry), and an eval harness for automated testing of navigation and perception pipelines.

## Install

```sh
deno install -gAf --unstable-net jsr:@antim/dimsim
```

## Setup

Download core assets (~22 MB) and install a scene:

```sh
dimsim setup
dimsim scene install apt
```

## Run

Start the dev server and open the URL it prints:

```sh
dimsim dev --scene apt
```

Run headless evals in CI:

```sh
dimsim eval --headless --env apt --workflow reach-vase
```

## Programmatic API

```ts
import { startBridgeServer } from "@antim/dimsim";

startBridgeServer({ port: 8090, distDir: "./dist", scene: "apt" });
```

## Commands

| Command | Description |
|---------|-------------|
| `dimsim setup` | Download core assets |
| `dimsim scene install <name>` | Install a scene |
| `dimsim scene list` | List available and installed scenes |
| `dimsim scene remove <name>` | Remove a scene |
| `dimsim dev [--scene <name>]` | Dev server (open browser manually) |
| `dimsim eval --headless` | Run eval workflows in CI |
| `dimsim agent` | Launch dimos Python agent |

## License

MIT
Loading
Loading