From 4c77b9162e3b4f2b0e5aa789e822b108f8716d71 Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Wed, 3 Jul 2019 13:27:37 +1000 Subject: [PATCH] =?UTF-8?q?=E7=95=B6=E8=BD=89=E5=90=91=E7=87=88=E6=9A=AB?= =?UTF-8?q?=E5=81=9C=E6=96=B9=E5=90=91=E6=8E=A7=E5=88=B6=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E9=96=8B=E5=95=9F=E6=99=82=EF=BC=8C=E6=88=91=E5=80=91=E5=9C=A8?= =?UTF-8?q?=E6=96=B9=E5=90=91=E7=87=88=E9=97=9C=E9=96=89=E5=BE=8C=E4=B8=80?= =?UTF-8?q?=E7=A7=92=E5=8F=96=E5=9B=9E=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- selfdrive/car/honda/carcontroller.py | 11 ++++++++++- selfdrive/car/toyota/carcontroller.py | 12 ++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index 99e303439..3fc2915b7 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -85,6 +85,9 @@ class CarController(object): self.packer = CANPacker(dbc_name) self.new_radar_config = False + # dragonpilot + self.turning_signal_timer = 0 + def update(self, enabled, CS, frame, actuators, \ pcm_speed, pcm_override, pcm_cancel_cmd, pcm_accel, \ hud_v_cruise, hud_show_lanes, hud_show_car, \ @@ -148,8 +151,14 @@ class CarController(object): # Send CAN commands. can_sends = [] - if (CS.left_blinker_on > 0 or CS.right_blinker_on > 0) and params.get("DragonTempDisableSteerOnSignal") == "1": + # dragonpilot + if enabled and (CS.left_blinker_on > 0 or CS.right_blinker_on > 0) and params.get("DragonTempDisableSteerOnSignal") == "1": + self.turning_signal_timer = 100 + + if self.turning_signal_timer > 0: + self.turning_signal_timer -= 1 apply_steer = 0 + # Send steering command. idx = frame % 4 can_sends.append(hondacan.create_steering_control(self.packer, apply_steer, diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index 0708ed1c2..4c80822cc 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -126,6 +126,9 @@ class CarController(object): self.packer = CANPacker(dbc_name) + # dragonpilot + self.turning_signal_timer = 0 + def update(self, enabled, CS, frame, actuators, pcm_cancel_cmd, hud_alert, audible_alert, forwarding_camera, left_line, right_line, lead, left_lane_depart, right_lane_depart): @@ -200,9 +203,14 @@ class CarController(object): can_sends = [] - if (CS.left_blinker_on or CS.right_blinker_on) and params.get("DragonTempDisableSteerOnSignal") == "1": + # dragonpilot + if enabled and (CS.left_blinker_on or CS.right_blinker_on) and params.get("DragonTempDisableSteerOnSignal") == "1": + self.turning_signal_timer = 100 + + if self.turning_signal_timer > 0: + self.turning_signal_timer -= 1 apply_steer = 0 - apply_steer_req = 0 + #*** control msgs *** #print("steer {0} {1} {2} {3}".format(apply_steer, min_lim, max_lim, CS.steer_torque_motor)