mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-10-01 03:43:51 +08:00
volt tune / 2018 bolt tune
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from cereal import car
|
||||
from openpilot.selfdrive.controls.lib.longcontrol import LongCtrlState, long_control_state_trans
|
||||
import openpilot.selfdrive.controls.lib.longcontrol as longcontrol
|
||||
from openpilot.selfdrive.controls.lib.longcontrol import LongControl
|
||||
|
||||
|
||||
|
||||
@@ -54,3 +56,22 @@ def test_starting():
|
||||
next_state = long_control_state_trans(CP, active, current_state, v_ego=1.0,
|
||||
should_stop=False, brake_pressed=False, cruise_standstill=False)
|
||||
assert next_state == LongCtrlState.pid
|
||||
|
||||
|
||||
def test_volt_testing_ground_handoff_freezes_integrator(monkeypatch):
|
||||
CP = car.CarParams.new_message()
|
||||
CP.brand = "gm"
|
||||
CP.enableGasInterceptorDEPRECATED = True
|
||||
CP.carFingerprint = "CHEVROLET_VOLT_ASCM"
|
||||
CP.longitudinalTuning.kpBP = [0.0]
|
||||
CP.longitudinalTuning.kpV = [0.1]
|
||||
CP.longitudinalTuning.kiBP = [0.0]
|
||||
CP.longitudinalTuning.kiV = [0.03]
|
||||
|
||||
monkeypatch.setattr(longcontrol.testing_ground, "use_2", True, raising=False)
|
||||
|
||||
lc = LongControl(CP)
|
||||
freeze = lc._get_pedal_long_freeze(a_target=0.7, error=0.7, v_ego=8.0, accel_limits=(-3.0, 2.0))
|
||||
|
||||
assert freeze
|
||||
assert lc.integrator_hold_frames > 0
|
||||
|
||||
Reference in New Issue
Block a user