Skip to content

Commit

Permalink
attempt #3
Browse files Browse the repository at this point in the history
  • Loading branch information
wocsor committed Oct 18, 2018
1 parent f8b835a commit 804d425
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions selfdrive/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,15 @@ def update(self, sendcan, enabled, CS, frame, actuators,
# send exactly zero if apply_gas is zero. Interceptor will send the max between read value and apply_gas.
# This prevents unexpected pedal range rescaling
if CS.CP.carFingerprint == CAR.PRIUS and CS.pcm_acc_status == 7 and actuators.gas > 0:
counter = counter + 1
global counter += 1
if counter <= 30:
can_sends.append(create_gas_command(self.packer, 0.3))
can_sends.append(create_gas_command(self.packer, apply_gas)
if counter > 30 < 60:
can_sends.append(create_gas_command(self.packer, 0))
if counter >= 60:
counter = 0
else:
counter = 0
can_sends.append(create_gas_command(self.packer, apply_gas))

if frame % 10 == 0 and ECU.CAM in self.fake_ecus and self.car_fingerprint not in NO_DSU_CAR:
Expand Down

0 comments on commit 804d425

Please sign in to comment.