mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 00:43:54 +08:00
Toyota: rename LTA torque wind down signal (#30603)
* bump * rename * bump
This commit is contained in:
2
opendbc
2
opendbc
Submodule opendbc updated: ed3af3da1b...5b0c73977f
2
panda
2
panda
Submodule panda updated: 892ca5a0f1...ea78657bef
@@ -88,15 +88,15 @@ class CarController:
|
||||
# STEERING_LTA does not seem to allow more rate by sending faster, and may wind up easier
|
||||
if self.frame % 2 == 0 and self.CP.carFingerprint in TSS2_CAR:
|
||||
lta_active = lat_active and self.CP.steerControlType == SteerControlType.angle
|
||||
# cut steering torque with SETME_X64 when either EPS torque or driver torque is above
|
||||
# cut steering torque with TORQUE_WIND_DOWN when either EPS torque or driver torque is above
|
||||
# the threshold, to limit max lateral acceleration and for driver torque blending respectively.
|
||||
full_torque_condition = (abs(CS.out.steeringTorqueEps) < self.params.STEER_MAX and
|
||||
abs(CS.out.steeringTorque) < MAX_LTA_DRIVER_TORQUE_ALLOWANCE)
|
||||
|
||||
# SETME_X64 at 0 ramps down torque at roughly the max down rate of 1500 units/sec
|
||||
setme_x64 = 100 if lta_active and full_torque_condition else 0
|
||||
# TORQUE_WIND_DOWN at 0 ramps down torque at roughly the max down rate of 1500 units/sec
|
||||
torque_wind_down = 100 if lta_active and full_torque_condition else 0
|
||||
can_sends.append(toyotacan.create_lta_steer_command(self.packer, self.CP.steerControlType, self.last_angle,
|
||||
lta_active, self.frame // 2, setme_x64))
|
||||
lta_active, self.frame // 2, torque_wind_down))
|
||||
|
||||
# *** gas and brake ***
|
||||
if self.CP.enableGasInterceptor and CC.longActive:
|
||||
|
||||
@@ -14,7 +14,7 @@ def create_steer_command(packer, steer, steer_req):
|
||||
return packer.make_can_msg("STEERING_LKA", 0, values)
|
||||
|
||||
|
||||
def create_lta_steer_command(packer, steer_control_type, steer_angle, steer_req, frame, setme_x64):
|
||||
def create_lta_steer_command(packer, steer_control_type, steer_angle, steer_req, frame, torque_wind_down):
|
||||
"""Creates a CAN message for the Toyota LTA Steer Command."""
|
||||
|
||||
values = {
|
||||
@@ -23,7 +23,7 @@ def create_lta_steer_command(packer, steer_control_type, steer_angle, steer_req,
|
||||
# 1 for TSS 2.5 cars, 3 for TSS 2.0. Send based on whether we're using LTA for lateral control
|
||||
"SETME_X3": 1 if steer_control_type == SteerControlType.angle else 3,
|
||||
"PERCENTAGE": 100,
|
||||
"SETME_X64": setme_x64,
|
||||
"TORQUE_WIND_DOWN": torque_wind_down,
|
||||
"ANGLE": 0,
|
||||
"STEER_ANGLE_CMD": steer_angle,
|
||||
"STEER_REQUEST": steer_req,
|
||||
|
||||
Reference in New Issue
Block a user