How cwal1220/edgepilot works
edgepilot is embedded openpilot perception and lateral-control software for the MaixCAM2, integrated with a Hyundai K7 and Panda USB/CAN interface. The main path runs from camera capture through model inference and lateral planning/control to Panda and vehicle steering; localization supplies state, while the HUD and recorder consume runtime data. Separate branches provide web tuning and replay. The README documents process-level data paths; sampled source confirms selected internals, but many runtime processes and integrations were not inspected directly.
Main entry points: ipc_messages.h Shared State IPC · lateral_controller.cc Lateral Control · manager.py Process Manager · maix_cmm.cc CMM Frame Ring
Components 25
Vision
- Camera Capture
src/camera/camerad.cc - CMM Frame Ring
platform/maixcam2/maix_cmm.cc - Model Runtime
src/model/modeld.cc - NPU Session
src/model/ax_engine_session.cc
State and Control
- Shared State IPC
src/common/ipc_messages.h - Localization
src/localization/localization_pipeline.cc - Lateral Planner
src/planning/lateral_planner.cc - Lateral Control
src/controls/lateral_controller.cc - Online Learners
src/learners/lateral_learners.cc
Vehicle Interface
- Vehicle CAN
src/car/vehicle_can.cc - Hyundai Messages
src/car/hyundai_can.cc - Panda Daemon
src/panda/pandad.cc - Panda USB Client
src/panda/panda_client.cc - Panda Safety Firmware
firmware/panda/board/main.c
Runtime and Views
- HUD Renderer
src/hud/overlayd.cc - Drive Recorder
src/recording/recordd.cc - Drive Recordings
src/recording/recording_writer.cc - Process Manager
scripts/manager.py
Tuning and Replay
- Web Console
scripts/web_console - Replay Runtime
src/recording/replayd.cc - Recording Reader
tools/model/recording_reader.py
Other components
- Driver
- Camera
- Hyundai K7
- LCD Display
Connections 33
- Camera → Camera Capture: provides frames
README.md - Camera Capture → CMM Frame Ring: writes frames
README.md - CMM Frame Ring → Model Runtime: feeds views
README.md - Model Runtime → NPU Session: runs inference
README.md - Model Runtime → Shared State IPC: publishes model state
README.md - Shared State IPC → Localization: supplies state
- Shared State IPC → Lateral Planner: supplies model state
src/planning/lateral_planner.cc - Lateral Planner → Shared State IPC: publishes plan
README.md - Shared State IPC → Lateral Control: supplies runtime state
README.md - Online Learners → Lateral Control: provides estimates
- Lateral Control → Hyundai Messages: builds steering frames
- Vehicle CAN → Shared State IPC: publishes vehicle state
README.md - Panda Daemon → Panda USB Client: uses USB client
src/panda/panda_client.cc - Panda Daemon → Shared State IPC: publishes Panda state
README.md - Lateral Control → Shared State IPC: publishes control state
README.md - Panda Daemon → Panda Safety Firmware: communicates over USB
README.md - Panda Safety Firmware → Hyundai K7: safety-gated CAN
README.md - Hyundai Messages → Panda Daemon: sends CAN commands
README.md - Hyundai K7 → Vehicle CAN: sends CAN signals
README.md - CMM Frame Ring → HUD Renderer: scales preview
README.md - Shared State IPC → HUD Renderer: supplies HUD state
README.md - HUD Renderer → LCD Display: draws overlay
README.md - CMM Frame Ring → Drive Recorder: copies video
README.md - Shared State IPC → Drive Recorder: logs runtime states
README.md - Drive Recorder → Drive Recordings: writes recordings
README.md - Process Manager → Camera Capture: starts process
README.md - Process Manager → Model Runtime: starts process
README.md - Process Manager → Lateral Control: starts process
README.md - Process Manager → HUD Renderer: starts process
README.md - Process Manager → Drive Recorder: starts process
README.md - Web Console → Lateral Control: updates parameters
README.md - Drive Recordings → Replay Runtime: provides replay data
README.md - Drive Recordings → Recording Reader: reads recordings
tools/model/recording_reader.py