Skip to content

Commit

Permalink
fix tesla safety tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasloetkolben committed Oct 14, 2024
1 parent f48e035 commit 70ca530
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/safety/test_tesla.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
from panda.tests.safety.common import CANPackerPanda

MSG_DAS_steeringControl = 0x488
MSG_APS_eacMonitor = 0x27d
MSG_DAS_Control = 0x2b9

class TestTeslaSafetyBase(common.PandaCarSafetyTest):
RELAY_MALFUNCTION_ADDRS = {0: (MSG_DAS_steeringControl,)}
FWD_BLACKLISTED_ADDRS = {2: [MSG_DAS_steeringControl]}
TX_MSGS = [[MSG_DAS_steeringControl, 0], [MSG_DAS_Control, 0]]
RELAY_MALFUNCTION_ADDRS = {0: (MSG_DAS_steeringControl, MSG_APS_eacMonitor)}
FWD_BLACKLISTED_ADDRS = {2: [MSG_DAS_steeringControl, MSG_APS_eacMonitor]}
TX_MSGS = [[MSG_DAS_steeringControl, 0], [MSG_APS_eacMonitor, 0], [MSG_DAS_Control, 0]]

STANDSTILL_THRESHOLD = 1
GAS_PRESSED_THRESHOLD = 3
Expand Down Expand Up @@ -79,8 +80,8 @@ def _angle_meas_msg(self, angle: float):
return self.packer.make_can_msg_panda("EPAS3S_sysStatus", 0, values)

class TestTeslaLongitudinalSafetyBase(TestTeslaSafetyBase):
RELAY_MALFUNCTION_ADDRS = {0: (MSG_DAS_steeringControl, MSG_DAS_Control)}
FWD_BLACKLISTED_ADDRS = {2: [MSG_DAS_steeringControl, MSG_DAS_Control]}
RELAY_MALFUNCTION_ADDRS = {0: (MSG_DAS_steeringControl, MSG_APS_eacMonitor, MSG_DAS_Control)}
FWD_BLACKLISTED_ADDRS = {2: [MSG_DAS_steeringControl, MSG_APS_eacMonitor, MSG_DAS_Control]}

MAX_ACCEL = 2.0
MIN_ACCEL = -3.48
Expand Down

0 comments on commit 70ca530

Please sign in to comment.