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

old-commit-hash: 6582d632ec
commatwo_master
rbiasini 5 years ago committed by GitHub
parent 39f29c0cbe
commit 27c9381aa5
  1. 2
      selfdrive/car/gm/carcontroller.py
  2. 2
      selfdrive/car/tests/test_car_interfaces.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)

@ -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

Loading…
Cancel
Save