Skip to content

Commit

Permalink
rework. more similar to commaai#30850
Browse files Browse the repository at this point in the history
  • Loading branch information
csouers committed Jan 14, 2024
1 parent 1df94dc commit 99d4339
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
5 changes: 2 additions & 3 deletions selfdrive/car/honda/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,8 @@ def update(self, CC, CS, now_nanos):
elif self.CP.carFingerprint not in HONDA_BOSCH_RADARLESS and CC.cruiseControl.resume:
button = CruiseButtons.RES_ACCEL
elif self.CP.carFingerprint in HONDA_BOSCH_RADARLESS and CC.enabled and self.frame % 4 == 0:
# Radarless:
# Send buttons to the camera at 25hz when controls are allowed. panda forwards this when disengaged so controls remain
# tied to the PCM. Keep stock LKAS disabled as it can disengage cruise when the wheel touch timer expires.
# Radarless: send buttons at 25hz when engaged. panda forwards the car's buttons frame when disengaged.
# Keep stock LKAS disabled as it can disengage cruise when the wheel touch timer expires.
# Priority: pcm_cancel > user cruise buttons > user setting buttons > auto resume > disable LKAS > none
button = CruiseButtons.NONE
if CS.cruise_buttons:
Expand Down
10 changes: 5 additions & 5 deletions selfdrive/car/honda/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
ButtonType = car.CarState.ButtonEvent.Type
EventName = car.CarEvent.EventName
TransmissionType = car.CarParams.TransmissionType
BUTTONS_DICT = [{CruiseButtons.RES_ACCEL: ButtonType.accelCruise, CruiseButtons.DECEL_SET: ButtonType.decelCruise,
CruiseButtons.MAIN: ButtonType.altButton3, CruiseButtons.CANCEL: ButtonType.cancel},
{CruiseButtons.LKAS: ButtonType.altButton1, CruiseButtons.DISTANCE: ButtonType.gapAdjustCruise}]
CRUISE_BUTTONS_DICT = {CruiseButtons.RES_ACCEL: ButtonType.accelCruise, CruiseButtons.DECEL_SET: ButtonType.decelCruise,
CruiseButtons.MAIN: ButtonType.altButton3, CruiseButtons.CANCEL: ButtonType.cancel}
SETTINGS_BUTTONS_DICT = {CruiseButtons.DISTANCE: ButtonType.gapAdjustCruise, CruiseButtons.LKAS: ButtonType.altButton1}


class CarInterface(CarInterfaceBase):
Expand Down Expand Up @@ -313,8 +313,8 @@ def _update(self, c):
ret = self.CS.update(self.cp, self.cp_cam, self.cp_body)

ret.buttonEvents = [
*create_button_events(self.CS.cruise_buttons, self.CS.prev_cruise_buttons, BUTTONS_DICT[0]),
*create_button_events(self.CS.cruise_setting, self.CS.prev_cruise_setting, BUTTONS_DICT[1]),
*create_button_events(self.CS.cruise_buttons, self.CS.prev_cruise_buttons, CRUISE_BUTTONS_DICT),
*create_button_events(self.CS.cruise_setting, self.CS.prev_cruise_setting, SETTINGS_BUTTONS_DICT),
]

# events
Expand Down
3 changes: 2 additions & 1 deletion selfdrive/car/honda/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class CruiseButtons:
CANCEL = 2
MAIN = 1
NONE = 0
# For CRUISE_SETTING signal

# CRUISE_SETTINGS
DISTANCE = 3
LKAS = 1

Expand Down

0 comments on commit 99d4339

Please sign in to comment.