Merge branch 'mqb-long-prereqs' into mqb-long

# Conflicts:
#	selfdrive/car/volkswagen/carcontroller.py
#	selfdrive/car/volkswagen/carstate.py
#	selfdrive/car/volkswagen/interface.py
pull/23257/head
Jason Young 4 years ago
commit 9931c0b6f4
  1. 5
      selfdrive/car/volkswagen/carcontroller.py
  2. 8
      selfdrive/car/volkswagen/carstate.py

@ -143,16 +143,15 @@ class CarController():
# FIXME: this entire section is in desperate need of refactoring
if not CS.CP.openpilotLongitudinalControl:
if CS.CP.pcmCruise:
if frame > self.graMsgStartFramePrev + P.GRA_VBP_STEP:
if not enabled and CS.out.cruiseState.enabled:
# Cancel ACC if it's engaged with OP disengaged.
self.graButtonStatesToSend = BUTTON_STATES.copy()
self.graButtonStatesToSend["cancel"] = True
elif enabled and CS.out.standstill and CS.esp_hold_confirmation:
elif enabled and CS.esp_hold_confirmation:
# Blip the Resume button if we're engaged at standstill.
# FIXME: This is a naive implementation, improve with visiond or radar input.
# A subset of MQBs like to "creep" too aggressively with this implementation.
self.graButtonStatesToSend = BUTTON_STATES.copy()
self.graButtonStatesToSend["resumeCruise"] = True

@ -27,7 +27,7 @@ class CarState(CarStateBase):
ret.vEgoRaw = float(np.mean([ret.wheelSpeeds.fl, ret.wheelSpeeds.fr, ret.wheelSpeeds.rl, ret.wheelSpeeds.rr]))
ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw)
ret.standstill = ret.vEgoRaw < 0.1
ret.standstill = ret.vEgo < 0.1
# Update steering angle, rate, yaw rate, and driver input torque. VW send
# the sign/direction in a separate signal so they must be recombined.
@ -109,9 +109,9 @@ class CarState(CarStateBase):
ret.cruiseState.available = False
ret.cruiseState.enabled = False
if not self.CP.openpilotLongitudinalControl:
# Update ACC setpoint. When the setpoint is zero or there's an error, the
# radar sends a set-speed of ~90.69 m/s / 203mph.
# Update ACC setpoint. When the setpoint is zero or there's an error, the
# radar sends a set-speed of ~90.69 m/s / 203mph.
if self.CP.pcmCruise:
ret.cruiseState.speed = ext_cp.vl["ACC_02"]["ACC_Wunschgeschw"] * CV.KPH_TO_MS
if ret.cruiseState.speed > 90:
ret.cruiseState.speed = 0

Loading…
Cancel
Save