From d3c2a0e6c1e898b08570dd0a9b1eef12934f6c9a Mon Sep 17 00:00:00 2001 From: Igor Date: Fri, 11 Dec 2020 10:30:35 -0500 Subject: [PATCH] Parametrize stoppingBrakeRate (#2745) * Parametrize stoppingBrakeRate * ref_commit updated --- selfdrive/car/interfaces.py | 1 + selfdrive/controls/lib/longcontrol.py | 3 +-- selfdrive/test/process_replay/ref_commit | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index a36ea4e7b7..b56a0cd6d0 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -72,6 +72,7 @@ class CarInterfaceBase(): ret.openpilotLongitudinalControl = False ret.startAccel = 0.0 ret.minSpeedCan = 0.3 + ret.stoppingBrakeRate = 0.2 # brake_travel/s while trying to stop ret.stoppingControl = False ret.longitudinalTuning.deadzoneBP = [0.] ret.longitudinalTuning.deadzoneV = [0.] diff --git a/selfdrive/controls/lib/longcontrol.py b/selfdrive/controls/lib/longcontrol.py index bafa13f1ea..520220fdc0 100644 --- a/selfdrive/controls/lib/longcontrol.py +++ b/selfdrive/controls/lib/longcontrol.py @@ -9,7 +9,6 @@ STOPPING_TARGET_SPEED_OFFSET = 0.01 STARTING_TARGET_SPEED = 0.5 BRAKE_THRESHOLD_TO_PID = 0.2 -STOPPING_BRAKE_RATE = 0.2 # brake_travel/s while trying to stop STARTING_BRAKE_RATE = 0.8 # brake_travel/s while releasing on restart BRAKE_STOPPING_TARGET = 0.5 # apply at least this amount of brake to maintain the vehicle stationary @@ -106,7 +105,7 @@ class LongControl(): elif self.long_control_state == LongCtrlState.stopping: # Keep applying brakes until the car is stopped if not CS.standstill or output_gb > -BRAKE_STOPPING_TARGET: - output_gb -= STOPPING_BRAKE_RATE / RATE + output_gb -= CP.stoppingBrakeRate / RATE output_gb = clip(output_gb, -brake_max, gas_max) self.reset(CS.vEgo) diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index e371e2abef..cbc6a02b20 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -f60a1c8e24558c1470f9a240a12037579d62c2c1 +643db5a2a2555f9b9be755362b04fc346a1222de