@ -32,9 +32,12 @@ class CarState(CarStateBase):
return button_events
def update ( self , pt_cp , cam_cp , ext_cp , trans_type ) :
def update ( self , pt_cp , cam_cp , * _ ) :
ext_cp = pt_cp if self . CP . networkLocation == NetworkLocation . fwdCamera else cam_cp
if self . CP . flags & VolkswagenFlags . PQ :
return self . update_pq ( pt_cp , cam_cp , ext_cp , trans_type )
return self . update_pq ( pt_cp , cam_cp , ext_cp )
ret = car . CarState . new_message ( )
# Update vehicle speed and acceleration from ABS wheel speeds.
@ -73,11 +76,11 @@ class CarState(CarStateBase):
ret . parkingBrake = bool ( pt_cp . vl [ " Kombi_01 " ] [ " KBI_Handbremse " ] ) # FIXME: need to include an EPB check as well
# Update gear and/or clutch position data.
if trans_t ype == TransmissionType . automatic :
if self . CP . transmissionT ype == TransmissionType . automatic :
ret . gearShifter = self . parse_gear_shifter ( self . CCP . shifter_values . get ( pt_cp . vl [ " Getriebe_11 " ] [ " GE_Fahrstufe " ] , None ) )
elif trans_t ype == TransmissionType . direct :
elif self . CP . transmissionT ype == TransmissionType . direct :
ret . gearShifter = self . parse_gear_shifter ( self . CCP . shifter_values . get ( pt_cp . vl [ " EV_Gearshift " ] [ " GearPosition " ] , None ) )
elif trans_t ype == TransmissionType . manual :
elif self . CP . transmissionT ype == TransmissionType . manual :
ret . clutchPressed = not pt_cp . vl [ " Motor_14 " ] [ " MO_Kuppl_schalter " ]
if bool ( pt_cp . vl [ " Gateway_72 " ] [ " BCM1_Rueckfahrlicht_Schalter " ] ) :
ret . gearShifter = GearShifter . reverse
@ -155,7 +158,7 @@ class CarState(CarStateBase):
self . frame + = 1
return ret
def update_pq ( self , pt_cp , cam_cp , ext_cp , trans_type ) :
def update_pq ( self , pt_cp , cam_cp , ext_cp ) :
ret = car . CarState . new_message ( )
# Update vehicle speed and acceleration from ABS wheel speeds.
ret . wheelSpeeds = self . get_wheel_speeds (
@ -187,9 +190,9 @@ class CarState(CarStateBase):
ret . parkingBrake = bool ( pt_cp . vl [ " Kombi_1 " ] [ " Bremsinfo " ] )
# Update gear and/or clutch position data.
if trans_t ype == TransmissionType . automatic :
if self . CP . transmissionT ype == TransmissionType . automatic :
ret . gearShifter = self . parse_gear_shifter ( self . CCP . shifter_values . get ( pt_cp . vl [ " Getriebe_1 " ] [ " Waehlhebelposition__Getriebe_1_ " ] , None ) )
elif trans_t ype == TransmissionType . manual :
elif self . CP . transmissionT ype == TransmissionType . manual :
ret . clutchPressed = not pt_cp . vl [ " Motor_1 " ] [ " Kupplungsschalter " ]
reverse_light = bool ( pt_cp . vl [ " Gate_Komf_1 " ] [ " GK1_Rueckfahr " ] )
if reverse_light :