Test interfaces also in enabled state and fix a bug (#1213)

old-commit-hash: 6582d632ec58336158147afdcba1172d7455f11e
This commit is contained in:
rbiasini
2020-03-06 23:48:47 -08:00
committed by GitHub
parent 39f29c0cbe
commit 27c9381aa5
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -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)
@@ -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