Skip to content

Commit

Permalink
Hyundai: radar interface fixups (commaai#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyhaibin authored Sep 27, 2023
1 parent 67208ee commit 5dbecc7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions selfdrive/car/hyundai/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
def get_radar_can_parser(CP):
if DBC[CP.carFingerprint]['radar'] is None:
if CP.spFlags & HyundaiFlagsSP.SP_ENHANCED_SCC:
messages = ("ESCC", 50)
return CANParser(DBC[CP.carFingerprint]['pt'], messages, 0)
lead_src, bus = "ESCC", 0
else:
return None
messages = [(lead_src, 50)]
return CANParser(DBC[CP.carFingerprint]['pt'], messages, bus)

messages = [(f"RADAR_TRACK_{addr:x}", 50) for addr in range(RADAR_START_ADDR, RADAR_START_ADDR + RADAR_MSG_COUNT)]
return CANParser(DBC[CP.carFingerprint]['radar'], messages, 1)
Expand Down

0 comments on commit 5dbecc7

Please sign in to comment.