mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 08:33:42 +08:00
aol: drop the Leapmotor CAN2 interrupt-rate exemption
The fault comes from the harness leaving panda bus 1 unconnected, not from the B10's traffic, so it doesn't belong in the port.
This commit is contained in:
@@ -31,14 +31,6 @@ def _diagnostic_mask(cp):
|
||||
return (1 << 3) if (int(cp.flags) == int(recorded_flags) and
|
||||
len(cp.safetyConfigs) == 1 and int(cp.safetyConfigs[0].safetyParam) == 0xC02 and cp.alternativeExperience == 32 and
|
||||
qualified(cp, marked_only=True)) else 0
|
||||
if cp.brand == 'leapmotor':
|
||||
from opendbc.car.leapmotor.values import CAR
|
||||
# The B10's CAN-FD traffic always exceeds the panda's CAN2 interrupt-rate limit: recorded on every
|
||||
# pandaStates sample of upstream-based drives, with valid RX checks and normal engagement. Only that
|
||||
# diagnostic is exempt; every other or mixed fault still blocks.
|
||||
return (1 << 3) if (cp.carFingerprint == CAR.LEAPMOTOR_B10 and len(cp.safetyConfigs) == 1 and
|
||||
cp.safetyConfigs[0].safetyModel == 'leapmotor' and
|
||||
not cp.passive and not cp.dashcamOnly and not cp.notCar) else 0
|
||||
from opendbc.car.gm.aol import qualified_gm
|
||||
from opendbc.car.gm.values import CAR, is_volt_sdgm_profile, is_bolt_present_no_acc_pedal_profile
|
||||
if cp.brand != 'gm' or len(cp.safetyConfigs) != 1:
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
"""The Leapmotor B10's CAN2 interrupt-rate diagnostic is exempt; every other fault still blocks."""
|
||||
import pytest
|
||||
|
||||
from opendbc.car import gen_empty_fingerprint, structs
|
||||
from opendbc.car.leapmotor.interface import CarInterface
|
||||
from opendbc.car.leapmotor.values import CAR
|
||||
from openpilot.cereal import log
|
||||
from openpilot.starpilot.aol.panda_faults import blocking_fault_mask, blocking_fault_list
|
||||
|
||||
|
||||
def leapmotor(alpha=True):
|
||||
return CarInterface.get_params(CAR.LEAPMOTOR_B10, gen_empty_fingerprint(), [], alpha, False, False)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('alpha', (False, True))
|
||||
def test_can2_interrupt_rate_is_diagnostic(alpha):
|
||||
cp = leapmotor(alpha)
|
||||
assert not blocking_fault_mask(1 << 3, cp)
|
||||
assert not blocking_fault_list([log.PandaState.FaultType.interruptRateCan2], cp)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('fault,value', tuple(log.PandaState.FaultType.schema.enumerants.items()))
|
||||
def test_all_other_and_mixed_faults_still_block(fault, value):
|
||||
cp = leapmotor()
|
||||
blocks = fault != 'interruptRateCan2'
|
||||
assert blocking_fault_mask(1 << value, cp) == blocks
|
||||
assert blocking_fault_mask((1 << value) | (1 << 3), cp) == blocks
|
||||
assert blocking_fault_list([value], cp) == blocks
|
||||
assert blocking_fault_list([log.PandaState.FaultType.interruptRateCan2, value], cp) == blocks
|
||||
|
||||
|
||||
@pytest.mark.parametrize('mutation', ('passive', 'dashcam', 'notcar', 'extra_panda', 'wrong_model'))
|
||||
def test_other_configurations_cannot_borrow_exception(mutation):
|
||||
cp = leapmotor()
|
||||
if mutation == 'passive':
|
||||
cp.passive = True
|
||||
elif mutation == 'dashcam':
|
||||
cp.dashcamOnly = True
|
||||
elif mutation == 'notcar':
|
||||
cp.notCar = True
|
||||
elif mutation == 'extra_panda':
|
||||
cp.safetyConfigs = [cp.safetyConfigs[0], structs.CarParams.SafetyConfig(safetyModel=structs.CarParams.SafetyModel.noOutput)]
|
||||
elif mutation == 'wrong_model':
|
||||
cp.safetyConfigs[0].safetyModel = structs.CarParams.SafetyModel.noOutput
|
||||
assert blocking_fault_mask(1 << 3, cp)
|
||||
assert blocking_fault_list([log.PandaState.FaultType.interruptRateCan2], cp)
|
||||
Reference in New Issue
Block a user