This commit is contained in:
Your Name
2024-05-11 15:27:31 -05:00
parent bc2a4e2266
commit 4373a0198f
11 changed files with 303 additions and 218 deletions

View File

@@ -22,6 +22,20 @@ from openpilot.selfdrive.controls.lib.drive_helpers import CRUISE_LONG_PRESS, V_
from openpilot.selfdrive.controls.lib.events import Events
from openpilot.selfdrive.controls.lib.vehicle_model import VehicleModel
# Notes:
# CarInterfaceBase
# Has multiple functions. Haven't figured them all out yet.
# It turns car state into events.
# It passes calls to update() to the specific cars interface.py (get car state)
# It passes calls to apply() to the specific cars interface.py (apply car state, gen canbus commands)
# CarStateBase
# carstate is variable (not event) based tracking of the current properties of the car
# such as which buttons are pressed or if blinkers are enabled. It uses previous frame
# to detect transitions (previous lkas button vs lkas button, if not equal, button just pressed)
# - init - defines default values for carstate.
ButtonType = car.CarState.ButtonEvent.Type
GearShifter = car.CarState.GearShifter
EventName = car.CarEvent.EventName