parameterize longitudinal actuator delay (#22153)

* paremetrize longitudinal actuator delay

* update ref
old-commit-hash: b39f6efa3f
commatwo_master
Willem Melching 4 years ago committed by GitHub
parent 6f5c9d5ad1
commit 977cf8ca02
  1. 2
      cereal
  2. 1
      selfdrive/car/interfaces.py
  3. 5
      selfdrive/controls/lib/longcontrol.py
  4. 2
      selfdrive/test/process_replay/ref_commit

@ -1 +1 @@
Subproject commit 0c929f74ce2ca96ff95bd9c1b50b5840ccc4503d Subproject commit 89557c5a178c2105e15c2b705395b535c7dcf371

@ -87,6 +87,7 @@ class CarInterfaceBase():
ret.longitudinalTuning.kpV = [1.] ret.longitudinalTuning.kpV = [1.]
ret.longitudinalTuning.kiBP = [0.] ret.longitudinalTuning.kiBP = [0.]
ret.longitudinalTuning.kiV = [1.] ret.longitudinalTuning.kiV = [1.]
ret.longitudinalActuatorDelay = 0.15
return ret return ret
# returns a car.CarState, pass in car.CarControl # returns a car.CarState, pass in car.CarControl

@ -14,7 +14,6 @@ DECEL_THRESHOLD_TO_PID = 0.8
DECEL_STOPPING_TARGET = 2.0 # apply at least this amount of brake to maintain the vehicle stationary DECEL_STOPPING_TARGET = 2.0 # apply at least this amount of brake to maintain the vehicle stationary
RATE = 100.0 RATE = 100.0
DEFAULT_LONG_LAG = 0.15
# As per ISO 15622:2018 for all speeds # As per ISO 15622:2018 for all speeds
ACCEL_MIN_ISO = -3.5 # m/s^2 ACCEL_MIN_ISO = -3.5 # m/s^2
@ -78,9 +77,9 @@ class LongControl():
# Interp control trajectory # Interp control trajectory
# TODO estimate car specific lag, use .15s for now # TODO estimate car specific lag, use .15s for now
if len(long_plan.speeds) == CONTROL_N: if len(long_plan.speeds) == CONTROL_N:
v_target = interp(DEFAULT_LONG_LAG, T_IDXS[:CONTROL_N], long_plan.speeds) v_target = interp(CP.longitudinalActuatorDelay, T_IDXS[:CONTROL_N], long_plan.speeds)
v_target_future = long_plan.speeds[-1] v_target_future = long_plan.speeds[-1]
a_target = 2 * (v_target - long_plan.speeds[0])/DEFAULT_LONG_LAG - long_plan.accels[0] a_target = 2 * (v_target - long_plan.speeds[0])/CP.longitudinalActuatorDelay - long_plan.accels[0]
else: else:
v_target = 0.0 v_target = 0.0
v_target_future = 0.0 v_target_future = 0.0

@ -1 +1 @@
bc50c3f64b4677eee32bc49bdf69c3be265fd743 d55568ec276ae8789faa1f69585f3c9ab7087205
Loading…
Cancel
Save