Skip to content

Commit

Permalink
Update interface.py get_pid_accel_limits function
Browse files Browse the repository at this point in the history
Added Honda Clarity specific comma pedal interpolation logic
  • Loading branch information
roenthomas authored Dec 26, 2024
1 parent 91ca0a3 commit 0806f43
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion selfdrive/car/honda/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ class CarInterface(CarInterfaceBase):
def get_pid_accel_limits(CP, current_speed, cruise_speed):
if CP.carFingerprint in HONDA_BOSCH:
return CarControllerParams.BOSCH_ACCEL_MIN, CarControllerParams.BOSCH_ACCEL_MAX
elif CP.enableGasInterceptor:
elif CP.enableGasInterceptor and (CP.carFingerprint == (CAR.HONDA_CLARITY)):
# Honda Clarity specific pedal interpolation
CLARITY_PEDAL_MAX = interp(current_speed, [0, 2.2, 4.5, 6.7, 22.3, 44.7], [3.5, 3.0, 2.5, 1.6, 1.0, 1.0])
return CarControllerParams.NIDEC_ACCEL_MIN, CLARITY_PEDAL_MAX
elif CP.enableGasInterceptor and (CP.carFingerprint != (CAR.HONDA_CLARITY)):
return CarControllerParams.NIDEC_ACCEL_MIN, CarControllerParams.NIDEC_ACCEL_MAX
else:
# NIDECs don't allow acceleration near cruise_speed,
Expand Down

0 comments on commit 0806f43

Please sign in to comment.