From ffa10d784adf91d21bacdb5d3b51a523ceeb1c8f Mon Sep 17 00:00:00 2001 From: Vincent Wright Date: Tue, 6 Jun 2023 18:57:41 -0400 Subject: [PATCH 01/13] More missing FW for the Ram 1500s (#28397) Co-authored-by: Cameron Clough --- selfdrive/car/chrysler/values.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selfdrive/car/chrysler/values.py b/selfdrive/car/chrysler/values.py index bd7c3acc36..0b3f7131e6 100644 --- a/selfdrive/car/chrysler/values.py +++ b/selfdrive/car/chrysler/values.py @@ -227,6 +227,7 @@ FW_VERSIONS = { b'68510283AG', b'68527346AE', b'68527375AD', + b'68527382AE', ], (Ecu.srs, 0x744, None): [ b'68428609AB', @@ -254,6 +255,7 @@ FW_VERSIONS = { (Ecu.fwdRadar, 0x753, None): [ b'04672892AB', b'04672932AB', + b'22DTRHD_AA', b'68320950AH', b'68320950AI', b'68320950AJ', @@ -265,6 +267,7 @@ FW_VERSIONS = { b'68475160AG', ], (Ecu.eps, 0x75A, None): [ + b'21590101AA', b'68273275AF', b'68273275AG', b'68312176AE', @@ -283,6 +286,7 @@ FW_VERSIONS = { b'05036065AE ', b'05036066AE ', b'05149846AA ', + b'05149848AA ', b'68378701AI ', b'68378758AM ', b'68448163AJ', From 0d51a64bf2c7a97e91a8d33fe05d13bd48c99a37 Mon Sep 17 00:00:00 2001 From: Vincent Wright Date: Tue, 6 Jun 2023 18:58:46 -0400 Subject: [PATCH 02/13] Added additional Firmware for Ram 1500 (#28392) Co-authored-by: Cameron Clough --- selfdrive/car/chrysler/values.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/selfdrive/car/chrysler/values.py b/selfdrive/car/chrysler/values.py index 0b3f7131e6..b1390bee0b 100644 --- a/selfdrive/car/chrysler/values.py +++ b/selfdrive/car/chrysler/values.py @@ -270,6 +270,7 @@ FW_VERSIONS = { b'21590101AA', b'68273275AF', b'68273275AG', + b'68273275AH', b'68312176AE', b'68312176AG', b'68440789AC', @@ -288,6 +289,7 @@ FW_VERSIONS = { b'05149846AA ', b'05149848AA ', b'68378701AI ', + b'68378748AL ', b'68378758AM ', b'68448163AJ', b'68448165AK', From d97d908a2a991e2be40914007f16d4734777dddc Mon Sep 17 00:00:00 2001 From: Saber422 <81108166+Saber422@users.noreply.github.com> Date: Wed, 7 Jun 2023 07:15:25 +0800 Subject: [PATCH 03/13] VW MQB: Add FW for 2023 Skoda Koidaq RS (#28332) 0bbe367c98fa1538|2023-05-29--13-59-08--0 Co-authored-by: Cameron Clough --- selfdrive/car/volkswagen/values.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selfdrive/car/volkswagen/values.py b/selfdrive/car/volkswagen/values.py index 88fd31bc03..947fbf9872 100755 --- a/selfdrive/car/volkswagen/values.py +++ b/selfdrive/car/volkswagen/values.py @@ -1163,6 +1163,7 @@ FW_VERSIONS = { b'\xf1\x8705E906018DJ\xf1\x891903', b'\xf1\x875NA907115E \xf1\x890003', b'\xf1\x875NA907115E \xf1\x890005', + b'\xf1\x875NA906259E \xf1\x890003', ], (Ecu.transmission, 0x7e1, None): [ b'\xf1\x870D9300043 \xf1\x895202', @@ -1171,6 +1172,7 @@ FW_VERSIONS = { b'\xf1\x870DL300012N \xf1\x892110', b'\xf1\x870DL300013G \xf1\x892119', b'\xf1\x870GC300014N \xf1\x892801', + b'\xf1\x870GC300019H \xf1\x892806', b'\xf1\x870GC300046Q \xf1\x892802', ], (Ecu.srs, 0x715, None): [ @@ -1180,6 +1182,7 @@ FW_VERSIONS = { b'\xf1\x873Q0959655CN\xf1\x890720\xf1\x82\x0e1213001211001205212112052100', b'\xf1\x873Q0959655CQ\xf1\x890720\xf1\x82\x0e1213111211001205212112052111', b'\xf1\x873Q0959655DJ\xf1\x890731\xf1\x82\x0e1513001511001205232113052J00', + b'\xf1\x875QF959655AT\xf1\x890755\xf1\x82\x1311110011110011111100010200--1121240749', ], (Ecu.eps, 0x712, None): [ b'\xf1\x875Q0909143P \xf1\x892051\xf1\x820527T6050405', @@ -1187,6 +1190,7 @@ FW_VERSIONS = { b'\xf1\x875Q0909143P \xf1\x892051\xf1\x820527T6070405', b'\xf1\x875Q0910143C \xf1\x892211\xf1\x82\x0567T600G500', b'\xf1\x875Q0910143C \xf1\x892211\xf1\x82\x0567T600G600', + b'\xf1\x875TA907145F \xf1\x891063\xf1\x82\x002LT61A2LOM', ], (Ecu.fwdRadar, 0x757, None): [ b'\xf1\x872Q0907572Q \xf1\x890342', From 37859626844c061748f61eb85eb6e84d7f27e99d Mon Sep 17 00:00:00 2001 From: tanotaru <126554277+tanotaru@users.noreply.github.com> Date: Tue, 6 Jun 2023 17:25:03 -0700 Subject: [PATCH 04/13] VW: 2018 Audi RS3 FW (#27467) Co-authored-by: Cameron Clough --- selfdrive/car/volkswagen/values.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/volkswagen/values.py b/selfdrive/car/volkswagen/values.py index 947fbf9872..1529f4742c 100755 --- a/selfdrive/car/volkswagen/values.py +++ b/selfdrive/car/volkswagen/values.py @@ -923,6 +923,7 @@ FW_VERSIONS = { b'\xf1\x8704E906027CJ\xf1\x897798', b'\xf1\x8704L997022N \xf1\x899459', b'\xf1\x875G0906259A \xf1\x890004', + b'\xf1\x875G0906259D \xf1\x890002', b'\xf1\x875G0906259L \xf1\x890002', b'\xf1\x875G0906259Q \xf1\x890002', b'\xf1\x878V0906259F \xf1\x890002', @@ -932,7 +933,7 @@ FW_VERSIONS = { b'\xf1\x878V0906264B \xf1\x890003', b'\xf1\x878V0907115B \xf1\x890007', b'\xf1\x878V0907404A \xf1\x890005', - b'\xf1\x875G0906259D \xf1\x890002', + b'\xf1\x878V0907404G \xf1\x890005', ], (Ecu.transmission, 0x7e1, None): [ b'\xf1\x870CW300044T \xf1\x895245', @@ -949,6 +950,7 @@ FW_VERSIONS = { b'\xf1\x870DD300046F \xf1\x891602', b'\xf1\x870DD300046G \xf1\x891601', b'\xf1\x870DL300012E \xf1\x892012', + b'\xf1\x870DL300012H \xf1\x892112', b'\xf1\x870GC300011 \xf1\x890403', b'\xf1\x870GC300013M \xf1\x892402', b'\xf1\x870GC300042J \xf1\x891402', @@ -961,9 +963,9 @@ FW_VERSIONS = { b'\xf1\x875Q0959655BJ\xf1\x890339\xf1\x82\x1311110011131100311111011731179321342100', b'\xf1\x875Q0959655J \xf1\x890825\xf1\x82\x13111112111111--241115141112221291163221', b'\xf1\x875Q0959655J \xf1\x890825\xf1\x82\023111112111111--171115141112221291163221', - b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\023121111111211--261117141112231291163221', b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\x13111112111111--241115141112221291163221', b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\x13121111111111--341117141212231291163221', + b'\xf1\x875Q0959655J \xf1\x890830\xf1\x82\x13121111111211--261117141112231291163221', b'\xf1\x875Q0959655N \xf1\x890361\xf1\x82\0211212001112110004110411111421149114', b'\xf1\x875Q0959655N \xf1\x890361\xf1\x82\0211212001112111104110411111521159114', ], @@ -972,6 +974,7 @@ FW_VERSIONS = { b'\xf1\x873Q0909144J \xf1\x895063\xf1\x82\x0566G0HA14A1', b'\xf1\x873Q0909144K \xf1\x895072\xf1\x82\x0571G01A16A1', b'\xf1\x873Q0909144K \xf1\x895072\xf1\x82\x0571G0HA16A1', + b'\xf1\x873Q0909144K \xf1\x895072\xf1\x82\x0571G0JA13A1', b'\xf1\x873Q0909144L \xf1\x895081\xf1\x82\x0571G0JA14A1', b'\xf1\x875Q0909144AB\xf1\x891082\xf1\x82\00521G0G809A1', b'\xf1\x875Q0909144P \xf1\x891043\xf1\x82\00503G00303A0', From 464585c7587bc8f5d1854ae9e652d9933ac2bc2c Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 6 Jun 2023 18:50:37 -0700 Subject: [PATCH 05/13] bump panda --- panda | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda b/panda index 5847d7dbc0..bf2c007103 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit 5847d7dbc05df3bc76243b6704b9d98544eb53df +Subproject commit bf2c0071036bae4e0c00c37ae43237fce6063e31 From 2dda9a0532dc9b848e53317bd1a6dab1ef83e5c3 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 6 Jun 2023 20:28:56 -0700 Subject: [PATCH 06/13] match_fw_to_car: pass down log (#28434) pass in log from match_fw_to_car --- selfdrive/car/fw_versions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py index cd3ef7977c..5c36ba5664 100755 --- a/selfdrive/car/fw_versions.py +++ b/selfdrive/car/fw_versions.py @@ -94,7 +94,7 @@ def match_fw_to_car_fuzzy(fw_versions_dict, log=True, exclude=None): return set() -def match_fw_to_car_exact(fw_versions_dict) -> Set[str]: +def match_fw_to_car_exact(fw_versions_dict, log=True) -> Set[str]: """Do an exact FW match. Returns all cars that match the given FW versions for a list of "essential" ECUs. If an ECU is not considered essential the FW version can be missing to get a fingerprint, but if it's present it @@ -129,7 +129,7 @@ def match_fw_to_car_exact(fw_versions_dict) -> Set[str]: return set(candidates.keys()) - set(invalid) -def match_fw_to_car(fw_versions, allow_exact=True, allow_fuzzy=True): +def match_fw_to_car(fw_versions, allow_exact=True, allow_fuzzy=True, log=True): # Try exact matching first exact_matches = [] if allow_exact: @@ -142,7 +142,7 @@ def match_fw_to_car(fw_versions, allow_exact=True, allow_fuzzy=True): matches = set() for brand in VERSIONS.keys(): fw_versions_dict = build_fw_dict(fw_versions, filter_brand=brand) - matches |= match_func(fw_versions_dict) + matches |= match_func(fw_versions_dict, log=log) if len(matches): return exact_match, matches From 2b07ec4bde5c7994d97746737cd40e2f3fa1adcd Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 6 Jun 2023 21:14:03 -0700 Subject: [PATCH 07/13] FPv2: brand filter helper (#28439) * pass in brand * needs to be flipped for exact matching since it's subtractive * new helper * makes more sense flipped * clean up * not that stuff here * not here --- selfdrive/car/fw_versions.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py index 5c36ba5664..e44523c89d 100755 --- a/selfdrive/car/fw_versions.py +++ b/selfdrive/car/fw_versions.py @@ -28,11 +28,16 @@ def chunks(l, n=128): yield l[i:i + n] +def is_brand(brand: str, filter_brand: Optional[str]) -> bool: + """Returns if brand matches filter_brand or no brand filter is specified""" + return filter_brand is None or brand == filter_brand + + def build_fw_dict(fw_versions: List[capnp.lib.capnp._DynamicStructBuilder], filter_brand: Optional[str] = None) -> Dict[Tuple[int, Optional[int]], Set[bytes]]: fw_versions_dict = defaultdict(set) for fw in fw_versions: - if (filter_brand is None or fw.brand == filter_brand) and not fw.logging: + if is_brand(fw.brand, filter_brand) and not fw.logging: sub_addr = fw.subAddress if fw.subAddress != 0 else None fw_versions_dict[(fw.address, sub_addr)].add(fw.fwVersion) return dict(fw_versions_dict) @@ -277,7 +282,7 @@ def get_fw_versions(logcan, sendcan, query_brand=None, extra=None, timeout=0.1, # Get versions and build capnp list to put into CarParams car_fw = [] - requests = [(brand, config, r) for brand, config, r in REQUESTS if query_brand is None or brand == query_brand] + requests = [(brand, config, r) for brand, config, r in REQUESTS if is_brand(brand, query_brand)] for addr in tqdm(addrs, disable=not progress): for addr_chunk in chunks(addr): for brand, config, r in requests: From 0acc30d2644729283cb3e3a6021c05e41f965ded Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 6 Jun 2023 21:38:10 -0700 Subject: [PATCH 08/13] FPv2: test minimum fuzzy fingerprint ECUs (#28433) * basic messy test * draft * clean up * clean up * clean up * clean up * never was fuzzy, but be explicit * switch it up --- selfdrive/car/fw_versions.py | 13 +++++----- selfdrive/car/tests/test_fw_fingerprint.py | 29 +++++++++++++++++++--- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py index e44523c89d..c8af8779d9 100755 --- a/selfdrive/car/fw_versions.py +++ b/selfdrive/car/fw_versions.py @@ -15,6 +15,7 @@ from system.swaglog import cloudlog Ecu = car.CarParams.Ecu ESSENTIAL_ECUS = [Ecu.engine, Ecu.eps, Ecu.abs, Ecu.fwdRadar, Ecu.fwdCamera, Ecu.vsa] +FUZZY_EXCLUDE_ECUS = [Ecu.fwdCamera, Ecu.fwdRadar, Ecu.eps, Ecu.debug] FW_QUERY_CONFIGS = get_interface_attr('FW_QUERY_CONFIG', ignore_none=True) VERSIONS = get_interface_attr('FW_VERSIONS', ignore_none=True) @@ -58,12 +59,6 @@ def match_fw_to_car_fuzzy(fw_versions_dict, log=True, exclude=None): that were matched uniquely to that specific car. If multiple ECUs uniquely match to different cars the match is rejected.""" - # These ECUs are known to be shared between models (EPS only between hybrid/ICE version) - # Getting this exactly right isn't crucial, but excluding camera and radar makes it almost - # impossible to get 3 matching versions, even if two models with shared parts are released at the same - # time and only one is in our database. - exclude_types = [Ecu.fwdCamera, Ecu.fwdRadar, Ecu.eps, Ecu.debug] - # Build lookup table from (addr, sub_addr, fw) to list of candidate cars all_fw_versions = defaultdict(list) for candidate, fw_by_addr in FW_VERSIONS.items(): @@ -71,7 +66,11 @@ def match_fw_to_car_fuzzy(fw_versions_dict, log=True, exclude=None): continue for addr, fws in fw_by_addr.items(): - if addr[0] in exclude_types: + # These ECUs are known to be shared between models (EPS only between hybrid/ICE version) + # Getting this exactly right isn't crucial, but excluding camera and radar makes it almost + # impossible to get 3 matching versions, even if two models with shared parts are released at the same + # time and only one is in our database. + if addr[0] in FUZZY_EXCLUDE_ECUS: continue for f in fws: all_fw_versions[(addr[1], addr[2], f)].append(candidate) diff --git a/selfdrive/car/tests/test_fw_fingerprint.py b/selfdrive/car/tests/test_fw_fingerprint.py index c069280d11..0d653741fe 100755 --- a/selfdrive/car/tests/test_fw_fingerprint.py +++ b/selfdrive/car/tests/test_fw_fingerprint.py @@ -10,7 +10,7 @@ from cereal import car from common.params import Params from selfdrive.car.car_helpers import interfaces from selfdrive.car.fingerprints import FW_VERSIONS -from selfdrive.car.fw_versions import FW_QUERY_CONFIGS, VERSIONS, match_fw_to_car, get_fw_versions +from selfdrive.car.fw_versions import FW_QUERY_CONFIGS, FUZZY_EXCLUDE_ECUS, VERSIONS, match_fw_to_car, get_fw_versions CarFw = car.CarParams.CarFw Ecu = car.CarParams.Ecu @@ -33,7 +33,7 @@ class TestFwFingerprint(unittest.TestCase): self.assertEqual(candidates[0], expected) @parameterized.expand([(b, c, e[c]) for b, e in VERSIONS.items() for c in e]) - def test_fw_fingerprint(self, brand, car_model, ecus): + def test_exact_match(self, brand, car_model, ecus): CP = car.CarParams.new_message() for _ in range(200): fw = [] @@ -44,9 +44,32 @@ class TestFwFingerprint(unittest.TestCase): fw.append({"ecu": ecu_name, "fwVersion": random.choice(fw_versions), 'brand': brand, "address": addr, "subAddress": 0 if sub_addr is None else sub_addr}) CP.carFw = fw - _, matches = match_fw_to_car(CP.carFw) + _, matches = match_fw_to_car(CP.carFw, allow_fuzzy=False) self.assertFingerprints(matches, car_model) + @parameterized.expand([(b, c, e[c]) for b, e in VERSIONS.items() for c in e]) + def test_fuzzy_match(self, brand, car_model, ecus): + # TODO: speed up fuzzy matching and test more + CP = car.CarParams.new_message() + for _ in range(5): + fw = [] + for ecu, fw_versions in ecus.items(): + if not len(fw_versions): + raise unittest.SkipTest("Car model has no FW versions") + ecu_name, addr, sub_addr = ecu + fw.append({"ecu": ecu_name, "fwVersion": random.choice(fw_versions), 'brand': brand, + "address": addr, "subAddress": 0 if sub_addr is None else sub_addr}) + CP.carFw = fw + _, matches = match_fw_to_car(CP.carFw, allow_exact=False, log=False) + + # Assert no match if there are not enough valid ECUs + valid_ecus = [f['ecu'] for f in fw if f['ecu'] not in FUZZY_EXCLUDE_ECUS] + if len(valid_ecus) < 2: + self.assertEqual(len(matches), 0, valid_ecus) + # There won't always be a match due to shared FW, but if there is it should be correct + elif len(matches): + self.assertFingerprints(matches, car_model) + def test_no_duplicate_fw_versions(self): for car_model, ecus in FW_VERSIONS.items(): with self.subTest(car_model=car_model): From 7cb4adfebbb3c1a5901018f177bf87add7c0799b Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 7 Jun 2023 15:22:06 +1000 Subject: [PATCH 09/13] Cabana: Improve contrast when using dark themes (#28389) --- tools/cabana/binaryview.cc | 4 +++- tools/cabana/chart/chart.cc | 12 +++++++++++- tools/cabana/historylog.cc | 5 ++++- tools/cabana/signalview.cc | 5 ++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/tools/cabana/binaryview.cc b/tools/cabana/binaryview.cc index 50f66e5182..13cd76af3a 100644 --- a/tools/cabana/binaryview.cc +++ b/tools/cabana/binaryview.cc @@ -437,9 +437,11 @@ void BinaryItemDelegate::drawSignalCell(QPainter *painter, const QStyleOptionVie auto sig_color = getColor(sig); QColor color = sig_color; color.setAlpha(item->bg_color.alpha()); - painter->fillRect(rc, Qt::white); + // Mixing the signal colour with the Base background color to fade it + painter->fillRect(rc, QApplication::palette().color(QPalette::Base)); painter->fillRect(rc, color); + // Draw edges color = sig_color.darker(125); painter->setPen(QPen(color, 1)); if (draw_left) painter->drawLine(rc.topLeft(), rc.bottomLeft()); diff --git a/tools/cabana/chart/chart.cc b/tools/cabana/chart/chart.cc index a7f700f3c2..353bb3fab3 100644 --- a/tools/cabana/chart/chart.cc +++ b/tools/cabana/chart/chart.cc @@ -213,9 +213,19 @@ void ChartView::updateTitle() { for (QLegendMarker *marker : chart()->legend()->markers()) { QObject::connect(marker, &QLegendMarker::clicked, this, &ChartView::handleMarkerClicked, Qt::UniqueConnection); } + + // Use CSS to draw titles in the WindowText color + auto tmp = palette().color(QPalette::WindowText); + auto titleColorCss = tmp.name(QColor::HexArgb); + // Draw message details in similar color, but slightly fade it to the background + tmp.setAlpha(180); + auto msgColorCss = tmp.name(QColor::HexArgb); + for (auto &s : sigs) { auto decoration = s.series->isVisible() ? "none" : "line-through"; - s.series->setName(QString("%2 %3 %4").arg(decoration, s.sig->name, msgName(s.msg_id), s.msg_id.toString())); + s.series->setName(QString("%3 %5 %6") + .arg(decoration, titleColorCss, s.sig->name, + msgColorCss, msgName(s.msg_id), s.msg_id.toString())); } split_chart_act->setEnabled(sigs.size() > 1); resetChartCache(); diff --git a/tools/cabana/historylog.cc b/tools/cabana/historylog.cc index 51abc3d50f..01c1f31645 100644 --- a/tools/cabana/historylog.cc +++ b/tools/cabana/historylog.cc @@ -63,7 +63,10 @@ QVariant HistoryLogModel::headerData(int section, Qt::Orientation orientation, i return "Data"; } } else if (role == Qt::BackgroundRole && section > 0 && show_signals) { - return QBrush(getColor(sigs[section - 1])); + // Alpha-blend the signal color with the background to ensure contrast + QColor sigColor = getColor(sigs[section - 1]); + sigColor.setAlpha(128); + return QBrush(sigColor); } } return {}; diff --git a/tools/cabana/signalview.cc b/tools/cabana/signalview.cc index 762b494f35..98cd08a690 100644 --- a/tools/cabana/signalview.cc +++ b/tools/cabana/signalview.cc @@ -459,7 +459,10 @@ SignalView::SignalView(ChartsWidget *charts, QWidget *parent) : charts(charts), tree->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); tree->header()->setStretchLastSection(true); tree->setMinimumHeight(300); - tree->setStyleSheet("QSpinBox{background-color:white;border:none;} QLineEdit{background-color:white;}"); + + // Use a distinctive background for the whole row containing a QSpinBox or QLineEdit + QString nodeBgColor = palette().color(QPalette::AlternateBase).name(QColor::HexArgb); + tree->setStyleSheet(QString("QSpinBox{background-color:%1;border:none;} QLineEdit{background-color:%1;}").arg(nodeBgColor)); QVBoxLayout *main_layout = new QVBoxLayout(this); main_layout->setContentsMargins(0, 0, 0, 0); From 42eb7c527e2287eae20a96d867c1be4f78761bb7 Mon Sep 17 00:00:00 2001 From: eFini Date: Wed, 7 Jun 2023 14:58:48 +0800 Subject: [PATCH 10/13] Multilang: add missing Chinese (Traditional) translations (#28427) update chinese tranditional translations --- selfdrive/ui/translations/main_zh-CHT.ts | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/selfdrive/ui/translations/main_zh-CHT.ts b/selfdrive/ui/translations/main_zh-CHT.ts index 954991c705..c6e2d22f5a 100644 --- a/selfdrive/ui/translations/main_zh-CHT.ts +++ b/selfdrive/ui/translations/main_zh-CHT.ts @@ -856,23 +856,23 @@ This may take up to a minute. failed to check for update - + 檢查更新失敗 up to date, last checked %1 - + 已經是最新版本,上次檢查時間為 %1 DOWNLOAD - + 下載 update available - + 有可用的更新 never - + 從未更新 @@ -1040,35 +1040,35 @@ This may take up to a minute. openpilot Longitudinal Control (Alpha) - + openpilot 縱向控制 (Alpha 版) WARNING: openpilot longitudinal control is in alpha for this car and will disable Automatic Emergency Braking (AEB). - + 警告:此車輛的 Openpilot 縱向控制功能目前處於 Alpha 版本,使用此功能將會停用自動緊急制動(AEB)功能。 On this car, openpilot defaults to the car's built-in ACC instead of openpilot's longitudinal control. Enable this to switch to openpilot longitudinal control. Enabling Experimental mode is recommended when enabling openpilot longitudinal control alpha. - + 在這輛車上,Openpilot 預設使用車輛內建的主動巡航控制(ACC),而非 Openpilot 的縱向控制。啟用此項功能可切換至 Openpilot 的縱向控制。當啟用 Openpilot 縱向控制 Alpha 版本時,建議同時啟用實驗性模式(Experimental mode)。 Aggressive - + 積極 Standard - + 標準 Relaxed - + 舒適 Driving Personality - + 駕駛風格 Standard is recommended. In aggressive mode, openpilot will follow lead cars closer and be more aggressive with the gas and brake. In relaxed mode openpilot will stay further away from lead cars. - + 推薦使用標準模式。在積極模式中,openpilot 會更靠近前車並在加速和剎車方面更積極。在舒適模式中,openpilot 會與前車保持較遠的距離。 @@ -1110,23 +1110,23 @@ This may take up to a minute. WiFiPromptWidget Setup Wi-Fi - + 設置 Wi-Fi 連接 Connect to Wi-Fi to upload driving data and help improve openpilot - + 請連接至 Wi-Fi 以上傳駕駛數據,並協助改進 openpilot。 Open Settings - + 開啟設置 Uploading training data - + 正在上傳訓練數據 Your data is used to train driving models and help improve openpilot - + 您的數據將用於訓練駕駛模型並協助改進 openpilot From 9e8936be9863ea27c598685ee1b14775aa12cac4 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 7 Jun 2023 00:03:01 -0700 Subject: [PATCH 11/13] fuzzy fingerprint: track number of matching ECUs, not FW versions (#28423) * first attempt trying to do it implicitly bad * back to lists and explicitly do this * continue checking if candidate switches on these, that's fine to check * debugging * clean up * more clean up * spot free * only need to create/update on change * fix test * draft * Revert "draft" This reverts commit dbe32f58b172eddc8f9699044c6a5956e753305d. * Revert "fix test" This reverts commit 1d34269fe2de35d314aa0658fa47a78a08d93e08. * fix test for real * first draft of test * this should be good * can replace existing fuzzy test * rm * matching * test non-empty fws * TEST DOWN HERE * no test * unique + fix skip message + comment + clean up * less confusing * ing * better --- selfdrive/car/fw_versions.py | 11 ++++---- selfdrive/car/tests/test_fw_fingerprint.py | 32 ++++++++++++---------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py index c8af8779d9..ca75ed62e5 100755 --- a/selfdrive/car/fw_versions.py +++ b/selfdrive/car/fw_versions.py @@ -75,24 +75,25 @@ def match_fw_to_car_fuzzy(fw_versions_dict, log=True, exclude=None): for f in fws: all_fw_versions[(addr[1], addr[2], f)].append(candidate) - match_count = 0 + matched_ecus = set() candidate = None for addr, versions in fw_versions_dict.items(): + ecu_key = (addr[0], addr[1]) for version in versions: # All cars that have this FW response on the specified address - candidates = all_fw_versions[(addr[0], addr[1], version)] + candidates = all_fw_versions[(*ecu_key, version)] if len(candidates) == 1: - match_count += 1 + matched_ecus.add(ecu_key) if candidate is None: candidate = candidates[0] # We uniquely matched two different cars. No fuzzy match possible elif candidate != candidates[0]: return set() - if match_count >= 2: + if len(matched_ecus) >= 2: if log: - cloudlog.error(f"Fingerprinted {candidate} using fuzzy match. {match_count} matching ECUs") + cloudlog.error(f"Fingerprinted {candidate} using fuzzy match. {len(matched_ecus)} matching ECUs") return {candidate} else: return set() diff --git a/selfdrive/car/tests/test_fw_fingerprint.py b/selfdrive/car/tests/test_fw_fingerprint.py index 0d653741fe..ef8b64946c 100755 --- a/selfdrive/car/tests/test_fw_fingerprint.py +++ b/selfdrive/car/tests/test_fw_fingerprint.py @@ -48,24 +48,26 @@ class TestFwFingerprint(unittest.TestCase): self.assertFingerprints(matches, car_model) @parameterized.expand([(b, c, e[c]) for b, e in VERSIONS.items() for c in e]) - def test_fuzzy_match(self, brand, car_model, ecus): - # TODO: speed up fuzzy matching and test more - CP = car.CarParams.new_message() - for _ in range(5): - fw = [] - for ecu, fw_versions in ecus.items(): - if not len(fw_versions): - raise unittest.SkipTest("Car model has no FW versions") - ecu_name, addr, sub_addr = ecu - fw.append({"ecu": ecu_name, "fwVersion": random.choice(fw_versions), 'brand': brand, + def test_fuzzy_match_ecu_count(self, brand, car_model, ecus): + # Asserts that fuzzy matching does not count matching FW, but ECU address keys + valid_ecus = [e for e in ecus if e[0] not in FUZZY_EXCLUDE_ECUS and len(ecus[e])] + if not len(valid_ecus): + raise unittest.SkipTest("Car model has no compatible ECUs for fuzzy matching") + + fw = [] + for ecu in valid_ecus: + ecu_name, addr, sub_addr = ecu + for _ in range(5): + # Add multiple FW versions to simulate ECU returning to multiple queries in a brand + fw.append({"ecu": ecu_name, "fwVersion": random.choice(ecus[ecu]), 'brand': brand, "address": addr, "subAddress": 0 if sub_addr is None else sub_addr}) - CP.carFw = fw + CP = car.CarParams.new_message(carFw=fw) _, matches = match_fw_to_car(CP.carFw, allow_exact=False, log=False) - # Assert no match if there are not enough valid ECUs - valid_ecus = [f['ecu'] for f in fw if f['ecu'] not in FUZZY_EXCLUDE_ECUS] - if len(valid_ecus) < 2: - self.assertEqual(len(matches), 0, valid_ecus) + # Assert no match if there are not enough unique ECUs + unique_ecus = {(f['address'], f['subAddress']) for f in fw} + if len(unique_ecus) < 2: + self.assertEqual(len(matches), 0) # There won't always be a match due to shared FW, but if there is it should be correct elif len(matches): self.assertFingerprints(matches, car_model) From f976fce7d0142088244ae4af8a1116691b621843 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 7 Jun 2023 00:05:41 -0700 Subject: [PATCH 12/13] FPv2: assert non-empty FW lists (#28441) * test empty fw lists * fix * generic test name * can rmeove this check now * and here! * can remove that * add to print --- selfdrive/car/ford/values.py | 2 -- selfdrive/car/tests/test_fw_fingerprint.py | 11 +++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/selfdrive/car/ford/values.py b/selfdrive/car/ford/values.py index edc40f629c..9b7b6ad83e 100644 --- a/selfdrive/car/ford/values.py +++ b/selfdrive/car/ford/values.py @@ -213,8 +213,6 @@ FW_VERSIONS = { (Ecu.engine, 0x7E0, None): [ b'JX6A-14C204-BPL\x00\x00\x00\x00\x00\x00\x00\x00\x00', ], - (Ecu.shiftByWire, 0x732, None): [ - ], }, CAR.MAVERICK_MK1: { (Ecu.eps, 0x730, None): [ diff --git a/selfdrive/car/tests/test_fw_fingerprint.py b/selfdrive/car/tests/test_fw_fingerprint.py index ef8b64946c..b90120a1e2 100755 --- a/selfdrive/car/tests/test_fw_fingerprint.py +++ b/selfdrive/car/tests/test_fw_fingerprint.py @@ -38,8 +38,6 @@ class TestFwFingerprint(unittest.TestCase): for _ in range(200): fw = [] for ecu, fw_versions in ecus.items(): - if not len(fw_versions): - raise unittest.SkipTest("Car model has no FW versions") ecu_name, addr, sub_addr = ecu fw.append({"ecu": ecu_name, "fwVersion": random.choice(fw_versions), 'brand': brand, "address": addr, "subAddress": 0 if sub_addr is None else sub_addr}) @@ -50,7 +48,7 @@ class TestFwFingerprint(unittest.TestCase): @parameterized.expand([(b, c, e[c]) for b, e in VERSIONS.items() for c in e]) def test_fuzzy_match_ecu_count(self, brand, car_model, ecus): # Asserts that fuzzy matching does not count matching FW, but ECU address keys - valid_ecus = [e for e in ecus if e[0] not in FUZZY_EXCLUDE_ECUS and len(ecus[e])] + valid_ecus = [e for e in ecus if e[0] not in FUZZY_EXCLUDE_ECUS] if not len(valid_ecus): raise unittest.SkipTest("Car model has no compatible ECUs for fuzzy matching") @@ -67,18 +65,19 @@ class TestFwFingerprint(unittest.TestCase): # Assert no match if there are not enough unique ECUs unique_ecus = {(f['address'], f['subAddress']) for f in fw} if len(unique_ecus) < 2: - self.assertEqual(len(matches), 0) + self.assertEqual(len(matches), 0, car_model) # There won't always be a match due to shared FW, but if there is it should be correct elif len(matches): self.assertFingerprints(matches, car_model) - def test_no_duplicate_fw_versions(self): + def test_fw_version_lists(self): for car_model, ecus in FW_VERSIONS.items(): with self.subTest(car_model=car_model): for ecu, ecu_fw in ecus.items(): with self.subTest(ecu): duplicates = {fw for fw in ecu_fw if ecu_fw.count(fw) > 1} - self.assertFalse(len(duplicates), f"{car_model}: Duplicate FW versions: Ecu.{ECU_NAME[ecu[0]]}, {duplicates}") + self.assertFalse(len(duplicates), f'{car_model}: Duplicate FW versions: Ecu.{ECU_NAME[ecu[0]]}, {duplicates}') + self.assertGreater(len(ecu_fw), 0, f'{car_model}: No FW versions: Ecu.{ECU_NAME[ecu[0]]}') def test_all_addrs_map_to_one_ecu(self): for brand, cars in VERSIONS.items(): From a92cd659cef7c517b40e7fd1455a12bacb3184b9 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 7 Jun 2023 01:11:41 -0700 Subject: [PATCH 13/13] ButtonParamControl: minimum button width (#28442) * min width * param --- selfdrive/ui/qt/widgets/controls.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/widgets/controls.h b/selfdrive/ui/qt/widgets/controls.h index 43054b892f..654c6e2c1c 100644 --- a/selfdrive/ui/qt/widgets/controls.h +++ b/selfdrive/ui/qt/widgets/controls.h @@ -202,7 +202,7 @@ class ButtonParamControl : public AbstractControl { Q_OBJECT public: ButtonParamControl(const QString ¶m, const QString &title, const QString &desc, const QString &icon, - const std::vector &button_texts) : AbstractControl(title, desc, icon) { + const std::vector &button_texts, const int minimum_button_width = 225) : AbstractControl(title, desc, icon) { const QString style = R"( QPushButton { border-radius: 50px; @@ -230,6 +230,7 @@ public: button->setCheckable(true); button->setChecked(i == value); button->setStyleSheet(style); + button->setMinimumWidth(minimum_button_width); hlayout->addWidget(button); button_group->addButton(button, i); }