diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index 8e8e0292f2..71a595996d 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -141,9 +141,9 @@ class CarController(CarControllerBase): lead = hud_control.leadVisible or CS.out.vEgo < 12. # at low speed we always assume the lead is present so ACC can be engaged # Press distance button until we are at the correct bar length. Only change while enabled to avoid skipping startup popup - if self.frame % 6 == 0: - if CS.pcm_follow_distance_values.get(CS.pcm_follow_distance, "UNKNOWN") != "FAR" and CS.out.cruiseState.enabled and \ - self.CP.carFingerprint not in UNSUPPORTED_DSU_CAR: + if self.frame % 6 == 0 and self.CP.openpilotLongitudinalControl: + desired_distance = 4 - hud_control.leadDistanceBars + if CS.out.cruiseState.enabled and CS.pcm_follow_distance != desired_distance: self.distance_button = not self.distance_button else: self.distance_button = 0 diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index 65fced80f4..5d99467f25 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -44,7 +44,6 @@ class CarState(CarStateBase): self.distance_button = 0 self.pcm_follow_distance = 0 - self.pcm_follow_distance_values = can_define.dv['PCM_CRUISE_2']['PCM_FOLLOW_DISTANCE'] self.low_speed_lockout = False self.acc_type = 1 diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index e4f2542ea5..29358cb7b6 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -680,6 +680,7 @@ class Controls: hudControl.speedVisible = self.enabled hudControl.lanesVisible = self.enabled hudControl.leadVisible = self.sm['longitudinalPlan'].hasLead + hudControl.leadDistanceBars = self.sm['longitudinalPlan'].personality.raw + 1 hudControl.rightLaneVisible = True hudControl.leftLaneVisible = True diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 97646ce064..fe7d954a80 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -d53d44c21a89d7925d5ad16938e14794907f28b1 \ No newline at end of file +653f68e6be4689dc9dce1a93cb726d37b9c588d3