interfaces/apply: follow capnp best practices (#23371)

old-commit-hash: 05b905d140
commatwo_master
Dean Lee 4 years ago committed by GitHub
parent a55046c949
commit 0a762c27ce
  1. 7
      selfdrive/car/gm/interface.py
  2. 11
      selfdrive/car/honda/interface.py
  3. 5
      selfdrive/car/hyundai/interface.py
  4. 7
      selfdrive/car/nissan/interface.py
  5. 5
      selfdrive/car/subaru/interface.py
  6. 7
      selfdrive/car/toyota/interface.py
  7. 11
      selfdrive/car/volkswagen/interface.py

@ -212,7 +212,8 @@ class CarInterface(CarInterfaceBase):
return self.CS.out
def apply(self, c):
hud_v_cruise = c.hudControl.setSpeed
hud_control = c.hudControl
hud_v_cruise = hud_control.setSpeed
if hud_v_cruise > 70:
hud_v_cruise = 0
@ -222,8 +223,8 @@ class CarInterface(CarInterfaceBase):
ret = self.CC.update(enabled, self.CS, self.frame,
c.actuators,
hud_v_cruise, c.hudControl.lanesVisible,
c.hudControl.leadVisible, c.hudControl.visualAlert)
hud_v_cruise, hud_control.lanesVisible,
hud_control.leadVisible, hud_control.visualAlert)
self.frame += 1
return ret

@ -432,8 +432,9 @@ class CarInterface(CarInterfaceBase):
# pass in a car.CarControl
# to be called @ 100hz
def apply(self, c):
if c.hudControl.speedVisible:
hud_v_cruise = c.hudControl.setSpeed * CV.MS_TO_KPH
hud_control = c.hudControl
if hud_control.speedVisible:
hud_v_cruise = hud_control.setSpeed * CV.MS_TO_KPH
else:
hud_v_cruise = 255
@ -441,9 +442,9 @@ class CarInterface(CarInterfaceBase):
c.actuators,
c.cruiseControl.cancel,
hud_v_cruise,
c.hudControl.lanesVisible,
hud_show_car=c.hudControl.leadVisible,
hud_alert=c.hudControl.visualAlert)
hud_control.lanesVisible,
hud_show_car=hud_control.leadVisible,
hud_alert=hud_control.visualAlert)
self.frame += 1
return ret

@ -347,8 +347,9 @@ class CarInterface(CarInterfaceBase):
return self.CS.out
def apply(self, c):
hud_control = c.hudControl
ret = self.CC.update(c.enabled, self.CS, self.frame, c.actuators,
c.cruiseControl.cancel, c.hudControl.visualAlert, c.hudControl.setSpeed, c.hudControl.leftLaneVisible,
c.hudControl.rightLaneVisible, c.hudControl.leftLaneDepart, c.hudControl.rightLaneDepart)
c.cruiseControl.cancel, hud_control.visualAlert, hud_control.setSpeed, hud_control.leftLaneVisible,
hud_control.rightLaneVisible, hud_control.leftLaneDepart, hud_control.rightLaneDepart)
self.frame += 1
return ret

@ -78,9 +78,10 @@ class CarInterface(CarInterfaceBase):
return self.CS.out
def apply(self, c):
hud_control = c.hudControl
ret = self.CC.update(c.enabled, self.CS, self.frame, c.actuators,
c.cruiseControl.cancel, c.hudControl.visualAlert,
c.hudControl.leftLaneVisible, c.hudControl.rightLaneVisible,
c.hudControl.leftLaneDepart, c.hudControl.rightLaneDepart)
c.cruiseControl.cancel, hud_control.visualAlert,
hud_control.leftLaneVisible, hud_control.rightLaneVisible,
hud_control.leftLaneDepart, hud_control.rightLaneDepart)
self.frame += 1
return ret

@ -122,8 +122,9 @@ class CarInterface(CarInterfaceBase):
return self.CS.out
def apply(self, c):
hud_control = c.hudControl
ret = self.CC.update(c.enabled, self.CS, self.frame, c.actuators,
c.cruiseControl.cancel, c.hudControl.visualAlert,
c.hudControl.leftLaneVisible, c.hudControl.rightLaneVisible, c.hudControl.leftLaneDepart, c.hudControl.rightLaneDepart)
c.cruiseControl.cancel, hud_control.visualAlert,
hud_control.leftLaneVisible, hud_control.rightLaneVisible, hud_control.leftLaneDepart, hud_control.rightLaneDepart)
self.frame += 1
return ret

@ -287,11 +287,12 @@ class CarInterface(CarInterfaceBase):
# pass in a car.CarControl
# to be called @ 100hz
def apply(self, c):
hud_control = c.hudControl
ret = self.CC.update(c.enabled, c.active, self.CS, self.frame,
c.actuators, c.cruiseControl.cancel,
c.hudControl.visualAlert, c.hudControl.leftLaneVisible,
c.hudControl.rightLaneVisible, c.hudControl.leadVisible,
c.hudControl.leftLaneDepart, c.hudControl.rightLaneDepart)
hud_control.visualAlert, hud_control.leftLaneVisible,
hud_control.rightLaneVisible, hud_control.leadVisible,
hud_control.leftLaneDepart, hud_control.rightLaneDepart)
self.frame += 1
return ret

@ -216,11 +216,12 @@ class CarInterface(CarInterfaceBase):
return self.CS.out
def apply(self, c):
hud_control = c.hudControl
ret = self.CC.update(c.enabled, self.CS, self.frame, self.ext_bus, c.actuators,
c.hudControl.visualAlert,
c.hudControl.leftLaneVisible,
c.hudControl.rightLaneVisible,
c.hudControl.leftLaneDepart,
c.hudControl.rightLaneDepart)
hud_control.visualAlert,
hud_control.leftLaneVisible,
hud_control.rightLaneVisible,
hud_control.leftLaneDepart,
hud_control.rightLaneDepart)
self.frame += 1
return ret

Loading…
Cancel
Save