diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index 1f89a5a6a1..bd4d23ab27 100644 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -308,7 +308,7 @@ class CarController(CarControllerBase): # TODO: unclear if this is needed jerk = 3.0 if actuators.longControlState == LongCtrlState.pid else 1.0 use_fca = self.CP.flags & HyundaiFlags.USE_FCA.value - self.make_accel(actuators) + self.make_accel(CS, actuators) can_sends.extend(hyundaican.create_acc_commands(self.packer, CC.enabled and CS.out.cruiseState.enabled, self.accel_raw, self.accel_val, self.jerk_l, self.jerk_u, int(self.frame / 2), hud_control, set_speed_in_units, stopping, CC.cruiseControl.override, use_fca, CS, escc, self.CP, self.lead_distance, self.cb_lower, self.cb_upper)) @@ -538,12 +538,12 @@ class CarController(CarControllerBase): self.cb_upper = clip(0.9 + accel * 0.2, 0, 1.2) self.cb_lower = clip(0.8 + accel * 0.2, 0, 1.2) - def make_accel(self, actuators): + def make_accel(self, CS, actuators): long_control = actuators.longControlState is_ice = not self.CP.flags & (HyundaiFlags.HYBRID | HyundaiFlags.EV) rate_up = 0.1 rate_down = 0.1 - if long_control == LongCtrlState.off: + if long_control == LongCtrlState.off or CS.out.standstill: self.accel_raw, self.accel_val = 0, 0 else: #self.accel_val = clip(self.accel_raw, self.accel_last - rate_down, self.accel_last + rate_up) diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index dfb0fbae61..0d47eaae8f 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -104,9 +104,8 @@ class CarInterface(CarInterfaceBase): ret.stoppingControl = True ret.startingState = True ret.vEgoStarting = 0.1 - ret.startAccel = 1.8 - ret.stopAccel = 0.0 - ret.stoppingDecelRate = 10 + ret.startAccel = 1.6 + ret.stopAccel = -1.0 ret.longitudinalActuatorDelay = 0.5 if DBC[ret.carFingerprint]["radar"] is None: diff --git a/selfdrive/controls/lib/longcontrol.py b/selfdrive/controls/lib/longcontrol.py index 1ee8a7b013..e3cd4bb654 100644 --- a/selfdrive/controls/lib/longcontrol.py +++ b/selfdrive/controls/lib/longcontrol.py @@ -75,9 +75,6 @@ class LongControl: if output_accel > self.CP.stopAccel: output_accel = min(output_accel, 0.0) output_accel -= self.CP.stoppingDecelRate * DT_CTRL - elif output_accel < self.CP.stopAccel == 0.0: - output_accel = min(output_accel, 0.0) - output_accel += self.CP.stoppingDecelRate * DT_CTRL self.reset() elif self.long_control_state == LongCtrlState.starting: