Standalone ATO (Rust) — automatic train speed/brake control. Pairs with TrainSim. No ETCS/ATP.
Find a file
Mona Lisa bb89490f5e
Some checks are pending
CodeView ATO CI / rust (push) Waiting to run
CodeView ATO CI / integration (push) Blocked by required conditions
docs: expand README for Forgejo visibility and cross-links
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 20:38:01 +00:00
.agent chore: set project mode to bootstrap 2026-06-14 19:19:06 +00:00
.forgejo Add standalone ATO controller in lean Rust. 2026-06-14 20:37:21 +00:00
config Add standalone ATO controller in lean Rust. 2026-06-14 20:37:21 +00:00
crates Add standalone ATO controller in lean Rust. 2026-06-14 20:37:21 +00:00
spec Add standalone ATO controller in lean Rust. 2026-06-14 20:37:21 +00:00
.dockerignore Add standalone ATO controller in lean Rust. 2026-06-14 20:37:21 +00:00
.gitignore Add standalone ATO controller in lean Rust. 2026-06-14 20:37:21 +00:00
Cargo.lock Add standalone ATO controller in lean Rust. 2026-06-14 20:37:21 +00:00
Cargo.toml Add standalone ATO controller in lean Rust. 2026-06-14 20:37:21 +00:00
Dockerfile Add standalone ATO controller in lean Rust. 2026-06-14 20:37:21 +00:00
README.md docs: expand README for Forgejo visibility and cross-links 2026-06-14 20:38:01 +00:00

ATO — Automatic Train Operation

Standalone Automatic Train Operation for railway-style speed control.
No ETCS. No ATP. Lean Rust, safety-oriented style.

Companion simulation: TrainSim

Forgejo https://git.italiatts.online/rwsholdem/ato
Language Rust
Role Reads train state, outputs traction/brake commands

What it does

  1. Load parameters from config/ato.default.json (replaceable file, no rebuild needed for tuning).
  2. Connect to TrainSim over HTTP (spec/interface.md).
  3. Cruise mode: from standstill → hold target speed on a loop track.
  4. Core also supports stop-at-position / brake-curve helpers (ato-core).

Repository layout

Path Purpose
crates/ato-core/ Pure control logic — zero dependencies, no I/O, #![forbid(unsafe_code)]
crates/ato-app/ Control loop + minimal HTTP client (http.rs, std only)
config/ Runtime parameters (ato.default.json)
spec/ Shared interface contract + JSON message examples
Dockerfile Multi-stage build, runs tests during image build

Interface (summary)

See spec/interface.md. TrainSim implements the server; ATO is the client.

  • GET /train/state — speed, position, track length
  • POST /train/actuate{ "traction_pct": 0100, "brake_pct": 0100 }
  • POST /sim/start · POST /sim/stop

Build & test

cargo test --workspace
docker build -t ato .

Run with TrainSim (CodeView lab, nested Docker)

On the CodeView VPS, integration runs inside DinD (not on the host):

cd /root/code-view/profiles/ato-lab
./run-e2e.sh

Detailed ATO design and SIL notes — to be expanded in a later README revision.