Platforms with passengers
Lay a platform between two markers. Passengers arrive, wait at the edge, board and alight through the doors. Their colour shows their mood, from green to red.
Open source · runs in the browser
Point a phone or a webcam at your layout. ARail puts platforms full of passengers, bus terminals, houses and trees on it, simulates delays and closures, and shows the trains your control system reports.
H0 · TT · N · any scaleArUco & AprilTag markersNo install, no calibration board
PhotoARail
Everything is placed on the real layout in model millimetres and scaled to the prototype, so a person on an H0 platform is 20 mm tall.
Lay a platform between two markers. Passengers arrive, wait at the edge, board and alight through the doors. Their colour shows their mood, from green to red.
Bays along a bus lane, shelters and stop signs. Buses come on a timetable, or more often when a rail replacement service is running.
Buildings with floors and roofs, single trees and forests, fields, water and roads. Tap to place them, drag to move them.
Delays, cancellations, closures, signal failures, crowd surges and replacement buses, started by hand or scripted as scenarios for teaching.
A small Python bridge forwards train positions over WebSocket. When a real train stops at a platform, the virtual passengers board it.
Plugins add object types, simulations and disruption types in plain JavaScript modules. The editor builds their settings forms automatically.
Printed square markers lie flat on the layout. From the camera image alone, without a calibration board, ARail works out where the layout plane is and draws on it.
The first four steps take an afternoon. The control system can follow later.
Use the marker sheets and check the 100 mm bar with a ruler. The black square is the marker size.
One marker at each end of every platform, more across the layout. Wherever the camera looks, one or two should be in view.
Take a photo, record a video or start the live camera. Unknown markers are measured automatically when they are seen next to known ones.
Add platforms, a bus terminal and scenery in the Build panel, then export the layout file and keep it in your fork.
Run arail-bridge next to it with an adapter for your system. The simulated control system shows the flow without one.
No build step, no framework. A plugin is an ES module that registers what it adds; layouts load it by URL.
Guide to plugins · Layout file format · Control-system interface
// plugins/windmill.js: a new object type
export default function (arail) {
class Windmill extends arail.LayoutObject {
static type = "windmill";
static label = "Windmill";
static params = [{
key: "height_m", label: "Height",
type: "number", unit: "m", default: 18,
}];
computeGeometry() {
const c = arail.resolvePoint(this.world.map, this.spec.position);
return c && { center: c };
}
draw(view) {
const [x, y] = this.geometry.center;
const h = view.m(this.spec.height_m); // metres → model mm
view.prism(arail.rectFootprint([x, y], view.m(5), view.m(5)), 0, h,
{ side: "#e8e1d0", top: "#8a5a3c" });
}
}
arail.registry.registerObject(Windmill);
}
| Version | Destination | Status |
|---|---|---|
| 0.1 | Tracking without a calibration boardMarker map survey, focal length estimate, tested on the lab photo | Arrived |
| 0.1 | Platforms, bus terminals, scenery, editorLayout files, plugins, passenger simulation | Arrived |
| 0.1 | Disruptions, scenarios, control-system bridgeSimulated, replayed and TCP JSON feeds | Arrived |
| next | Live sessions in the EBLPhones, webcams and a projector on the real layout | Boarding |
| next | Adapter for the EBL control systemReal train positions instead of the simulator | Scheduled |
| later | Occlusion by real trains, more vehicle typesIdeas and contributions welcome | Scheduled |