|
|
|
@ -88,13 +88,14 @@ class Controls: |
|
|
|
|
model_v2 = self.sm['modelV2'] |
|
|
|
|
|
|
|
|
|
CC = car.CarControl.new_message() |
|
|
|
|
CC.enabled = self.sm['selfdriveState'].enabled |
|
|
|
|
|
|
|
|
|
# Check which actuators can be enabled |
|
|
|
|
standstill = abs(CS.vEgo) <= max(self.CP.minSteerSpeed, 0.3) or CS.standstill |
|
|
|
|
CC.latActive = self.sm['selfdriveState'].active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and \ |
|
|
|
|
(not standstill or self.CP.steerAtStandstill) |
|
|
|
|
CC.longActive = CC.enabled and not any(e.overrideLongitudinal for e in self.sm['onroadEvents']) and self.CP.openpilotLongitudinalControl |
|
|
|
|
if self.sm.all_checks(['selfdriveState']): |
|
|
|
|
CC.enabled = self.sm['selfdriveState'].enabled |
|
|
|
|
|
|
|
|
|
# Check which actuators can be enabled |
|
|
|
|
standstill = abs(CS.vEgo) <= max(self.CP.minSteerSpeed, 0.3) or CS.standstill |
|
|
|
|
CC.latActive = self.sm['selfdriveState'].active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and \ |
|
|
|
|
(not standstill or self.CP.steerAtStandstill) |
|
|
|
|
CC.longActive = CC.enabled and not any(e.overrideLongitudinal for e in self.sm['onroadEvents']) and self.CP.openpilotLongitudinalControl |
|
|
|
|
|
|
|
|
|
actuators = CC.actuators |
|
|
|
|
actuators.longControlState = self.LoC.long_control_state |
|
|
|
|