mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-23 20:52:06 +08:00
back
This commit is contained in:
@@ -644,8 +644,12 @@ class Controls:
|
||||
self.LoC.reset()
|
||||
|
||||
if not self.joystick_mode:
|
||||
speeds = long_plan.speeds
|
||||
a_lead = self.sm['radarState'].leadOne.aLeadK
|
||||
resume = self.enabled_long and CS.standstill and a_lead > 0.1 and self.CP.carName == "hyundai"
|
||||
resume = self.enabled_long and CS.standstill and self.CP.carName == "hyundai"
|
||||
if len(speeds):
|
||||
resume = resume and speeds[-1] > 0.1
|
||||
resume = resume and a_lead > 0.1
|
||||
|
||||
# accel PID loop
|
||||
pid_accel_limits = self.CI.get_pid_accel_limits(self.CP, CS.vEgo, self.v_cruise_helper.v_cruise_kph * CV.KPH_TO_MS)
|
||||
|
||||
@@ -90,6 +90,7 @@ class VCruiseHelper:
|
||||
|
||||
def update_v_cruise(self, CS, enabled, is_metric, reverse_acc, long_plan_sp):
|
||||
self.v_cruise_kph_last = self.v_cruise_kph
|
||||
self.slc_state_prev = self.slc_state
|
||||
self.slc_state = long_plan_sp.speedLimitControlState
|
||||
|
||||
if not self.CP.pcmCruiseSpeed:
|
||||
@@ -220,8 +221,6 @@ class VCruiseHelper:
|
||||
if self.slc_state == SpeedLimitControlState.active and self.slc_state_prev == SpeedLimitControlState.preActive:
|
||||
self.v_cruise_kph = clip(round(self.slc_speed_limit_offsetted, 1), self.v_cruise_min, V_CRUISE_MAX)
|
||||
|
||||
self.slc_state_prev = self.slc_state
|
||||
|
||||
def _update_v_cruise_min(self, is_metric):
|
||||
if is_metric != self.is_metric_prev:
|
||||
if self.CP.carName == "honda":
|
||||
|
||||
Reference in New Issue
Block a user