From e9c477dcf2737985f89e4d76665bc9f05b25c94d Mon Sep 17 00:00:00 2001 From: Ted Slesinski Date: Tue, 28 Nov 2017 17:14:40 -0500 Subject: [PATCH] Add hondacan changes --- selfdrive/car/honda/hondacan.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/selfdrive/car/honda/hondacan.py b/selfdrive/car/honda/hondacan.py index 31615a8cbb..0c53f243d9 100644 --- a/selfdrive/car/honda/hondacan.py +++ b/selfdrive/car/honda/hondacan.py @@ -79,7 +79,7 @@ def create_steering_control(apply_steer, crv, idx): commands.append(make_can_msg(0xe4, msg_0xe4, idx, 0)) return commands -def create_ui_commands(pcm_speed, hud, civic, accord, crv, idx): +def create_ui_commands(pcm_speed, hud, civic, accord, crv, odyssey, idx): """Creates an iterable of CAN messages for the UIs.""" commands = [] pcm_speed_real = np.clip(int(round(pcm_speed / 0.002759506)), 0, @@ -90,17 +90,17 @@ def create_ui_commands(pcm_speed, hud, civic, accord, crv, idx): msg_0x33d = chr(hud.X5) + chr(hud.lanes) + chr(hud.beep) + chr(hud.X8) commands.append(make_can_msg(0x33d, msg_0x33d, idx, 0)) - if civic: # 2 more msgs + if civic or odyssey: # 2 more msgs msg_0x35e = chr(0) * 7 commands.append(make_can_msg(0x35e, msg_0x35e, idx, 0)) - if civic or accord: + if civic or accord or odyssey: msg_0x39f = ( chr(0) * 2 + chr(hud.acc_alert) + chr(0) + chr(0xff) + chr(0x7f) + chr(0) ) commands.append(make_can_msg(0x39f, msg_0x39f, idx, 0)) return commands -def create_radar_commands(v_ego, civic, accord, crv, idx): +def create_radar_commands(v_ego, civic, accord, crv, odyssey, idx): """Creates an iterable of CAN messages for the radar system.""" commands = [] v_ego_kph = np.clip(int(round(v_ego * CV.MS_TO_KPH)), 0, 255) @@ -122,6 +122,9 @@ def create_radar_commands(v_ego, civic, accord, crv, idx): elif crv: msg_0x301 = "\x00\x00\x50\x02\x51\x00\x00" commands.append(make_can_msg(0x300, msg_0x300, idx, 1)) + elif odyssey: + msg_0x301 = "\x00\x00\x56\x02\x55\x00\x00" + commands.append(make_can_msg(0x300, msg_0x300, idx, 1)) else: msg_0x301 = "\x0f\x18\x51\x02\x5a\x00\x00" commands.append(make_can_msg(0x300, msg_0x300, idx, 1))