tweaks and comments

pull/23257/head
Jason Young 4 years ago
parent d638234c6c
commit 0907a845dd
  1. 14
      selfdrive/car/volkswagen/carcontroller.py
  2. 1
      selfdrive/car/volkswagen/interface.py

@ -41,25 +41,25 @@ class CarController():
acc_status = CS.tsk_status acc_status = CS.tsk_status
accel = actuators.accel if enabled else 0 accel = actuators.accel if enabled else 0
accel = clip(accel, P.ACCEL_MIN, P.ACCEL_MAX) if enabled else 0 accel = clip(accel, P.ACCEL_MIN, P.ACCEL_MAX) if enabled else 0
# FIXME: this needs to become a proper state machine
acc_hold_request, acc_hold_release = False, False acc_hold_request, acc_hold_release = False, False
if actuators.longControlState == LongCtrlState.stopping: if actuators.longControlState == LongCtrlState.stopping:
accel = -1.0
self.acc_stopping = True self.acc_stopping = True
acc_hold_request = not CS.esp_hold_confirmation acc_hold_request = not CS.esp_hold_confirmation # Send hold request for ABS/ESP brake-hold until acked
elif enabled: elif enabled:
if self.acc_stopping: if self.acc_stopping:
self.acc_starting = True self.acc_starting = True
self.acc_stopping = False self.acc_stopping = False
self.acc_starting &= CS.out.vEgo < 0.2 self.acc_starting &= CS.out.vEgo < CS.CP.vEgoStarting
acc_hold_release = CS.esp_hold_confirmation acc_hold_release = CS.esp_hold_confirmation # Send release request for ABS/ESP brake-hold until acked
else: else:
self.acc_stopping, self.acc_starting = False, False self.acc_stopping, self.acc_starting = False, False
cb_pos = 0.0 if lead_visible else 0.1 # Hopefully, have PI yank the lag out and let the drivetrain coordinator make it smooth again
cb_neg = 0.1 cb_pos = 0.2
cb_neg = 0.2
if acc_hold_request: if acc_hold_request:
weird_value = 0x88 weird_value = 0x88

@ -72,6 +72,7 @@ class CarInterface(CarInterfaceBase):
ret.longitudinalActuatorDelayUpperBound = 1.0 # s ret.longitudinalActuatorDelayUpperBound = 1.0 # s
ret.stoppingControl = True ret.stoppingControl = True
ret.vEgoStopping = 0.3 ret.vEgoStopping = 0.3
ret.vEgoStarting = 0.3
#ret.stopAccel = 0.0 #ret.stopAccel = 0.0
#ret.startAccel = 0.0 #ret.startAccel = 0.0
ret.longitudinalTuning.kpV = [0.3] ret.longitudinalTuning.kpV = [0.3]

Loading…
Cancel
Save