mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-10-01 06:03:43 +08:00
use it directly
This commit is contained in:
@@ -88,7 +88,7 @@ class SpeedLimitAssist:
|
||||
return bool(self.v_cruise_cluster != self.v_cruise_cluster_prev)
|
||||
|
||||
def get_v_target_from_control(self) -> float:
|
||||
if self.is_enabled and (self._speed_limit_final_last > 0):
|
||||
if self.is_enabled and self._has_speed_limit:
|
||||
return self._speed_limit_final_last
|
||||
|
||||
# Fallback
|
||||
|
||||
@@ -169,7 +169,7 @@ class TestSpeedLimitAssist:
|
||||
self.initialize_active_state(PCM_LONG_REQUIRED_MAX_SET_SPEED[self.sla.is_metric])
|
||||
old_speed_limit = SPEED_LIMITS['city']
|
||||
|
||||
self.sla.update(True, False, SPEED_LIMITS['city'], 0, PCM_LONG_REQUIRED_MAX_SET_SPEED[self.sla.is_metric], 0, old_speed_limit, False, 0, self.events_sp)
|
||||
self.sla.update(True, False, SPEED_LIMITS['city'], 0, PCM_LONG_REQUIRED_MAX_SET_SPEED[self.sla.is_metric], 0, old_speed_limit, True, 0, self.events_sp)
|
||||
assert self.sla.state in ACTIVE_STATES
|
||||
assert self.sla.output_v_target == old_speed_limit
|
||||
|
||||
|
||||
Reference in New Issue
Block a user