From 8bc42f4aff8fa5b0403150be0630561470064d18 Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 16 Dec 2020 14:58:07 -0500 Subject: [PATCH] Parametrize startingBrakeRate (#19511) * Parametrize startingBrakeRate * new ref_commit old-commit-hash: 717bc747c32114df13e8334eeb591f9ca289a034 --- 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 b56a0cd6d0..746dabb9eb 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -73,6 +73,7 @@ class CarInterfaceBase(): ret.startAccel = 0.0 ret.minSpeedCan = 0.3 ret.stoppingBrakeRate = 0.2 # brake_travel/s while trying to stop + ret.startingBrakeRate = 0.8 # brake_travel/s while releasing on restart 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 520220fdc0..2ead3474bb 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 -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 RATE = 100.0 @@ -113,7 +112,7 @@ class LongControl(): # Intention is to move again, release brake fast before handing control to PID elif self.long_control_state == LongCtrlState.starting: if output_gb < -0.2: - output_gb += STARTING_BRAKE_RATE / RATE + output_gb += CP.startingBrakeRate / RATE self.reset(CS.vEgo) self.last_output_gb = output_gb diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 967e442980..e92190f7bf 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -2c61a18410dca75500a87a733aa5c3cc50d21fcc \ No newline at end of file +e3c1a9c4b81033c8dad810870eb974954e7660e9 \ No newline at end of file