From b0090d08a79d0840e8acde16aaa20cc837d5adec Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Thu, 19 Nov 2026 12:05:51 -0600 Subject: [PATCH] Keep AOL source within the lint size limit --- openpilot/starpilot/aol/transport_pause.py | 153 +++++++-------------- prebuilt.json | 2 +- 2 files changed, 52 insertions(+), 103 deletions(-) diff --git a/openpilot/starpilot/aol/transport_pause.py b/openpilot/starpilot/aol/transport_pause.py index 2e5f1af32f..290eada0c2 100644 --- a/openpilot/starpilot/aol/transport_pause.py +++ b/openpilot/starpilot/aol/transport_pause.py @@ -24,8 +24,7 @@ def _configured_transport_native(sm, cp, session, now_ns, native=None, *, requir return None if coherent and (not validated_here and not native_inventory_matches_cp(native, cp) or any(p.safetyRxChecksInvalid or p.heartbeatLost or blocking_fault_mask(p.faults, cp) or - (require_longitudinal and native.requestedLongitudinal and str(config.safetyModel) not in ('silent', 'noOutput') and - not p.controlsAllowed) + (require_longitudinal and native.requestedLongitudinal and str(config.safetyModel) not in ('silent', 'noOutput') and not p.controlsAllowed) for p, config in zip(native.pandaInventory, cp.safetyConfigs, strict=True))): return None # v2: producer-read 200ms lease; separate BOOTTIME veto. @@ -303,8 +302,7 @@ class TransportPauseFeedback: (gm_pedal or classic_brake) and event.name == log.OnroadEvent.EventName.pedalPressed or volkswagen_withdrawal and event.name in (log.OnroadEvent.EventName.buttonCancel, log.OnroadEvent.EventName.pcmDisable) or ford_withdrawal and event.name in (log.OnroadEvent.EventName.pedalPressed, log.OnroadEvent.EventName.pcmDisable, - log.OnroadEvent.EventName.buttonCancel)) - for event in sm['onroadEvents'])): + log.OnroadEvent.EventName.buttonCancel)) for event in sm['onroadEvents'])): return None native = independent_lateral_health(sm, cp, cs, self.session, now_ns) # Brake health may precede axis status. @@ -331,8 +329,7 @@ class TransportPauseFeedback: native.observedMonoTime < self.lateral_native_ns or (native.pandaSerial, tuple(slot.hardwareSerial for slot in native.pandaInventory)) != self.lateral_inventory): return None - owners = [index for index, config in enumerate(cp.safetyConfigs) - if str(config.safetyModel) not in ('silent', 'noOutput')] + owners = [index for index, config in enumerate(cp.safetyConfigs) if str(config.safetyModel) not in ('silent', 'noOutput')] if not (len(owners) == 1 and (early_long or not native.pandaInventory[owners[0]].controlsAllowed and not sm['pandaStates'][owners[0]].controlsAllowed)): return None @@ -397,8 +394,7 @@ class TransportPauseFeedback: return False # Pre-event SOFT: intent only, original 30ms join; no reanchoring. axis_first = bool(str(axis.faultReason) == 'availabilityPause' and - not (axis.lateralActive or axis.longitudinalActive or axis.desiredLateral or - axis.desiredLongitudinal or axis.nativeAcknowledged) and + not (axis.lateralActive or axis.longitudinalActive or axis.desiredLateral or axis.desiredLongitudinal or axis.nativeAcknowledged) and prior is not None and prior[5] == 'none' and prior[11] and prior[13] and (prior[9] or self.ordinary_warning_retained and not prior[10] and not prior[12]) and prior[14:16] == (producer, self.availability_epoch) and @@ -592,8 +588,7 @@ class TransportPauseFeedback: if not recovering and not isolated and (reason != 'critical' or faults): return False previous = self.signature - joining = bool(self.pending_event and previous is not None and previous[5] == 'critical' and - previous[6] == self.pending_event) + joining = bool(self.pending_event and previous is not None and previous[5] == 'critical' and previous[6] == self.pending_event) if (not latched or self.failed or self.paused or self.pending_event and not joining or self.retention_started_ns or not self.session or str(axis.sessionId) != self.session or reason not in ('none', 'critical') or not producer or producer != self.availability_producer or @@ -607,8 +602,7 @@ class TransportPauseFeedback: event_ns = int(sm.logMonoTime['onroadEvents']) if (not sm.seen['onroadEvents'] or not sm.valid['onroadEvents'] or not sm.alive['onroadEvents'] or not 0 < event_ns <= now_ns or now_ns - event_ns > 1_500_000_000 or - joining and - (axis.faultEventMonoTime != self.pending_event or now_ns - self.pending_event > AXIS_MAX_AGE_NS)): + joining and (axis.faultEventMonoTime != self.pending_event or now_ns - self.pending_event > AXIS_MAX_AGE_NS)): return False withdrawn = bool(reason == 'critical' and not axis.desiredLateral and not axis.desiredLongitudinal and not axis.lateralActive and not axis.longitudinalActive) @@ -644,8 +638,7 @@ class TransportPauseFeedback: not cs.doorOpen and not cs.seatbeltUnlatched and not cs.steeringDisengage and not physical_cancel(cs, cp) and not axis.desiredLongitudinal and not axis.longitudinalActive and not native.requestedLongitudinal and not native.longitudinalAllowed and - all(event.name == log.OnroadEvent.EventName.pedalPressed and event.noEntry and - not event.softDisable and not event.immediateDisable for event in users)) + all(event.name == log.OnroadEvent.EventName.pedalPressed and event.noEntry and not event.softDisable and not event.immediateDisable for event in users)) stock_user = stock_lateral_user_event(cp) gm_stock_withdrawal = bool(cp.brand == 'gm' and cp.pcmCruise and self.lateral_only_baseline and (withdrawn or recovering) and cs.cruiseState.available and not cs.cruiseState.enabled and @@ -706,8 +699,7 @@ class TransportPauseFeedback: not sm.seen['onroadEvents'] or not sm.valid['onroadEvents'] or not sm.alive['onroadEvents'] or now_ns-event_ns > 1_500_000_000 or not any(str(e.name)in temporary_names for e in events) or - any(e.immediateDisable or e.softDisable and str(e.name)!='steerTempUnavailable' or - e.userDisable and str(e.name)!='pcmDisable' or + any(e.immediateDisable or e.softDisable and str(e.name)!='steerTempUnavailable' or e.userDisable and str(e.name)!='pcmDisable' or str(e.name)not in (*temporary_names,'pcmDisable','gasPressedOverride','steerOverride') for e in events)): return False native = _configured_transport_native(sm,cp,self.session,now_ns,allow_restricted_lateral=True) @@ -732,8 +724,7 @@ class TransportPauseFeedback: not 0 < source_ns <= now_ns or now_ns - source_ns > SAFETY_MAX_AGE_NS or (not started and now_ns - source_ns > AXIS_MAX_AGE_NS) or cs.accFaulted or cs.seatbeltUnlatched or - cs.gearShifter not in (car.CarState.GearShifter.drive, car.CarState.GearShifter.sport, - car.CarState.GearShifter.low, car.CarState.GearShifter.brake) or + cs.gearShifter not in (car.CarState.GearShifter.drive, car.CarState.GearShifter.sport, car.CarState.GearShifter.low, car.CarState.GearShifter.brake) or str(axis.faultReason) != 'none' or not axis.desiredLateral or not axis.lateralActive or (not axis.nativeAcknowledged and (axis.desiredLongitudinal or axis.longitudinalActive)) or not 0 < axis.sourceCarStateMonoTime <= axis.observedMonoTime or @@ -821,8 +812,7 @@ class TransportPauseFeedback: for p, c in zip(pandas, cp.safetyConfigs, strict=True)) raw_withdrawal = bool((self.longitudinal_cancel_ns or fresh_cancel) and 0 < native.sourcePandaStatesMonoTime < stamp and - all(not p.controlsAllowed for p, c in zip(pandas, cp.safetyConfigs, strict=True) - if str(c.safetyModel) not in ('silent', 'noOutput'))) + all(not p.controlsAllowed for p, c in zip(pandas, cp.safetyConfigs, strict=True) if str(c.safetyModel) not in ('silent', 'noOutput'))) if withdrawal_required and native.longitudinalAllowed and not raw_withdrawal: return None return native if current_pandas else None @@ -894,8 +884,7 @@ class TransportPauseFeedback: event.userDisable and not event.softDisable and not event.immediateDisable)] if cp.brand == 'gm': from openpilot.starpilot.car.gm.aol import gm_lateral_pedal_source_zero - if gm_lateral_pedal_source_zero(self, cp, cs, axis, native, now_ns, - producer=intent_producer_session): + if gm_lateral_pedal_source_zero(self, cp, cs, axis, native, now_ns, producer=intent_producer_session): events = [event for event in events if not (event.name == log.OnroadEvent.EventName.pedalPressed and event.userDisable and not event.softDisable and not event.immediateDisable)] event_ns = int(sm.logMonoTime['onroadEvents']) @@ -907,8 +896,7 @@ class TransportPauseFeedback: issue = live_event and (availability_only(events) or host_source_off and host_source_availability_only(events)) if reason not in ('none', 'availabilityPause') or faults and not issue: return False - typed = bool(reason == 'availabilityPause' and not axis.lateralActive and not axis.longitudinalActive and - 0 < axis.faultEventMonoTime <= stamp) + typed = bool(reason == 'availabilityPause' and not axis.lateralActive and not axis.longitudinalActive and 0 < axis.faultEventMonoTime <= stamp) source_expired = bool(typed and axis.sourceCarStateMonoTime == 0) continuing_intent = bool(source_expired and self.retention_verified and issue) if source_expired and not (0 < self.lateral_source_ns <= now_ns and @@ -971,8 +959,7 @@ class TransportPauseFeedback: not faults[0].softDisable or faults[0].userDisable or faults[0].immediateDisable or any(event.noEntry and event.name != log.OnroadEvent.EventName.selfdrivedLagging for event in events)): return False - elif (axis.desiredLongitudinal or axis.longitudinalActive or - not self.retention_event_ns < event_ns or faults): + elif (axis.desiredLongitudinal or axis.longitudinalActive or not self.retention_event_ns < event_ns or faults): return False native = _healthy_transport_native(sm, cp, cs, self.session, now_ns) return bool(native is not None and native.requestedLateral and native.lateralAllowed and @@ -1033,8 +1020,7 @@ class TransportPauseFeedback: int(axis.observedMonoTime) != stamp or not 0 < axis.sourceCarStateMonoTime <= stamp <= now_ns or not 0 <= axis.validUntilMonoTime - stamp <= AXIS_MAX_AGE_NS or now_ns - axis.sourceCarStateMonoTime > SAFETY_MAX_AGE_NS or - not (stamp - axis.sourceCarStateMonoTime > AXIS_MAX_AGE_NS or now_ns > axis.validUntilMonoTime or - held and output_missing or gas_source) or + not (stamp - axis.sourceCarStateMonoTime > AXIS_MAX_AGE_NS or now_ns > axis.validUntilMonoTime or held and output_missing or gas_source) or not producer or getattr(axis, 'intentProducerSessionId', '') != producer or producer != self.availability_producer or int(getattr(axis, 'intentIntegrityEpoch', 0)) != self.availability_epoch): @@ -1089,8 +1075,7 @@ class TransportPauseFeedback: if not stock_lateral_off(cp, cs, native): return False if self.retention_started_ns: - if (self.retention_event_ns != event_ns or - not 0 <= now_ns - self.retention_started_ns <= AXIS_MAX_AGE_NS): + if (self.retention_event_ns != event_ns or not 0 <= now_ns - self.retention_started_ns <= AXIS_MAX_AGE_NS): return False else: self.retention_started_ns = now_ns @@ -1117,8 +1102,7 @@ class TransportPauseFeedback: return False event_ns = int(sm.logMonoTime['onroadEvents']) faults = [event for event in sm['onroadEvents'] if event.immediateDisable or event.softDisable] - isolated = bool(len(faults) == 1 and faults[0].name == log.OnroadEvent.EventName.controlsMismatch and - faults[0].immediateDisable) + isolated = bool(len(faults) == 1 and faults[0].name == log.OnroadEvent.EventName.controlsMismatch and faults[0].immediateDisable) if (not isolated or not sm.seen['onroadEvents'] or not sm.valid['onroadEvents'] or not sm.alive['onroadEvents'] or not 0 < axis.faultEventMonoTime < event_ns <= now_ns or now_ns - event_ns > AXIS_MAX_AGE_NS): return False @@ -1161,16 +1145,14 @@ class TransportPauseFeedback: if (not sm.seen['onroadEvents'] or not sm.valid['onroadEvents'] or not sm.alive['onroadEvents'] or not 0 < event_ns <= now_ns or now_ns - event_ns > 1_500_000_000 or any(event.immediateDisable or event.softDisable or event.userDisable and - event.name not in (log.OnroadEvent.EventName.pcmDisable, log.OnroadEvent.EventName.pedalPressed) - for event in sm['onroadEvents'])): + event.name not in (log.OnroadEvent.EventName.pcmDisable, log.OnroadEvent.EventName.pedalPressed) for event in sm['onroadEvents'])): return False native = _configured_transport_native(sm, cp, self.session, now_ns, require_longitudinal=not pending_stop, allow_restricted_lateral=True) if native is None and combined_stop: newer = _configured_transport_native(sm, cp, self.session, now_ns, require_longitudinal=False, allow_restricted_lateral=True) - if (newer is not None and newer.pandaInventory and - 0 < int(sm.logMonoTime['pandaStates']) < newer.sourcePandaStatesMonoTime and + if (newer is not None and newer.pandaInventory and 0 < int(sm.logMonoTime['pandaStates']) < newer.sourcePandaStatesMonoTime and all(slot.controlsAllowed for slot, config in zip(newer.pandaInventory, cp.safetyConfigs, strict=True) if str(config.safetyModel) not in ('silent', 'noOutput'))): native = newer @@ -1216,11 +1198,9 @@ class TransportPauseFeedback: log.OnroadEvent.EventName.pcmDisable) if (not sm.seen['onroadEvents'] or not sm.valid['onroadEvents'] or not sm.alive['onroadEvents'] or not 0 < event_ns == axis.faultEventMonoTime <= stamp or now_ns - event_ns > 1_500_000_000 or - any(event.name not in allowed or event.immediateDisable or - event.softDisable and event.name != log.OnroadEvent.EventName.wrongGear or + any(event.name not in allowed or event.immediateDisable or event.softDisable and event.name != log.OnroadEvent.EventName.wrongGear or event.userDisable and event.name not in (log.OnroadEvent.EventName.reverseGear, - log.OnroadEvent.EventName.pedalPressed, log.OnroadEvent.EventName.pcmDisable) - for event in sm['onroadEvents'])): + log.OnroadEvent.EventName.pedalPressed, log.OnroadEvent.EventName.pcmDisable) for event in sm['onroadEvents'])): return False native = _healthy_transport_native(sm, cp, cs, self.session, now_ns) return bool(native is not None and native.pandaInventory and @@ -1318,8 +1298,7 @@ class TransportPauseFeedback: (axis.sequence > self.sequence or axis.sequence == self.sequence and signature == self.signature)) if not current and continuity and cp.brand == 'subaru': from openpilot.starpilot.car.subaru.aol import retain_stopped_intent - if retain_stopped_intent(self, sm, cp, cs, axis, now_ns, latched=latched, - producer=intent_producer_session, signature=signature): + if retain_stopped_intent(self, sm, cp, cs, axis, now_ns, latched=latched, producer=intent_producer_session, signature=signature): return False if not current and continuity and self._inactive_gear_source_gap(sm, cp, cs, axis, stamp, now_ns, latched=latched, producer=intent_producer_session): @@ -1340,16 +1319,14 @@ class TransportPauseFeedback: return True if (cp.brand == 'gm' and current and continuity and latched and not self.failed and not self.ever_lateral_active and not self.pending_event and reason == 'none' and - axis.nativeAcknowledged and not any(signature[9:13]) and - intent_producer_session and signature[14] == intent_producer_session and + axis.nativeAcknowledged and not any(signature[9:13]) and intent_producer_session and signature[14] == intent_producer_session and (self.signature is None or signature[14:16] == self.signature[14:16]) and 0 < axis.sourceCarStateMonoTime <= stamp and now_ns - axis.sourceCarStateMonoTime <= AXIS_MAX_AGE_NS): from openpilot.starpilot.car.gm.aol import cold_park_readiness native = _healthy_transport_native(sm, cp, cs, str(axis.sessionId), now_ns) event_ns = int(sm.logMonoTime['onroadEvents']) if (axis.faultEventMonoTime == event_ns and sm.seen['onroadEvents'] and - sm.valid['onroadEvents'] and sm.alive['onroadEvents'] and - 0 < event_ns <= stamp and now_ns - event_ns <= 1_500_000_000 and + sm.valid['onroadEvents'] and sm.alive['onroadEvents'] and 0 < event_ns <= stamp and now_ns - event_ns <= 1_500_000_000 and cold_park_readiness(cp, cs, native, sm['onroadEvents'])): self.cold_park_waiting = True self.session = str(axis.sessionId) @@ -1367,34 +1344,28 @@ class TransportPauseFeedback: if (retain_command_pause_intent(self, sm, cp, cs, axis, now_ns, latched=latched, producer=intent_producer_session) or retain_gear_withdrawal_intent(self, sm, cp, cs, axis, now_ns, latched=latched, producer=intent_producer_session)): return False - if (cp.brand == 'chrysler' and current and continuity and latched and - not self.failed and not self.ever_lateral_active): + if (cp.brand == 'chrysler' and current and continuity and latched and not self.failed and not self.ever_lateral_active): from openpilot.starpilot.car.chrysler.aol import cold_calibration_intent_current native = _healthy_transport_native(sm, cp, cs, str(axis.sessionId), now_ns) - if cold_calibration_intent_current(self, sm, cp, cs, axis, native, now_ns, - pending=startup_calibration_pending, producer=intent_producer_session): + if cold_calibration_intent_current(self, sm, cp, cs, axis, native, now_ns, pending=startup_calibration_pending, producer=intent_producer_session): self.session = str(axis.sessionId) self.sequence, self.signature = int(axis.sequence), signature return False if cp.brand == 'hyundai' and current and continuity: from openpilot.starpilot.car.hyundai.aol import retain_stopped_eps_arm - if retain_stopped_eps_arm(self, sm, cp, cs, axis, now_ns, latched=latched, - arm_ns=main_arm_ns, producer=intent_producer_session): + if retain_stopped_eps_arm(self, sm, cp, cs, axis, now_ns, latched=latched, arm_ns=main_arm_ns, producer=intent_producer_session): self.session = str(axis.sessionId) self.sequence, self.signature = int(axis.sequence), signature return False if current and continuity and 0 < main_arm_ns <= now_ns <= main_arm_ns + AXIS_MAX_AGE_NS: from openpilot.starpilot.car.gm.aol import prior_main_off_intent_current - if prior_main_off_intent_current(self, sm, cp, cs, axis, now_ns, - latched=latched, main_arm_ns=main_arm_ns, producer=intent_producer_session): + if prior_main_off_intent_current(self, sm, cp, cs, axis, now_ns, latched=latched, main_arm_ns=main_arm_ns, producer=intent_producer_session): self.sequence, self.signature = int(axis.sequence), signature return False if cp.brand == 'gm' and current and continuity and latched: from openpilot.starpilot.car.gm.aol import cold_gm_main_intent_current - native = (_healthy_transport_native(sm, cp, cs, str(axis.sessionId), now_ns) - if cp.brand == 'gm' else None) - if cold_gm_main_intent_current(self, sm, cp, cs, axis, native, now_ns, - producer=intent_producer_session): + native = (_healthy_transport_native(sm, cp, cs, str(axis.sessionId), now_ns) if cp.brand == 'gm' else None) + if cold_gm_main_intent_current(self, sm, cp, cs, axis, native, now_ns, producer=intent_producer_session): self.session = str(axis.sessionId) self.sequence, self.signature = int(axis.sequence), signature if axis.sourceCarStateMonoTime > 0: @@ -1411,16 +1382,13 @@ class TransportPauseFeedback: native = _healthy_transport_native(sm, cp, cs, str(axis.sessionId), now_ns) event_ns = int(sm.logMonoTime['onroadEvents']) recovering = bool(reason == 'none' and axis.desiredLateral and not axis.desiredLongitudinal and - not axis.lateralActive and not axis.longitudinalActive and axis.nativeAcknowledged and - 0 < self.cold_main_wait_ns <= now_ns and + not axis.lateralActive and not axis.longitudinalActive and axis.nativeAcknowledged and 0 < self.cold_main_wait_ns <= now_ns and (self.cold_main_sparse_waiting or now_ns <= self.cold_main_wait_ns + SAFETY_MAX_AGE_NS) and 0 < axis.sourceCarStateMonoTime <= stamp and now_ns - axis.sourceCarStateMonoTime <= AXIS_MAX_AGE_NS) if ((reason == 'availabilityPause' and not any(signature[9:13]) or recovering) and intent_producer_session and signature[14] == intent_producer_session and - (self.signature is None or signature[14:16] == self.signature[14:16]) and - axis.faultEventMonoTime == event_ns and sm.seen['onroadEvents'] and - sm.valid['onroadEvents'] and sm.alive['onroadEvents'] and 0 < event_ns <= stamp and - now_ns - event_ns <= AXIS_MAX_AGE_NS and + (self.signature is None or signature[14:16] == self.signature[14:16]) and axis.faultEventMonoTime == event_ns and sm.seen['onroadEvents'] and + sm.valid['onroadEvents'] and sm.alive['onroadEvents'] and 0 < event_ns <= stamp and now_ns - event_ns <= AXIS_MAX_AGE_NS and (axis.sourceCarStateMonoTime != 0 or not (cp.pcmCruise and not cp.openpilotLongitudinalControl) or 0 < self.cold_main_source_ns <= stamp <= now_ns <= self.cold_main_source_ns + SAFETY_MAX_AGE_NS) and cold_main_readiness(cp, cs, native, sm['onroadEvents'], recovering=recovering)): @@ -1438,18 +1406,15 @@ class TransportPauseFeedback: axis.nativeAcknowledged and axis.desiredLateral and not axis.lateralActive): event_ns = int(sm.logMonoTime['onroadEvents']) recovery_ahead = bool(sm.seen['onroadEvents'] and sm.valid['onroadEvents'] and - sm.alive['onroadEvents'] and 0 < event_ns < axis.faultEventMonoTime <= stamp and - now_ns - event_ns <= AXIS_MAX_AGE_NS) + sm.alive['onroadEvents'] and 0 < event_ns < axis.faultEventMonoTime <= stamp and now_ns - event_ns <= AXIS_MAX_AGE_NS) if not recovery_ahead: self.failed = True return True if current and continuity and self._angle_stop_intent_current(sm, cp, cs, axis, stamp, now_ns, latched=latched, producer=intent_producer_session): previous = self.signature - if (cp.brand == 'hyundai' and not axis.lateralActive and previous is not None and - previous[9] and previous[11] and previous[13] and - 0 < previous[8] <= previous[2] <= now_ns <= previous[4] and - now_ns - previous[8] <= AXIS_MAX_AGE_NS): + if (cp.brand == 'hyundai' and not axis.lateralActive and previous is not None and previous[9] and previous[11] and previous[13] and + 0 < previous[8] <= previous[2] <= now_ns <= previous[4] and now_ns - previous[8] <= AXIS_MAX_AGE_NS): self.hkg_eps_join_until_ns = min(previous[4], self.lateral_source_ns + AXIS_MAX_AGE_NS) self.sequence, self.signature = int(axis.sequence), signature return False @@ -1477,8 +1442,7 @@ class TransportPauseFeedback: self.sequence, self.signature = int(axis.sequence), signature return False if (cp.brand == 'ford' and current and continuity and - self._ford_gas_release_eps_join_current(sm, cp, cs, axis, stamp, now_ns, - latched=latched, producer=intent_producer_session)): + self._ford_gas_release_eps_join_current(sm, cp, cs, axis, stamp, now_ns, latched=latched, producer=intent_producer_session)): return False if cp.brand == 'ford' and current and continuity: from openpilot.starpilot.car.ford.physical_pause import retain_physical_pause_intent @@ -1486,8 +1450,7 @@ class TransportPauseFeedback: return False if cp.brand == 'subaru' and current and continuity: from openpilot.starpilot.car.subaru.paused_intent import retain_paused_restriction - if retain_paused_restriction(self, sm, cp, cs, axis, stamp, now_ns, - latched=latched, producer=intent_producer_session): + if retain_paused_restriction(self, sm, cp, cs, axis, stamp, now_ns, latched=latched, producer=intent_producer_session): self.sequence, self.signature = int(axis.sequence), signature return False if current and continuity and self._temporary_steering_intent_current(sm, cp, cs, axis, stamp, now_ns, @@ -1496,14 +1459,12 @@ class TransportPauseFeedback: return False if cp.brand == 'honda' and current and continuity: from openpilot.starpilot.aol.temporary_steering import honda_eps_recovery_intent_current - if honda_eps_recovery_intent_current(self, sm, cp, cs, axis, stamp, now_ns, - latched=latched, producer=intent_producer_session): + if honda_eps_recovery_intent_current(self, sm, cp, cs, axis, stamp, now_ns, latched=latched, producer=intent_producer_session): self.sequence, self.signature = int(axis.sequence), signature return False if cp.brand == 'volkswagen' and current and continuity: from openpilot.starpilot.car.volkswagen.aol import retain_reverse_withdrawal - if retain_reverse_withdrawal(self, sm, cp, cs, axis, now_ns, - latched=latched, producer=intent_producer_session): + if retain_reverse_withdrawal(self, sm, cp, cs, axis, now_ns, latched=latched, producer=intent_producer_session): self.sequence, self.signature = int(axis.sequence), signature return False if cp.brand == 'honda' and current and continuity: @@ -1511,8 +1472,7 @@ class TransportPauseFeedback: from openpilot.starpilot.aol.reverse_intent import retain_reverse_intent if retain_reverse_intent(self, sm, cp, cs, axis, now_ns, latched=latched, producer=intent_producer_session, - qualified_cp=honda_stock_qualified(cp, marked_only=True), - extra_user_events=(log.OnroadEvent.EventName.cruiseDisabled,), + qualified_cp=honda_stock_qualified(cp, marked_only=True), extra_user_events=(log.OnroadEvent.EventName.cruiseDisabled,), informational_events=(log.OnroadEvent.EventName.userBookmarkNotPaired,), allow_withdrawal_join=True): return False if cp.brand == 'mazda' and current and continuity: @@ -1570,8 +1530,7 @@ class TransportPauseFeedback: brake_native = (self._honda_brake_lateral_current(sm, cp, cs, axis, now_ns, latched=latched, brake_source_ns=brake_source_ns) if (current or honda_driver_pending) and continuity else None) if brake_native is None and (current or honda_driver_pending) and continuity: - brake_native = self._honda_cancel_lateral_current(sm, cp, cs, axis, now_ns, - latched=latched, cancel_source_ns=cancel_source_ns) + brake_native = self._honda_cancel_lateral_current(sm, cp, cs, axis, now_ns, latched=latched, cancel_source_ns=cancel_source_ns) if brake_native is not None: self.healthy_feedback_ns = stamp self.healthy_native_ns = int(brake_native.observedMonoTime) @@ -1628,16 +1587,12 @@ class TransportPauseFeedback: 0 < int(sm.logMonoTime['onroadEvents']) <= now_ns and now_ns - int(sm.logMonoTime['onroadEvents']) <= 1_500_000_000 and all(not event.immediateDisable and - (not event.softDisable or intent_paused and event.name in - (log.OnroadEvent.EventName.wrongGear, log.OnroadEvent.EventName.steerTempUnavailable) or - cs.seatbeltUnlatched and event.name == log.OnroadEvent.EventName.seatbeltNotLatched and - event.noEntry and not event.userDisable) and + (not event.softDisable or intent_paused and event.name in (log.OnroadEvent.EventName.wrongGear, log.OnroadEvent.EventName.steerTempUnavailable) or + cs.seatbeltUnlatched and event.name == log.OnroadEvent.EventName.seatbeltNotLatched and event.noEntry and not event.userDisable) and (not event.userDisable or event.name in - (log.OnroadEvent.EventName.pcmDisable, log.OnroadEvent.EventName.buttonCancel, - log.OnroadEvent.EventName.reverseGear) or intent_paused and + (log.OnroadEvent.EventName.pcmDisable, log.OnroadEvent.EventName.buttonCancel, log.OnroadEvent.EventName.reverseGear) or intent_paused and (event.name == log.OnroadEvent.EventName.wrongGear or cp.brand == 'ford' and cs.brakePressed and - event.name == log.OnroadEvent.EventName.pedalPressed)) - for event in sm['onroadEvents']) and + event.name == log.OnroadEvent.EventName.pedalPressed)) for event in sm['onroadEvents']) and native is not None and native.pandaInventory and self.healthy_inventory == (native.pandaSerial, tuple(slot.hardwareSerial for slot in native.pandaInventory)) and not native.requestedLateral and not native.lateralAllowed and @@ -1677,11 +1632,9 @@ class TransportPauseFeedback: self.sequence, self.signature = int(axis.sequence), signature return False transport_healthy = native is not None - cancel_native = (self._longitudinal_cancel_current(sm, cp, cs, axis, now_ns, latched=latched, - cancel_source_ns=cancel_source_ns) + cancel_native = (self._longitudinal_cancel_current(sm, cp, cs, axis, now_ns, latched=latched, cancel_source_ns=cancel_source_ns) if current and continuity and baseline and not transport_healthy else None) - if self._event_first_retention(sm, cp, axis, stamp, now_ns, latched=latched, - signature=signature, native=native): + if self._event_first_retention(sm, cp, axis, stamp, now_ns, latched=latched, signature=signature, native=native): return False current = bool(current and (transport_healthy or cancel_native is not None)) if current and baseline and not latched: @@ -1720,8 +1673,7 @@ class TransportPauseFeedback: self.longitudinal_cancel_ns = 0 if not current or not continuity or reason not in ('none', 'transportPause'): self.longitudinal_cancel_ns = 0 - hard = (self.paused or bool(self.pending_event) or reason == 'critical' or - bool(self.session and (latched or not continuity))) + hard = (self.paused or bool(self.pending_event) or reason == 'critical' or bool(self.session and (latched or not continuity))) self.paused = False self.pending_event = 0 self.failed = hard @@ -1738,8 +1690,7 @@ class TransportPauseFeedback: return hard event_ns = int(sm.logMonoTime['onroadEvents']) faults = [e for e in sm['onroadEvents'] if e.immediateDisable or e.softDisable] - isolated = bool(len(faults) == 1 and faults[0].name == log.OnroadEvent.EventName.controlsMismatch and - faults[0].immediateDisable) + isolated = bool(len(faults) == 1 and faults[0].name == log.OnroadEvent.EventName.controlsMismatch and faults[0].immediateDisable) if known and isolated and sm.valid['onroadEvents'] and 0 < axis.faultEventMonoTime < event_ns <= now_ns: if not self.pending_event: self.pending_event = event_ns @@ -1802,11 +1753,9 @@ class TransportPauseFeedback: pending = bool(provenance and axis.faultEventMonoTime > sm.logMonoTime['onroadEvents']) if pending and not self.pending_event: self.pending_event = int(axis.faultEventMonoTime) - self.qualified = bool(provenance and - axis.faultEventMonoTime == sm.logMonoTime['onroadEvents'] and + self.qualified = bool(provenance and axis.faultEventMonoTime == sm.logMonoTime['onroadEvents'] and sm.valid['onroadEvents'] and axis.faultEventMonoTime <= now_ns) - if self.pending_event and (axis.faultEventMonoTime != self.pending_event or - now_ns - self.pending_event > AXIS_MAX_AGE_NS): + if self.pending_event and (axis.faultEventMonoTime != self.pending_event or now_ns - self.pending_event > AXIS_MAX_AGE_NS): self.pending_event = 0 self.paused = False self.failed = True diff --git a/prebuilt.json b/prebuilt.json index 4c9899fc9d..6c82d07b0e 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "b264f8185e323d04ea7e0a5e488e795d870935263272e2edd6b6dc8ad9561beb", "schema_version": 1} +{"protected_inventory_sha256": "8cfd5c30340c4ef00060d7420377c5b49a9ea810f348f064c3ff02f6747b821f", "schema_version": 1}