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)