mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-24 07:42:05 +08:00
Merge branch 'hkg-can-jerk' into master-dev-c3
# Conflicts: # selfdrive/controls/lib/longcontrol.py # selfdrive/ui/sunnypilot/qt/offroad/settings/vehicle_settings.cc
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user