This commit is contained in:
Jason Wen
2024-08-13 01:17:50 -04:00
parent f3834c56ca
commit b9d3816fbe
2 changed files with 6 additions and 3 deletions
+5 -1
View File
@@ -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)
+1 -2
View File
@@ -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":