mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-08-07 17:25:40 +08:00
當轉向燈暫停方向控制功能開啟時,我們在方向燈關閉後一秒取回控制
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user