mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 20:03:53 +08:00
Build panda/SConscript (#26646)
* panda/SConscript
* think this is right?
* bump panda
* fix test_models
* use a filter
* bump panda to mater
* more aesthetic ordering
* alphabetical :(
* alphabetical :(
old-commit-hash: 01dac5d06b
This commit is contained in:
@@ -300,7 +300,7 @@ if arch == "Darwin":
|
||||
else:
|
||||
qt_install_prefix = subprocess.check_output(['qmake', '-query', 'QT_INSTALL_PREFIX'], encoding='utf8').strip()
|
||||
qt_install_headers = subprocess.check_output(['qmake', '-query', 'QT_INSTALL_HEADERS'], encoding='utf8').strip()
|
||||
|
||||
|
||||
qt_env['QTDIR'] = qt_install_prefix
|
||||
qt_dirs = [
|
||||
f"{qt_install_headers}",
|
||||
@@ -409,10 +409,10 @@ if arch != "Darwin":
|
||||
|
||||
# build submodules
|
||||
SConscript([
|
||||
'cereal/SConscript',
|
||||
'body/board/SConscript',
|
||||
'panda/board/SConscript',
|
||||
'cereal/SConscript',
|
||||
'opendbc/can/SConscript',
|
||||
'panda/SConscript',
|
||||
])
|
||||
|
||||
SConscript(['third_party/SConscript'])
|
||||
@@ -442,9 +442,6 @@ if arch in ['x86_64', 'Darwin'] or GetOption('extras'):
|
||||
Export('opendbc')
|
||||
SConscript(['tools/cabana/SConscript'])
|
||||
|
||||
if GetOption('test'):
|
||||
SConscript('panda/tests/safety/SConscript')
|
||||
|
||||
external_sconscript = GetOption('external_sconscript')
|
||||
if external_sconscript:
|
||||
SConscript([external_sconscript])
|
||||
|
||||
2
panda
2
panda
Submodule panda updated: e8bd1df511...2ae7b9a4d5
@@ -9,7 +9,6 @@ from parameterized import parameterized_class
|
||||
|
||||
from cereal import log, car
|
||||
from common.realtime import DT_CTRL
|
||||
from selfdrive.boardd.boardd import can_capnp_to_can_list
|
||||
from selfdrive.car.fingerprints import all_known_cars
|
||||
from selfdrive.car.car_helpers import interfaces
|
||||
from selfdrive.car.gm.values import CAR as GM
|
||||
@@ -20,8 +19,7 @@ from selfdrive.test.openpilotci import get_url
|
||||
from tools.lib.logreader import LogReader
|
||||
from tools.lib.route import Route
|
||||
|
||||
from panda.tests.safety import libpandasafety_py
|
||||
from panda.tests.safety.common import package_can_msg
|
||||
from panda.tests.libpanda import libpanda_py
|
||||
|
||||
PandaType = log.PandaState.PandaType
|
||||
|
||||
@@ -118,7 +116,7 @@ class TestCarModelBase(unittest.TestCase):
|
||||
assert self.CI
|
||||
|
||||
# TODO: check safetyModel is in release panda build
|
||||
self.safety = libpandasafety_py.libpandasafety
|
||||
self.safety = libpanda_py.libpanda
|
||||
|
||||
cfg = self.CP.safetyConfigs[-1]
|
||||
set_status = self.safety.set_safety_hooks(cfg.safetyModel.raw, cfg.safetyParam)
|
||||
@@ -192,7 +190,7 @@ class TestCarModelBase(unittest.TestCase):
|
||||
if msg.src >= 64:
|
||||
continue
|
||||
|
||||
to_send = package_can_msg([msg.address, 0, msg.dat, msg.src % 4])
|
||||
to_send = libpanda_py.make_CANPacket(msg.address, msg.src % 4, msg.dat)
|
||||
if self.safety.safety_rx_hook(to_send) != 1:
|
||||
failed_addrs[hex(msg.address)] += 1
|
||||
|
||||
@@ -215,8 +213,8 @@ class TestCarModelBase(unittest.TestCase):
|
||||
# warm up pass, as initial states may be different
|
||||
for can in self.can_msgs[:300]:
|
||||
self.CI.update(CC, (can.as_builder().to_bytes(), ))
|
||||
for msg in can_capnp_to_can_list(can.can, src_filter=range(64)):
|
||||
to_send = package_can_msg(msg)
|
||||
for msg in filter(lambda m: m.src in range(64), can.can):
|
||||
to_send = libpanda_py.make_CANPacket(msg.address, msg.src, msg.dat)
|
||||
self.safety.safety_rx_hook(to_send)
|
||||
|
||||
controls_allowed_prev = False
|
||||
@@ -224,10 +222,8 @@ class TestCarModelBase(unittest.TestCase):
|
||||
checks = defaultdict(lambda: 0)
|
||||
for idx, can in enumerate(self.can_msgs):
|
||||
CS = self.CI.update(CC, (can.as_builder().to_bytes(), ))
|
||||
for msg in can_capnp_to_can_list(can.can, src_filter=range(64)):
|
||||
msg = list(msg)
|
||||
msg[3] %= 4
|
||||
to_send = package_can_msg(msg)
|
||||
for msg in filter(lambda m: m.src in range(64), can.can):
|
||||
to_send = libpanda_py.make_CANPacket(msg.address, msg.src % 4, msg.dat)
|
||||
ret = self.safety.safety_rx_hook(to_send)
|
||||
self.assertEqual(1, ret, f"safety rx failed ({ret=}): {to_send}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user