Skip to content

Commit

Permalink
dont copy acc state from autopilot computer
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasloetkolben committed Oct 14, 2024
1 parent 3fc9bdb commit b8b3ae0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions opendbc/car/tesla/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ def update(self, CC, CS, now_nanos):

# Longitudinal control
if self.CP.openpilotLongitudinalControl and self.frame % 4 == 0:
state = CS.das_control["DAS_accState"]
if hands_on_fault:
state = 13 # "ACC_CANCEL_GENERIC_SILENT"
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
can_sends.append(self.tesla_can.create_longitudinal_command(state, accel, cntr))
Expand Down

0 comments on commit b8b3ae0

Please sign in to comment.