mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-08 07:02:06 +08:00
VW lane lines visual indicator changes (#20676)
* Improve VW HUD with laneless and LDW * No longer depend on laneless param * update behavior * update note * update test route to make CI happy\? * Revert "update test route to make CI happy\?" This reverts commit 21aeecacd578ee287eda52cb674a51611092f272. * always show lane visibility * notes * notes * spelling * reality * remove notes Co-authored-by: Ambroos Vaes <ambroos@fb.com> old-commit-hash: f7ea2cd761a7c497a816f317a6890caa6dd8a195
This commit is contained in:
@@ -20,7 +20,7 @@ class CarController():
|
||||
|
||||
self.steer_rate_limited = False
|
||||
|
||||
def update(self, enabled, CS, frame, actuators, visual_alert, left_lane_visible, right_lane_visible):
|
||||
def update(self, enabled, CS, frame, actuators, visual_alert, left_lane_visible, right_lane_visible, left_lane_depart, right_lane_depart):
|
||||
""" Controls thread """
|
||||
|
||||
P = CarControllerParams
|
||||
@@ -110,18 +110,18 @@ class CarController():
|
||||
# filters LDW_02 from the factory camera and OP emits LDW_02 at 10Hz.
|
||||
|
||||
if frame % P.LDW_STEP == 0:
|
||||
hcaEnabled = True if enabled and not CS.out.standstill else False
|
||||
|
||||
if visual_alert == car.CarControl.HUDControl.VisualAlert.steerRequired:
|
||||
hud_alert = MQB_LDW_MESSAGES["laneAssistTakeOverSilent"]
|
||||
else:
|
||||
hud_alert = MQB_LDW_MESSAGES["none"]
|
||||
|
||||
can_sends.append(volkswagencan.create_mqb_hud_control(self.packer_pt, CANBUS.pt, hcaEnabled,
|
||||
|
||||
can_sends.append(volkswagencan.create_mqb_hud_control(self.packer_pt, CANBUS.pt, enabled,
|
||||
CS.out.steeringPressed, hud_alert, left_lane_visible,
|
||||
right_lane_visible, CS.ldw_lane_warning_left,
|
||||
CS.ldw_lane_warning_right, CS.ldw_side_dlc_tlc,
|
||||
CS.ldw_dlc, CS.ldw_tlc))
|
||||
CS.ldw_dlc, CS.ldw_tlc, CS.out.standstill,
|
||||
left_lane_depart, right_lane_depart))
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# #
|
||||
|
||||
@@ -169,6 +169,8 @@ class CarInterface(CarInterfaceBase):
|
||||
can_sends = self.CC.update(c.enabled, self.CS, self.frame, c.actuators,
|
||||
c.hudControl.visualAlert,
|
||||
c.hudControl.leftLaneVisible,
|
||||
c.hudControl.rightLaneVisible)
|
||||
c.hudControl.rightLaneVisible,
|
||||
c.hudControl.leftLaneDepart,
|
||||
c.hudControl.rightLaneDepart)
|
||||
self.frame += 1
|
||||
return can_sends
|
||||
|
||||
@@ -15,20 +15,20 @@ def create_mqb_steering_control(packer, bus, apply_steer, idx, lkas_enabled):
|
||||
}
|
||||
return packer.make_can_msg("HCA_01", bus, values, idx)
|
||||
|
||||
def create_mqb_hud_control(packer, bus, hca_enabled, steering_pressed, hud_alert, left_lane_visible, right_lane_visible,
|
||||
ldw_lane_warning_left, ldw_lane_warning_right, ldw_side_dlc_tlc, ldw_dlc, ldw_tlc):
|
||||
if hca_enabled:
|
||||
left_lane_hud = 3 if left_lane_visible else 1
|
||||
right_lane_hud = 3 if right_lane_visible else 1
|
||||
else:
|
||||
left_lane_hud = 2 if left_lane_visible else 1
|
||||
right_lane_hud = 2 if right_lane_visible else 1
|
||||
def create_mqb_hud_control(packer, bus, enabled, steering_pressed, hud_alert, left_lane_visible, right_lane_visible,
|
||||
ldw_lane_warning_left, ldw_lane_warning_right, ldw_side_dlc_tlc, ldw_dlc, ldw_tlc,
|
||||
standstill, left_lane_depart, right_lane_depart):
|
||||
# Lane color reference:
|
||||
# 0 (LKAS disabled) - off
|
||||
# 1 (LKAS enabled, no lane detected) - dark gray
|
||||
# 2 (LKAS enabled, lane detected) - light gray on VW, green or white on Audi depending on year or virtual cockpit. On a color MFD on a 2015 A3 TDI it is white, virtual cockpit on a 2018 A3 e-Tron its green.
|
||||
# 3 (LKAS enabled, lane departure detected) - white on VW, red on Audi
|
||||
|
||||
values = {
|
||||
"LDW_Status_LED_gelb": 1 if hca_enabled and steering_pressed else 0,
|
||||
"LDW_Status_LED_gruen": 1 if hca_enabled and not steering_pressed else 0,
|
||||
"LDW_Lernmodus_links": left_lane_hud,
|
||||
"LDW_Lernmodus_rechts": right_lane_hud,
|
||||
"LDW_Status_LED_gelb": 1 if enabled and steering_pressed else 0,
|
||||
"LDW_Status_LED_gruen": 1 if enabled and not steering_pressed else 0,
|
||||
"LDW_Lernmodus_links": 3 if left_lane_depart else 1 + left_lane_visible,
|
||||
"LDW_Lernmodus_rechts": 3 if right_lane_depart else 1 + right_lane_visible,
|
||||
"LDW_Texte": hud_alert,
|
||||
"LDW_SW_Warnung_links": ldw_lane_warning_left,
|
||||
"LDW_SW_Warnung_rechts": ldw_lane_warning_right,
|
||||
|
||||
Reference in New Issue
Block a user