Skip to content

Commit

Permalink
Merge pull request commaai#10 from arne182/dynamic-follow
Browse files Browse the repository at this point in the history
Dynamic follow
  • Loading branch information
sshane authored Mar 15, 2019
2 parents c4e2fac + 58559cd commit b7a09ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions selfdrive/controls/controlsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,15 @@ def state_control(plan, CS, CP, state, events, v_cruise_kph, v_cruise_kph_last,
PL.PP.c_poly, PL.PP.c_prob, CS.steeringAngle,
CS.steeringPressed)
if CS.gasbuttonstatus == 0:
CP.gasMaxV = [0.2, 0.2, 0.2]
if CS.enableGasInterceptor:
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 CS.enableGasInterceptor:
CP.gasMaxV = [0.25, 0.9, 0.9]
else:
CP.gasMaxV = [0.7, 0.9, 0.9]
# Gas/Brake PID loop
actuators.gas, actuators.brake = LoC.update(active, CS.vEgo, CS.brakePressed, CS.standstill, CS.cruiseState.standstill,
v_cruise_kph, plan.vTarget, plan.vTargetFuture, plan.aTarget,
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/mapd/mapd.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ def query_thread():
if dist < 1000:
continue

if dist > 3000:
if dist > 4000:
cache_valid = False

q = build_way_query(last_gps.latitude, last_gps.longitude, radius=3000)
q = build_way_query(last_gps.latitude, last_gps.longitude, radius=4000)
try:
new_result = api.query(q)

Expand Down

0 comments on commit b7a09ba

Please sign in to comment.