angle steer max

This commit is contained in:
ajouatom 2025-02-19 15:01:12 +09:00
parent f03e37d446
commit 9a1692569e

View File

@ -79,6 +79,7 @@ class CarController(CarControllerBase):
self.apply_angle_last = 0
self.lkas_max_torque = 0
self.driver_applied_torque_reducer = 0
self.angle_max_torque = 200
self.canfd_debug = 0
@ -92,6 +93,9 @@ class CarController(CarControllerBase):
steerDeltaDown = params.get_int("CustomSteerDeltaDown")
if steerMax > 0:
self.params.STEER_MAX = steerMax
self.angle_max_torque = steerMax
else:
self.angle_max_torque = 200
if steerDeltaUp > 0:
self.params.STEER_DELTA_UP = steerDeltaUp
if steerDeltaDown > 0:
@ -132,7 +136,7 @@ class CarController(CarControllerBase):
#ego_weight = np.interp(CS.out.vEgoCluster, [0, 5, 10, 20], [0.2, 0.3, 0.5, 1.0])
#self.driver_applied_torque_reducer = max(30, min(150, self.driver_applied_torque_reducer + (-1 if abs(CS.out.steeringTorque) > 200 else 1)))
#self.lkas_max_torque = int(round(max_torque * ego_weight * (self.driver_applied_torque_reducer / 150)))
MAX_TORQUE = 200
MAX_TORQUE = self.angle_max_torque
ego_weight = np.interp(CS.out.vEgo, [0, 5, 10, 20], [0.2, 0.3, 0.5, 1.0])
if abs(CS.out.steeringTorque) > 700:
self.driver_applied_torque_reducer -= 1