Skip to content

Commit

Permalink
Merge pull request commaai#140 from ShaneSmiskol/release2
Browse files Browse the repository at this point in the history
Matched gas profiles from dynamic follow to release2
  • Loading branch information
sshane committed Mar 29, 2019
2 parents 0ed236d + 1d4e1bf commit 93df3e0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions selfdrive/controls/controlsd.py
Expand Up @@ -244,10 +244,21 @@ def state_control(plan, path_plan, CS, CP, state, events, v_cruise_kph, v_cruise
angle_offset = learn_angle_offset(active, CS.vEgo, angle_offset,
path_plan.cPoly, path_plan.cProb, CS.steeringAngle,
CS.steeringPressed)
try:
gasinterceptor = CP.enableGasInterceptor
except AttributeError:
gasinterceptor = False

if CS.gasbuttonstatus == 0:
CP.gasMaxV = [0.2, 0.2, 0.2]
if gasinterceptor:
CP.gasMaxV = [0.2, 0.5, 0.7]
else:
CP.gasMaxV = [0.5, 0.7, 0.9]
else:
CP.gasMaxV = [0.2, 0.5, 0.7]
if gasinterceptor:
CP.gasMaxV = [0.25, 0.9, 0.9]
else:
CP.gasMaxV = [0.7, 0.9, 0.9]

cur_time = sec_since_boot() # TODO: This won't work in replay
mpc_time = plan.l20MonoTime / 1e9
Expand Down

0 comments on commit 93df3e0

Please sign in to comment.