town_crossing_state — DRIVE town op

• Data kinds: table → table

• Call: import fullseye as fs; fs.ledger.town_crossing_state(world: 'dict', t: 'float', train: 'Optional[dict]', *, exposure: 'float' = 0.0) -> 'Dict[str, object]' (to call the implementation directly, import drivetown; drivetown.town_crossing_state(world: 'dict', t: 'float', train: 'Optional[dict]', *, exposure: 'float' = 0.0) -> 'Dict[str, object]'; from the registry, opsdrive.get("town_crossing_state"))

Usage

Writes the state of the railroad-crossing equipment at time t into the world (all crossings use the same train timetable).

train = run["train"] of town_run (None = standby: boom up, lamps off, train far away). The state is evaluated with the existing ops drivecrossing.crossing_gate_state (warning → lowering → closed → raising, boom angle) and drivecrossing.crossing_lamp_signal (alternating flashing of 2 lamps; with exposure > 0, averaged over the camera exposure). The train's front reaches the road edge (margin before it) at t_arrival and moves in +y (local) at v_train. Return value {"state", "state_name", "boom_angle", "lamps", "entry_forbidden", "train_y"}.

Raises ValueError: world is not from town_world, t is non-finite, keys missing from train.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_driving_town — py -3.11 examples/poc_driving_town.py

Ops the type connects to (they accept table as input)

course_layout · course_occupancy · course_contains · world_build · world_camera · world_move · lidar_scan · rss_longitudinal_same

Same category (town)

town_chain · town_layout · town_world · town_centerline · town_stop_lines · town_rules · town_run · town_checks


*Provenance: drivetown.py — DRIVE operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.