* Before abstraction, adding speed init from VW as well
* strting to abstract carstate class
* fix bug and update lock?
* revert pipfile change
* another bug
* fix linter
* bug fix
* remove a bunch of diplicated kf code
* better to not have class vars. will abstract __init__ anyway later
* abstract common instance vars in carstate init and a generic gear parser static method
* abstract gear parser for chrysler
* abstract gm gear parser too
* remove unnecessary random vars
* Chrysler: carstate returns capnp struct directly
* revert ref commit
* test ref
* WIP
* more WIP
* ops, missed this conflict
* ford as well
* not sure why this got deleted
* no need to copy
* remove copy
* remove copy import
* remove unnecessary intermediate variable
* remove obsolete comments
* GM: have carstate returning capnp struct directly
* Honda carstate also outputing capnp struct
* hyundai too now returns capnp from carstate
* ops, not meant this
* Subaru carstate also returning capnp
* Toyota: capnp struct as output of carstate
* fix bool
* minor simplififcation in Honda
* no need to negate
* VW carstate returning capnp struct (#1118)
* VW carstate also returning capnp struct
* fixed typo
* Remove unused blinker button (#1119)
* remove unused blinker button
* ops, this wasn't meant
* remove blinker button for VW as well
* update ref
Co-authored-by: Willem Melching <willem.melching@gmail.com>
# Gear Selecton - This is not compatible with all Kia/Hyundai's, But is the best way for those it is compatible with
gear=cp.vl["LVR12"]["CF_Lvr_Gear"]
ifgear==5:
self.gear_shifter=GearShifter.drive
gear_shifter=GearShifter.drive
elifgear==6:
self.gear_shifter=GearShifter.neutral
gear_shifter=GearShifter.neutral
elifgear==0:
self.gear_shifter=GearShifter.park
gear_shifter=GearShifter.park
elifgear==7:
self.gear_shifter=GearShifter.reverse
gear_shifter=GearShifter.reverse
else:
self.gear_shifter=GearShifter.unknown
gear_shifter=GearShifter.unknown
# Gear Selection via Cluster - For those Kia/Hyundai which are not fully discovered, we can use the Cluster Indicator for Gear Selection, as this seems to be standard over all cars, but is not the preferred method.
ifcp.vl["CLU15"]["CF_Clu_InhibitD"]==1:
self.gear_shifter_cluster=GearShifter.drive
gear_shifter_cluster=GearShifter.drive
elifcp.vl["CLU15"]["CF_Clu_InhibitN"]==1:
self.gear_shifter_cluster=GearShifter.neutral
gear_shifter_cluster=GearShifter.neutral
elifcp.vl["CLU15"]["CF_Clu_InhibitP"]==1:
self.gear_shifter_cluster=GearShifter.park
gear_shifter_cluster=GearShifter.park
elifcp.vl["CLU15"]["CF_Clu_InhibitR"]==1:
self.gear_shifter_cluster=GearShifter.reverse
gear_shifter_cluster=GearShifter.reverse
else:
self.gear_shifter_cluster=GearShifter.unknown
gear_shifter_cluster=GearShifter.unknown
# Gear Selecton via TCU12
gear2=cp.vl["TCU12"]["CUR_GR"]
ifgear2==0:
self.gear_tcu=GearShifter.park
gear_tcu=GearShifter.park
elifgear2==14:
self.gear_tcu=GearShifter.reverse
gear_tcu=GearShifter.reverse
elifgear2>0andgear2<9:# unaware of anything over 8 currently