Skip to content

Commit

Permalink
EV6: supress LFA (#25094)
Browse files Browse the repository at this point in the history
* EV6: supress LFA

* bump panda
  • Loading branch information
adeebshihadeh authored Jul 9, 2022
1 parent cbff8fc commit f261b8a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion opendbc
Submodule opendbc updated 1 files
+25 −0 kia_ev6.dbc
2 changes: 1 addition & 1 deletion panda
3 changes: 3 additions & 0 deletions selfdrive/car/hyundai/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def update(self, CC, CS):
# steering control
can_sends.append(hda2can.create_lkas(self.packer, CC.enabled, self.frame, CC.latActive, apply_steer))

if self.frame % 5 == 0:
can_sends.append(hda2can.create_cam_0x2a4(self.packer, self.frame, CS.cam_0x2a4))

# cruise cancel
if (self.frame - self.last_button_frame) * DT_CTRL > 0.25:
if CC.cruiseControl.cancel:
Expand Down
5 changes: 4 additions & 1 deletion selfdrive/car/hyundai/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def update_hda2(self, cp, cp_cam):
ret.cruiseState.speed = cp.vl["CRUISE_INFO"]["SET_SPEED"] * speed_factor

self.buttons_counter = cp.vl["CRUISE_BUTTONS"]["_COUNTER"]
self.cam_0x2a4 = copy.copy(cp_cam.vl["CAM_0x2a4"])

return ret

Expand Down Expand Up @@ -313,7 +314,9 @@ def get_can_parser(CP):
@staticmethod
def get_cam_can_parser(CP):
if CP.carFingerprint in HDA2_CAR:
return None
signals = [(f"BYTE{i}", "CAM_0x2a4") for i in range(3, 24)]
checks = [("CAM_0x2a4", 20)]
return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 6)

signals = [
# signal_name, signal_address
Expand Down
5 changes: 5 additions & 0 deletions selfdrive/car/hyundai/hda2can.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ def create_lkas(packer, enabled, frame, lat_active, apply_steer):
}
return packer.make_can_msg("LKAS", 4, values, frame % 255)

def create_cam_0x2a4(packer, frame, camera_values):
camera_values.update({
"BYTE7": 0,
})
return packer.make_can_msg("CAM_0x2a4", 4, camera_values, frame % 255)

def create_buttons(packer, cnt, cancel, resume):
values = {
Expand Down

0 comments on commit f261b8a

Please sign in to comment.