Tesla: add missing parameter (#1445)

add missing parameter
This commit is contained in:
Lukas 2024-11-06 19:32:02 +01:00 committed by GitHub
parent a1dee3177d
commit 54e2d7d190
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -43,13 +43,13 @@ class CarController(CarControllerBase):
if self.CP.openpilotLongitudinalControl and self.frame % 4 == 0:
state = 4 if not hands_on_fault else 13 # 4=ACC_ON, 13=ACC_CANCEL_GENERIC_SILENT
accel = clip(actuators.accel, CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX)
cntr = (self.frame // 4) % 8
cntr = (self.frame // 4) % 8
can_sends.append(self.tesla_can.create_longitudinal_command(state, accel, cntr, CC.longActive))
# Increment counter so cancel is prioritized even without openpilot longitudinal
if hands_on_fault and not self.CP.openpilotLongitudinalControl:
cntr = (CS.das_control["DAS_controlCounter"] + 1) % 8
can_sends.append(self.tesla_can.create_longitudinal_command(13, 0, cntr))
can_sends.append(self.tesla_can.create_longitudinal_command(13, 0, cntr, False))
# TODO: HUD control
new_actuators = actuators.as_builder()