diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 65030bfdbf..c4a702be77 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -105,8 +105,6 @@ class CarInterface(CarInterfaceBase): ret.longitudinalTuning.kiBP = [0.] ret.longitudinalTuning.kiV = [0.36] - ret.startAccel = 0.8 - ret.steerLimitTimer = 0.4 ret.radarTimeStep = 0.0667 # GM radar runs at 15Hz instead of standard 20Hz diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index d372278e65..6bcd17f498 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -291,8 +291,6 @@ class CarInterface(CarInterfaceBase): ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, tire_stiffness_factor=tire_stiffness_factor) - ret.startAccel = 0.5 - ret.steerActuatorDelay = 0.1 ret.steerRateCost = 0.5 ret.steerLimitTimer = 0.8 diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index a9c5a089b2..5b6b248124 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -22,8 +22,6 @@ class CarInterface(CarInterfaceBase): ret.steerLimitTimer = 0.4 tire_stiffness_factor = 1. - ret.startAccel = 1.0 - if candidate == CAR.SANTA_FE: ret.lateralTuning.pid.kf = 0.00005 ret.mass = 3982. * CV.LB_TO_KG + STD_CARGO_KG diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index ee9fbeb1d8..6bf105072b 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -72,10 +72,10 @@ class CarInterfaceBase(): ret.minEnableSpeed = -1. # enable is done by stock ACC, so ignore this ret.steerRatioRear = 0. # no rear steering, at least on the listed cars aboveA ret.openpilotLongitudinalControl = False - ret.startAccel = 0.0 ret.minSpeedCan = 0.3 ret.stoppingDecelRate = 0.8 # brake_travel/s while trying to stop ret.startingAccelRate = 3.2 # brake_travel/s while releasing on restart + ret.vEgoStopping = 0.5 ret.stoppingControl = True ret.longitudinalTuning.deadzoneBP = [0.] ret.longitudinalTuning.deadzoneV = [0.] diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index e0a07cf2d1..2c9553b23a 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -330,7 +330,6 @@ class CarInterface(CarInterfaceBase): ret.longitudinalTuning.kiV = [.35, .23, .20, .17, .1] ret.stoppingDecelRate = 0.3 # reach stopping target smoothly ret.startingAccelRate = 6.0 # release brakes fast - ret.startAccel = 1.2 # Accelerate from 0 faster else: # Default longitudinal tune ret.longitudinalTuning.deadzoneBP = [0., 9.] diff --git a/selfdrive/controls/lib/longcontrol.py b/selfdrive/controls/lib/longcontrol.py index 97ed694468..c2874ed2c3 100644 --- a/selfdrive/controls/lib/longcontrol.py +++ b/selfdrive/controls/lib/longcontrol.py @@ -6,7 +6,6 @@ from selfdrive.modeld.constants import T_IDXS LongCtrlState = car.CarControl.Actuators.LongControlState -STOPPING_EGO_SPEED = 0.5 STOPPING_TARGET_SPEED_OFFSET = 0.01 STARTING_TARGET_SPEED = 0.5 DECEL_THRESHOLD_TO_PID = 0.8 @@ -20,13 +19,12 @@ ACCEL_MIN_ISO = -3.5 # m/s^2 ACCEL_MAX_ISO = 2.0 # m/s^2 -# TODO this logic isn't really car independent, does not belong here -def long_control_state_trans(active, long_control_state, v_ego, v_target, v_pid, +def long_control_state_trans(CP, active, long_control_state, v_ego, v_target, v_pid, output_accel, brake_pressed, cruise_standstill, min_speed_can): """Update longitudinal control state machine""" stopping_target_speed = min_speed_can + STOPPING_TARGET_SPEED_OFFSET stopping_condition = (v_ego < 2.0 and cruise_standstill) or \ - (v_ego < STOPPING_EGO_SPEED and + (v_ego < CP.vEgoStopping and ((v_pid < stopping_target_speed and v_target < stopping_target_speed) or brake_pressed)) @@ -93,7 +91,7 @@ class LongControl(): # Update state machine output_accel = self.last_output_accel - self.long_control_state = long_control_state_trans(active, self.long_control_state, CS.vEgo, + self.long_control_state = long_control_state_trans(CP, active, self.long_control_state, CS.vEgo, v_target_future, self.v_pid, output_accel, CS.brakePressed, CS.cruiseState.standstill, CP.minSpeedCan) diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 6c41486c62..75d21ce0f7 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -f489c4e160cebde60907d3cd2bfbc06bd9d33aad \ No newline at end of file +65c39ad66072b5106399605761c48e6cad0ee3a5 \ No newline at end of file