autonomy_demo is a replay-first autonomy research scaffold for CARLA 0.9.16. It mirrors the PRD pipeline:
sim -> sensors -> perception -> localization -> mapping -> prediction -> planning -> control
The repository intentionally ships only interfaces, deterministic stubs, scenario/config loading, replay hooks, and starter tests. It is designed so each layer can be developed and tested without CARLA running.
- Typed dataclasses, enums, and layer protocols
- JSON scenario schema and seven starter scenarios
- YAML config loading for app and sensor settings
- In-process event bus with read-only visualization subscribers
- Stub simulation backend and one-tick/multi-tick pipeline execution
- Live CARLA bootstrap with route-following control and camera-first perception v1 scaffolding
- Replay writer/reader abstraction with HDF5-oriented interface and JSON fallback
- Evaluation harness with live run and perception-health summaries
python -m pip install -e ".[dev,ml,viz]"
python scripts/validate_scenario.py --config scenarios/SC-01_highway_cruise.json
python scripts/run_scenario.py --config scenarios/SC-01_highway_cruise.json --record --visualize
python scripts/replay_scenario.py --replay outputs/latest/replay.jsonsrc/autonomy_demo/interfaces: shared public types and contractssrc/autonomy_demo/orchestration: config/scenario loading, event bus, runtime wiringsrc/autonomy_demo/sim: stub and CARLA backend boundariessrc/autonomy_demo/sensors: synthetic sensor bundle generation and synchronization hookssrc/autonomy_demo/perceptionthroughsrc/autonomy_demo/control: stubbed autonomy layerssrc/autonomy_demo/visualization: read-only visualization service and optional web stubsrc/autonomy_demo/replay: replay writer/readersrc/autonomy_demo/eval: online metrics and run summaries
- Simulation/research demo only, not a production AV system
- CARLA 0.9.16 target
- Python 3.12 target for live CARLA integration
- Python monorepo, no microservice split
- Typed layer boundaries with no non-adjacent layer imports
- Visualization remains decoupled and read-only
- Scenario definitions are JSON-driven
- Replay and evaluation are first-class from day one
perception.mode: camera_v1enables the first real perception slice.perception.model_variant: bootstrapuses CARLA actor annotations as a non-crashing bootstrap detector.- Set
perception.model_variantto your trained YOLO weights path to activate the YOLO adapter whenultralyticsis installed. - You can override perception at runtime with
--perception-mode,--perception-device, and--perception-model-variant. - Lane and drivable-space extraction use lightweight image heuristics with OpenCV acceleration when available.
tuning.perception_aux.lane_backend: egolanes_onnxenables Autoware EgoLanes lane inference whenonnxruntimeis installed andtuning.perception_aux.egolanes_model_pathpoints to the downloaded.onnxweights.- Supported lane backends are
heuristic,online_train, andegolanes_onnx. Heuristic remains the fallback path when EgoLanes cannot load or returns an incomplete ego-lane pair.
- Replace the stub simulation backend with a real CARLA adapter.
- Flesh out live sensor synchronization and multi-rate handling for slower side/rear cameras.
- Swap stub perception modules for YOLOv8, PointPillars, lane detection, and segmentation adapters.
- Add OpenDRIVE parsing, Frenet planning, Stanley/PID control, and a real dashboard renderer.