update logic

This commit is contained in:
Rick Lan
2020-11-11 10:04:28 +10:00
parent 1e53607614
commit 59b52126ee
+12 -8
View File
@@ -198,7 +198,7 @@ class CarInterface(CarInterfaceBase):
ret = self.CS.update(self.cp, self.cp_cam)
# dp
self.dragonconf = dragonconf
if ret.vEgo > self.CP.minSteerSpeed:
if ret.vEgo >= self.CP.minSteerSpeed:
ret.cruiseState.enabled = common_interface_atl(ret, dragonconf.dpAtl)
ret.canValid = self.cp.can_valid and self.cp_cam.can_valid
ret.lkMode = self.CS.lkMode
@@ -208,13 +208,17 @@ class CarInterface(CarInterfaceBase):
if not self.CS.lkMode:
events.add(car.CarEvent.EventName.manualSteeringRequired)
# low speed steer alert hysteresis logic (only for cars with steer cut off above 10 m/s)
if ret.vEgo < (self.CP.minSteerSpeed + 2.) and self.CP.minSteerSpeed > 10.:
self.low_speed_alert = True
if ret.vEgo > (self.CP.minSteerSpeed + 4.):
self.low_speed_alert = False
if self.low_speed_alert:
events.add(car.CarEvent.EventName.belowSteerSpeed)
if dragonconf.dpAtl:
if ret.vEgo < self.CP.minSteerSpeed:
events.add(car.CarEvent.EventName.belowSteerSpeed)
else:
# low speed steer alert hysteresis logic (only for cars with steer cut off above 10 m/s)
if ret.vEgo < (self.CP.minSteerSpeed + 2.) and self.CP.minSteerSpeed > 10.:
self.low_speed_alert = True
if ret.vEgo > (self.CP.minSteerSpeed + 4.):
self.low_speed_alert = False
if self.low_speed_alert:
events.add(car.CarEvent.EventName.belowSteerSpeed)
ret.events = events.to_msg()