diff --git a/cereal b/cereal index e83ec3be7d..70aeecf093 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit e83ec3be7d83b8d4ce227e7c2027dd1ca5f930b4 +Subproject commit 70aeecf0930376a9da236b6f274941488e593063 diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index 9a424a1e68..a09f418af5 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -168,7 +168,6 @@ class CarController(): lkas_active, CS.CP.carFingerprint, idx, CS.CP.openpilotLongitudinalControl)) stopping = actuators.longControlState == LongCtrlState.stopping - starting = actuators.longControlState == LongCtrlState.starting # wind brake from air resistance decel at high speed wind_brake = interp(CS.out.vEgo, [0.0, 2.3, 35.0], [0.001, 0.002, 0.15]) @@ -218,7 +217,7 @@ class CarController(): if CS.CP.carFingerprint in HONDA_BOSCH: self.accel = clip(accel, P.BOSCH_ACCEL_MIN, P.BOSCH_ACCEL_MAX) self.gas = interp(accel, P.BOSCH_GAS_LOOKUP_BP, P.BOSCH_GAS_LOOKUP_V) - can_sends.extend(hondacan.create_acc_commands(self.packer, enabled, active, accel, self.gas, idx, stopping, starting, CS.CP.carFingerprint)) + can_sends.extend(hondacan.create_acc_commands(self.packer, enabled, active, accel, self.gas, idx, stopping, CS.CP.carFingerprint)) else: apply_brake = clip(self.brake_last - wind_brake, 0.0, 1.0) apply_brake = int(clip(apply_brake * P.NIDEC_BRAKE_MAX, 0, P.NIDEC_BRAKE_MAX - 1)) diff --git a/selfdrive/car/honda/hondacan.py b/selfdrive/car/honda/hondacan.py index 7fcafe67f8..db7104cd4f 100644 --- a/selfdrive/car/honda/hondacan.py +++ b/selfdrive/car/honda/hondacan.py @@ -43,7 +43,7 @@ def create_brake_command(packer, apply_brake, pump_on, pcm_override, pcm_cancel_ return packer.make_can_msg("BRAKE_COMMAND", bus, values, idx) -def create_acc_commands(packer, enabled, active, accel, gas, idx, stopping, starting, car_fingerprint): +def create_acc_commands(packer, enabled, active, accel, gas, idx, stopping, car_fingerprint): commands = [] bus = get_pt_bus(car_fingerprint) min_gas_accel = CarControllerParams.BOSCH_GAS_LOOKUP_BP[0] @@ -53,7 +53,7 @@ def create_acc_commands(packer, enabled, active, accel, gas, idx, stopping, star accel_command = accel if active else 0 braking = 1 if active and accel < min_gas_accel else 0 standstill = 1 if active and stopping else 0 - standstill_release = 1 if active and starting else 0 + standstill_release = 1 if active and not stopping else 0 acc_control_values = { # setting CONTROL_ON causes car to set POWERTRAIN_DATA->ACC_STATUS = 1 diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index 9f87081fdb..1a5f36baf1 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -41,7 +41,6 @@ class CarInterface(CarInterfaceBase): ret.longitudinalTuning.kpV = [0.1] ret.longitudinalTuning.kiV = [0.0] ret.stopAccel = 0.0 - ret.startAccel = 0.0 ret.longitudinalActuatorDelayUpperBound = 1.0 # s diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index 80626ebb2a..089dc2045d 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -84,9 +84,7 @@ class CarInterfaceBase(ABC): 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.8 ret.stopAccel = -2.0 - ret.startingAccelRate = 3.2 # brake_travel/s while releasing on restart ret.stoppingDecelRate = 0.8 # brake_travel/s while trying to stop ret.vEgoStopping = 0.5 ret.vEgoStarting = 0.5 # needs to be >= vEgoStopping to avoid state transition oscillation diff --git a/selfdrive/car/tesla/interface.py b/selfdrive/car/tesla/interface.py index 4b5b211787..0a5067d1ce 100755 --- a/selfdrive/car/tesla/interface.py +++ b/selfdrive/car/tesla/interface.py @@ -25,7 +25,6 @@ class CarInterface(CarInterfaceBase): ret.longitudinalTuning.kiBP = [0] ret.longitudinalTuning.kiV = [0] ret.stopAccel = 0.0 - ret.startAccel = 0.0 ret.longitudinalActuatorDelayUpperBound = 0.5 # s ret.radarTimeStep = (1.0 / 8) # 8Hz diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 82e7523c7b..3a98c19b0a 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -247,7 +247,6 @@ class CarInterface(CarInterfaceBase): elif candidate in TSS2_CAR: set_long_tune(ret.longitudinalTuning, LongTunes.TSS2) ret.stoppingDecelRate = 0.3 # reach stopping target smoothly - ret.startingAccelRate = 6.0 # release brakes fast else: set_long_tune(ret.longitudinalTuning, LongTunes.TSS) diff --git a/selfdrive/controls/lib/longcontrol.py b/selfdrive/controls/lib/longcontrol.py index b16fbbeaab..646b40c26b 100644 --- a/selfdrive/controls/lib/longcontrol.py +++ b/selfdrive/controls/lib/longcontrol.py @@ -13,7 +13,7 @@ ACCEL_MAX_ISO = 2.0 # m/s^2 def long_control_state_trans(CP, active, long_control_state, v_ego, v_target_future, - output_accel, brake_pressed, cruise_standstill): + brake_pressed, cruise_standstill): """Update longitudinal control state machine""" stopping_condition = (v_ego < 2.0 and cruise_standstill) or \ (v_ego < CP.vEgoStopping and @@ -35,12 +35,6 @@ def long_control_state_trans(CP, active, long_control_state, v_ego, v_target_fut elif long_control_state == LongCtrlState.stopping: if starting_condition: - long_control_state = LongCtrlState.starting - - elif long_control_state == LongCtrlState.starting: - if stopping_condition: - long_control_state = LongCtrlState.stopping - elif output_accel >= CP.startAccel: long_control_state = LongCtrlState.pid return long_control_state @@ -88,8 +82,8 @@ class LongControl(): # Update state machine output_accel = self.last_output_accel self.long_control_state = long_control_state_trans(CP, active, self.long_control_state, CS.vEgo, - v_target_future, output_accel, - CS.brakePressed, CS.cruiseState.standstill) + v_target_future, CS.brakePressed, + CS.cruiseState.standstill) if self.long_control_state == LongCtrlState.off or CS.gasPressed: self.reset(CS.vEgo) @@ -118,12 +112,6 @@ class LongControl(): output_accel = clip(output_accel, accel_limits[0], accel_limits[1]) self.reset(CS.vEgo) - # Intention is to move again, release brake fast before handing control to PID - elif self.long_control_state == LongCtrlState.starting: - if output_accel < CP.startAccel: - output_accel += CP.startingAccelRate * DT_CTRL - self.reset(CS.vEgo) - self.last_output_accel = output_accel final_accel = clip(output_accel, accel_limits[0], accel_limits[1]) diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 72e2a54860..6ebdb327b3 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -e0ac3ca09baaf0d791d0e7734799bb297ad91f79 \ No newline at end of file +05ebb83207d2c949ee70702e4ec4568f872c6054 \ No newline at end of file