Skip to content

Commit

Permalink
Change lkas_status to green or white only
Browse files Browse the repository at this point in the history
  • Loading branch information
keyeh committed Oct 14, 2024
1 parent 19b54a2 commit cda06b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions selfdrive/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,9 @@ def update(self, CC, CS, now_nanos, frogpilot_toggles):
send_ui = True

if self.frame % 20 == 0 or send_ui:
lat_available = frogpilot_toggles.always_on_lateral and CS.out.cruiseState.available # TODO: and not "always_on_lateral_disabled" by LTA button
can_sends.append(toyotacan.create_ui_command(self.packer, steer_alert, pcm_cancel_cmd, hud_control.leftLaneVisible,
hud_control.rightLaneVisible, hud_control.leftLaneDepart,
hud_control.rightLaneDepart, lat_available, CS.lkas_hud, lat_active, CS.out.steeringPressed))
hud_control.rightLaneDepart, CC.enabled, CS.lkas_hud, lat_active, CS.out.steeringPressed))

if (self.frame % 100 == 0 or send_ui) and (self.CP.enableDsu or self.CP.flags & ToyotaFlags.DISABLE_RADAR.value):
can_sends.append(toyotacan.create_fcw_command(self.packer, fcw_alert))
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/car/toyota/toyotacan.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ def create_fcw_command(packer, fcw):
return packer.make_can_msg("PCS_HUD", 0, values)


def create_ui_command(packer, steer, chime, left_line, right_line, left_lane_depart, right_lane_depart, lat_available, stock_lkas_hud, lat_active, steeringPressed):
def create_ui_command(packer, steer, chime, left_line, right_line, left_lane_depart, right_lane_depart, enabled, stock_lkas_hud, lat_active, steeringPressed):
values = {
"TWO_BEEPS": chime,
"LDA_ALERT": steer,
# Lines: 3 "orange", 2 "faded", 1 "solid", 0 "none";
"RIGHT_LINE": 3 if right_lane_depart else 1 if right_line else 2,
"LEFT_LINE": 3 if left_lane_depart else 1 if left_line else 2,
"BARRIERS": 1 if lat_active and not steeringPressed else 0,
"LKAS_STATUS": 2 if lat_active and not steeringPressed else 1 if lat_available else 0,
"LKAS_STATUS": 2 if lat_active else 0,

# static signals
"SET_ME_X02": 2,
Expand Down

0 comments on commit cda06b8

Please sign in to comment.