diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index 10170bf3ef..0458178ee3 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -155,7 +155,6 @@ class CarInterfaceBase(ABC): # standard ALC params ret.steerControlType = car.CarParams.SteerControlType.torque - # TODO: set PID gains? ret.minSteerSpeed = 0. ret.wheelSpeedFactor = 1.0 diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index 28bd84e43e..ffda8c1712 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -85,9 +85,9 @@ class CarController: # limit max angle error between cmd and actual to reduce EPS integral windup # TODO: can we configure this with a signal? - # apply_angle = clip(apply_angle, - # torque_sensor_angle - self.params.ANGLE_DELTA_MAX, - # torque_sensor_angle + self.params.ANGLE_DELTA_MAX) + apply_angle = clip(apply_angle, + torque_sensor_angle - self.params.ANGLE_DELTA_MAX, + torque_sensor_angle + self.params.ANGLE_DELTA_MAX) # Angular rate limit based on speed apply_angle = apply_std_steer_angle_limits(apply_angle, self.last_angle, CS.out.vEgo, self.params) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index 13cc3846a3..ca96a437a0 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -23,11 +23,11 @@ class CarControllerParams: # stock LTA is 0 to 0.05 going straight # and 0.1 to 0.4 when turning (max seen is 0.6303) - ANGLE_RATE_LIMIT_UP = AngleRateLimit(speed_bp=[0., 5., 15.], angle_v=[3.5, 0.8, .15]) - ANGLE_RATE_LIMIT_DOWN = AngleRateLimit(speed_bp=[0., 5., 15.], angle_v=[3.5, 3.5, 0.4]) + ANGLE_RATE_LIMIT_UP = AngleRateLimit(speed_bp=[0., 5., 15.], angle_v=[2.5, 1.5, 0.5]) + ANGLE_RATE_LIMIT_DOWN = AngleRateLimit(speed_bp=[0., 5., 15.], angle_v=[2.5, 2.5, 1.5]) # needs to be within +-3 degrees of current angle to avoid windup - ANGLE_DELTA_MAX = 15 + ANGLE_DELTA_MAX = 5 def __init__(self, CP): if CP.lateralTuning.which == 'torque':