parent
a1dee3177d
commit
54e2d7d190
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue