HKG: resume from standstill for HDA1 CAN-FD (#26069)

* Cruise Button Press on bus 6 for HDA1 Canfd

* use bus helper

* Update hyundaicanfd.py

* Update hyundaicanfd.py

* Update hyundaicanfd.py

* Update hyundaicanfd.py

* Update selfdrive/car/hyundai/hyundaicanfd.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Update selfdrive/car/hyundai/hyundaicanfd.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* bump panda

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 3ee8572d58
taco
hoomoose 3 years ago committed by GitHub
parent f72219ed1d
commit e224d17fbc
  1. 2
      panda
  2. 9
      selfdrive/car/hyundai/carcontroller.py
  3. 8
      selfdrive/car/hyundai/hyundaicanfd.py

@ -1 +1 @@
Subproject commit b95a65df58fea89b42b7c6b4fc85289b93a0bdb2
Subproject commit dd751862c34f6a9c9c95748acaf31b8534b42497

@ -135,14 +135,17 @@ class CarController:
self.last_button_frame = self.frame
else:
for _ in range(20):
can_sends.append(hyundaicanfd.create_buttons(self.packer, CS.buttons_counter+1, Buttons.CANCEL))
can_sends.append(hyundaicanfd.create_buttons(self.packer, self.CP, CS.buttons_counter+1, Buttons.CANCEL))
self.last_button_frame = self.frame
# cruise standstill resume
elif CC.cruiseControl.resume:
if not (self.CP.flags & HyundaiFlags.CANFD_ALT_BUTTONS):
if self.CP.flags & HyundaiFlags.CANFD_ALT_BUTTONS:
# TODO: resume for alt button cars
pass
else:
for _ in range(20):
can_sends.append(hyundaicanfd.create_buttons(self.packer, CS.buttons_counter+1, Buttons.RES_ACCEL))
can_sends.append(hyundaicanfd.create_buttons(self.packer, self.CP, CS.buttons_counter+1, Buttons.RES_ACCEL))
self.last_button_frame = self.frame
else:
can_sends.append(hyundaican.create_lkas11(self.packer, self.frame, self.car_fingerprint, apply_steer, lat_active,

@ -3,7 +3,7 @@ from selfdrive.car.hyundai.values import HyundaiFlags
def get_e_can_bus(CP):
# On the CAN-FD platforms, the LKAS camera is on both A-CAN and E-CAN. HDA2 cars
# have a a different harness than the HDA1 and non-HDA variants in order to split
# have a different harness than the HDA1 and non-HDA variants in order to split
# a different bus, since the steering is done by different ECUs.
return 5 if CP.flags & HyundaiFlags.CANFD_HDA2 else 4
@ -39,13 +39,15 @@ def create_cam_0x2a4(packer, camera_values):
})
return packer.make_can_msg("CAM_0x2a4", 4, camera_values)
def create_buttons(packer, cnt, btn):
def create_buttons(packer, CP, cnt, btn):
values = {
"COUNTER": cnt,
"SET_ME_1": 1,
"CRUISE_BUTTONS": btn,
}
return packer.make_can_msg("CRUISE_BUTTONS", 5, values)
bus = 5 if CP.flags & HyundaiFlags.CANFD_HDA2 else 6
return packer.make_can_msg("CRUISE_BUTTONS", bus, values)
def create_acc_cancel(packer, CP, cruise_info_copy):
values = cruise_info_copy

Loading…
Cancel
Save