mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 00:03:45 +08:00
Test interfaces also in enabled state and fix a bug (#1213)
old-commit-hash: 6582d632ec58336158147afdcba1172d7455f11e
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user