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 21aeecacd5.

* always show lane visibility

* notes

* notes

* spelling

* reality

* remove notes

Co-authored-by: Ambroos Vaes <ambroos@fb.com>
pull/20768/head
Samuel Keeley 4 years ago committed by GitHub
parent 83e8ccb4ef
commit f7ea2cd761
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      selfdrive/car/volkswagen/carcontroller.py
  2. 4
      selfdrive/car/volkswagen/interface.py
  3. 24
      selfdrive/car/volkswagen/volkswagencan.py

@ -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,

Loading…
Cancel
Save