Skip to content

Commit 2c6669d

Browse files
committedApr 3, 2019
Try yanking calc_accel_override to fix slow restart
1 parent 1065d69 commit 2c6669d

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed
 

‎selfdrive/car/gm/interface.py

+1-29
Original file line numberDiff line numberDiff line change
@@ -58,35 +58,7 @@ def compute_gb(accel, speed):
5858

5959
@staticmethod
6060
def calc_accel_override(a_ego, a_target, v_ego, v_target):
61-
62-
# normalized max accel. Allowing max accel at low speed causes speed overshoots
63-
max_accel_bp = [10, 20] # m/s
64-
max_accel_v = [0.714, 1.0] # unit of max accel
65-
max_accel = interp(v_ego, max_accel_bp, max_accel_v)
66-
67-
# limit the pcm accel cmd if:
68-
# - v_ego exceeds v_target, or
69-
# - a_ego exceeds a_target and v_ego is close to v_target
70-
71-
eA = a_ego - a_target
72-
valuesA = [1.0, 0.1]
73-
bpA = [0.3, 1.1]
74-
75-
eV = v_ego - v_target
76-
valuesV = [1.0, 0.1]
77-
bpV = [0.0, 0.5]
78-
79-
valuesRangeV = [1., 0.]
80-
bpRangeV = [-1., 0.]
81-
82-
# only limit if v_ego is close to v_target
83-
speedLimiter = interp(eV, bpV, valuesV)
84-
accelLimiter = max(interp(eA, bpA, valuesA), interp(eV, bpRangeV, valuesRangeV))
85-
86-
# accelOverride is more or less the max throttle allowed to pcm: usually set to a constant
87-
# unless aTargetMax is very high and then we scale with it; this help in quicker restart
88-
89-
return float(max(max_accel, a_target / A_ACC_MAX)) * min(speedLimiter, accelLimiter)
61+
return 1.0
9062

9163
@staticmethod
9264
def get_params(candidate, fingerprint):

0 commit comments

Comments
 (0)