Skip to content

Commit

Permalink
Add limit RSA logic
Browse files Browse the repository at this point in the history
  • Loading branch information
arne182 authored Mar 24, 2020
1 parent bde5fd8 commit 71935ab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions selfdrive/car/toyota/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
from selfdrive.config import Conversions as CV
from common.travis_checker import travis
from selfdrive.car.toyota.values import CAR, DBC, STEER_THRESHOLD, TSS2_CAR, NO_STOP_TIMER_CAR
from common.op_params import opParams

op_params = opParams()
rsa_max_speed = op_params.get('rsa_max_speed', 24.5)
limit_rsa = op_params.get('limit_rsa', False)

class CarState(CarStateBase):
def __init__(self, CP):
Expand Down Expand Up @@ -284,6 +289,8 @@ def update(self, cp, cp_cam, frame):
dat.liveTrafficData.speedAdvisory = self.spdval2
else:
dat.liveTrafficData.speedAdvisoryValid = False
if limit_rsa and rsa_max_speed < ret.vEgo:
dat.liveTrafficData.speedLimitValid = False
if not travis:
self.arne_pm.send('liveTrafficData', dat)

Expand Down

0 comments on commit 71935ab

Please sign in to comment.