set freewheel and stop distance correctly

pull/23257/head
Jason Young 4 years ago
parent 3e0caf9882
commit ea536b44d5
  1. 3
      selfdrive/car/volkswagen/carcontroller.py
  2. 2
      selfdrive/car/volkswagen/volkswagencan.py

@ -44,7 +44,7 @@ class CarController():
accel = clip(actuators.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, acc_hold_type, stopping_distance = False, False, 0, 0
acc_hold_request, acc_hold_release, acc_hold_type, stopping_distance = False, False, 0, 20.46
if actuators.longControlState == LongCtrlState.stopping and CS.out.vEgo < 0.2:
self.acc_stopping = True
acc_hold_request = True
@ -61,7 +61,6 @@ class CarController():
self.acc_starting &= CS.out.vEgo < 1.5
acc_hold_release = self.acc_starting
acc_hold_type = 4 if self.acc_starting and CS.out.vEgo < 0.1 else 0 # startup
stopping_distance = 20.46
else:
self.acc_stopping, self.acc_starting = False, False

@ -70,7 +70,7 @@ def create_mqb_acc_07_control(packer, bus, enabled, accel, acc_hold_request, acc
values = {
"ACC_Distance_to_Stop": stopping_distance,
"ACC_Hold_Request": acc_hold_request,
"ACC_Freewheel_Type": 2,
"ACC_Freewheel_Type": 2 if enabled else 0,
"ACC_Hold_Type": acc_hold_type,
"ACC_Hold_Release": acc_hold_release,
"ACC_Accel_Secondary": accel if enabled else 0,

Loading…
Cancel
Save