clean up blending

pull/27494/head
Shane Smiskol 2 years ago
parent 68a81967dd
commit 81c4f9161a
  1. 7
      selfdrive/car/toyota/carcontroller.py
  2. 4
      selfdrive/car/toyota/toyotacan.py

@ -130,15 +130,12 @@ class CarController:
can_sends.append(create_steer_command(self.packer, 0, 0))
# On TSS2 cars, the LTA and STEER_TORQUE_SENSOR messages use relative steering angle signals that start
# at 0 degrees, so we need to offset the commanded angle as well.
can_sends.append(create_lta_steer_command(self.packer, apply_angle,
CS.out.steeringAngleDeg + CS.out.steeringAngleOffsetDeg,
CS.out.steeringTorque,
apply_steer_req, self.op_params))
can_sends.append(create_lta_steer_command(self.packer, apply_angle, apply_steer_req, self.op_params))
else:
apply_angle = 0
can_sends.append(create_steer_command(self.packer, apply_steer, apply_steer_req))
if TSS2_CAR:
can_sends.append(create_lta_steer_command(self.packer, 0, 0, 0, False, self.op_params))
can_sends.append(create_lta_steer_command(self.packer, 0, False, self.op_params))
self.last_angle = apply_angle
self.last_steer = apply_steer

@ -12,11 +12,9 @@ def create_steer_command(packer, steer, steer_req):
return packer.make_can_msg("STEERING_LKA", 0, values)
def create_lta_steer_command(packer, apply_steer, steer_angle, driver_torque, steer_req, op_params):
def create_lta_steer_command(packer, apply_steer, steer_req, op_params):
"""Creates a CAN message for the Toyota LTA Steer Command."""
# percentage = interp(abs(driver_torque), [40, 100], [100, 0])
# apply_steer = interp(percentage, [-10, 100], [steer_angle, apply_steer])
values = {
# seems to actually be 1. Even 1 on 2023 RAV4 2023 (TODO: check from data)
"SETME_X1": op_params.get("SETME_X1"),

Loading…
Cancel
Save