Skip to content

Latest commit

 

History

History
45 lines (39 loc) · 2.76 KB

09-code-layout.md

File metadata and controls

45 lines (39 loc) · 2.76 KB

09. Code layout and module ownership

CMakeLists.txt            targets: adas_core (lib), replay, bench, adas_device, test_*
scripts/build.sh          configure + build (handles macOS toolchain quirks)
scripts/fetch_models.sh   downloads detector models into models/ (gitignored)
config/default.yaml       all parameters (one mode; the phone's runtime settings override a few keys)
core/include/adas/*.h     module contracts (types, config, detector, tracker, geometry,
                          egomotion, lanes, calibration, policy, pipeline, jsonl)
core/src/*.cpp            implementations
core/tools/replay.cpp     video -> JSONL (offline, as fast as possible)
core/tools/bench.cpp      detector benchmark and visual check
core/tools/device.cpp     the device process: real-time loop, buzzer, clips, phone page
core/src/phone_server.cpp embedded HTTP server for the phone page (third_party/httplib.h)
core/tests/test_*.cpp     plain executables, exit 0 = pass
webui-phone/              the phone page served by the device (index.html, app.js, style.css)
deploy/                   Pi cross-build, install, car-mode setup, network units, log pull
scripts/review_drive.py   builds the HTML report for a pulled drive (docs/14)
scripts/replay_drive.sh   replays a pulled drive's clips through two builds and diffs the alerts
docs/                     design notes
data/                     incoming/, normalized/, device/, pi/ (gitignored)

Module contracts

The headers in core/include/adas/ are the contracts between modules. Each module is implemented against the headers only. Changes to a header are coordinated by the orchestrator.

Module Files Owner
Types, config, detector types., config., detector.h, detector_nanodet.cpp done
Tracker + geometry tracker.cpp, geometry.cpp (updateTrackGeometry), tests/test_tracker.cpp tracker agent
Policy (FCW, LDW, corridor) policy.cpp, tests/test_policy.cpp policy agent
Ego motion, lanes, calibration egomotion.cpp, lanes.cpp, calibration.cpp, tests/test_perception.cpp perception agent
Pipeline, JSONL, replay pipeline.cpp, jsonl.cpp, tools/replay.cpp, tests/test_pipeline.cpp pipeline agent
Device + phone page tools/device.cpp, phone_server.cpp, webui-phone static page device agent
Offline tooling scripts/review_drive.py, scripts/replay_drive.sh, deploy/pull_pi_logs.sh done

Frame conventions

  • Frames entering the pipeline are BGR, frame.width x frame.height (640x480).
  • Full-frame pixel coordinates everywhere outside the detector.
  • Time is seconds from the frame timestamp; nothing reads the wall clock inside core.
  • Closing rate cr is 1 / time-to-contact in 1/s; positive means approaching.
  • Lateral offset is meters, positive to the right of the camera axis.