From 6582d632ec58336158147afdcba1172d7455f11e Mon Sep 17 00:00:00 2001 From: rbiasini Date: Fri, 6 Mar 2020 23:48:47 -0800 Subject: [PATCH] Test interfaces also in enabled state and fix a bug (#1213) --- selfdrive/car/gm/carcontroller.py | 2 +- selfdrive/car/tests/test_car_interfaces.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/gm/carcontroller.py b/selfdrive/car/gm/carcontroller.py index f09e58d68d..4fe0e5a154 100644 --- a/selfdrive/car/gm/carcontroller.py +++ b/selfdrive/car/gm/carcontroller.py @@ -96,7 +96,7 @@ class CarController(): ### STEER ### if (frame % P.STEER_STEP) == 0: - lkas_enabled = enabled and not CS.steer_not_allowed and CS.out.vEgo > P.MIN_STEER_SPEED + lkas_enabled = enabled and not CS.steer_warning and CS.out.vEgo > P.MIN_STEER_SPEED if lkas_enabled: new_steer = actuators.steer * P.STEER_MAX apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, P) diff --git a/selfdrive/car/tests/test_car_interfaces.py b/selfdrive/car/tests/test_car_interfaces.py index 73423fed64..ecf7bab8bc 100755 --- a/selfdrive/car/tests/test_car_interfaces.py +++ b/selfdrive/car/tests/test_car_interfaces.py @@ -34,6 +34,8 @@ class TestCarInterfaces(unittest.TestCase): CC = car.CarControl.new_message() car_interface.update(CC, []) car_interface.apply(CC) + CC.enabled = True + car_interface.apply(CC) # Test radar interface RadarInterface = importlib.import_module('selfdrive.car.%s.radar_interface' % car_params.carName).RadarInterface