add VW honda Tesla Ford, add missing chinese traslation (#247)

* add Tesla VW Honda Ford

* fix VW  add chinese
This commit is contained in:
机械小鸽
2026-02-04 12:21:31 +08:00
committed by GitHub
parent 665c5541be
commit 0ab1092298
9 changed files with 369 additions and 13 deletions

View File

@@ -166,6 +166,13 @@ def get_car(can_recv: CanRecvCallable, can_send: CanSendCallable, set_obd_multip
from opendbc.car.gm.values import CAR as GM
from opendbc.car.toyota.values import CAR as TOYOTA
from opendbc.car.mazda.values import CAR as MAZDA
from opendbc.car.honda.values import CAR as HONDA
from opendbc.car.ford.values import CAR as FORD
from opendbc.car.tesla.values import CAR as TESLA
from opendbc.car.volkswagen.values import CAR as VOLKSWAGEN
from opendbc.car.chrysler.values import CAR as CHRYSLER
from opendbc.car.nissan.values import CAR as NISSAN
from opendbc.car.subaru.values import CAR as SUBARU
for platform in GM:
for doc in platform.config.car_docs:
if name == doc.name:
@@ -182,6 +189,34 @@ def get_car(can_recv: CanRecvCallable, can_send: CanSendCallable, set_obd_multip
for doc in platform.config.car_docs:
if name == doc.name:
return platform
for platform in HONDA:
for doc in platform.config.car_docs:
if name == doc.name:
return platform
for platform in FORD:
for doc in platform.config.car_docs:
if name == doc.name:
return platform
for platform in TESLA:
for doc in platform.config.car_docs:
if name == doc.name:
return platform
for platform in VOLKSWAGEN:
for doc in platform.config.car_docs:
if name == doc.name:
return platform
for platform in CHRYSLER:
for doc in platform.config.car_docs:
if name == doc.name:
return platform
for platform in NISSAN:
for doc in platform.config.car_docs:
if name == doc.name:
return platform
for platform in SUBARU:
for doc in platform.config.car_docs:
if name == doc.name:
return platform
return None
found_car = find_car(selected_car)
if found_car is not None:

View File

@@ -314,3 +314,12 @@ FW_QUERY_CONFIG = FwQueryConfig(
)
DBC = CAR.create_dbc_map()
if __name__ == "__main__":
cars = []
for platform in CAR:
for doc in platform.config.car_docs:
cars.append(doc.name)
cars.sort()
for c in cars:
print(c)

View File

@@ -345,3 +345,12 @@ HONDA_BOSCH_RADARLESS = CAR.with_flags(HondaFlags.BOSCH_RADARLESS)
DBC = CAR.create_dbc_map()
if __name__ == "__main__":
cars = []
for platform in CAR:
for doc in platform.config.car_docs:
cars.append(doc.name)
cars.sort()
for c in cars:
print(c)

View File

@@ -109,3 +109,12 @@ class TeslaFlags(IntFlag):
DBC = CAR.create_dbc_map()
STEER_THRESHOLD = 0.5
if __name__ == "__main__":
cars = []
for platform in CAR:
for doc in platform.config.car_docs:
cars.append(doc.name)
cars.sort()
for c in cars:
print(c)

View File

@@ -1,10 +1,22 @@
from opendbc.can import CANParser
import numpy as np
from opendbc.can.parser import CANParser
from opendbc.car import Bus, structs
from opendbc.car.interfaces import CarStateBase
from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.volkswagen.values import DBC, CANBUS, NetworkLocation, TransmissionType, GearShifter, \
CarControllerParams, VolkswagenFlags
class MqbExtraSignals:
fwd_radar_messages = [("ACC_06", 50), ("ACC_07", 50), ("ACC_10", 50), ("ACC_02", 17)]
bsm_radar_messages = [("SWA_01", 20)]
class PqExtraSignals:
fwd_radar_messages = [("ACC_System", 50), ("ACC_GRA_Anzeige", 25)]
bsm_radar_messages = [("SWA_1", 20)]
ButtonType = structs.CarState.ButtonEvent.Type
@@ -257,24 +269,98 @@ class CarState(CarStateBase):
return CarState.get_can_parsers_pq(CP)
# another case of the 1-50Hz
pt_messages = [
("LWI_01", 100), # From J500 Steering Assist with integrated sensors
("LH_EPS_03", 100), # From J500 Steering Assist with integrated sensors
("ESP_19", 100), # From J104 ABS/ESP controller
("ESP_05", 50), # From J104 ABS/ESP controller
("ESP_21", 50), # From J104 ABS/ESP controller
("Motor_20", 50), # From J623 Engine control module
("TSK_06", 50), # From J623 Engine control module
("ESP_02", 50), # From J104 ABS/ESP controller
("GRA_ACC_01", 33), # From J533 CAN gateway (via LIN from steering wheel controls)
("Gateway_73", 20), # From J533 CAN gateway (aggregated data)
("Gateway_72", 10), # From J533 CAN gateway (aggregated data)
("Motor_14", 10), # From J623 Engine control module
("Airbag_02", 5), # From J234 Airbag control module
("Kombi_01", 2), # From J285 Instrument cluster
("Blinkmodi_02", 1), # From J519 BCM (sent at 1Hz when no lights active, 50Hz when active)
("Kombi_03", 0), # From J285 instrument cluster (not present on older cars, 1Hz when present)
]
if CP.transmissionType == TransmissionType.direct:
pt_messages.append(("Motor_EV_01", 10))
if CP.networkLocation == NetworkLocation.fwdCamera:
# Radars are here on CANBUS.pt
pt_messages += MqbExtraSignals.fwd_radar_messages
if CP.enableBsm:
pt_messages += MqbExtraSignals.bsm_radar_messages
cam_messages = []
if CP.flags & VolkswagenFlags.STOCK_HCA_PRESENT:
cam_messages += [
("HCA_01", 1), # From R242 Driver assistance camera, 50Hz if steering/1Hz if not
]
if CP.networkLocation == NetworkLocation.fwdCamera:
cam_messages += [
("LDW_02", 10) # From R242 Driver assistance camera
]
else:
# Radars are here on CANBUS.cam
cam_messages += MqbExtraSignals.fwd_radar_messages
if CP.enableBsm:
cam_messages += MqbExtraSignals.bsm_radar_messages
return {
Bus.pt: CANParser(DBC[CP.carFingerprint][Bus.pt], [
# the 50->1Hz is currently too much for the CANParser to figure out
("Blinkmodi_02", 1), # From J519 BCM (sent at 1Hz when no lights active, 50Hz when active)
], CANBUS.pt),
Bus.pt: CANParser(DBC[CP.carFingerprint][Bus.pt], pt_messages, CANBUS.pt),
Bus.cam: CANParser(DBC[CP.carFingerprint][Bus.pt], cam_messages, CANBUS.cam),
}
@staticmethod
def get_can_parsers_pq(CP):
pt_messages = [
("Bremse_1", 100), # From J104 ABS/ESP controller
("Bremse_3", 100), # From J104 ABS/ESP controller
("Lenkhilfe_3", 100), # From J500 Steering Assist with integrated sensors
("Lenkwinkel_1", 100), # From J500 Steering Assist with integrated sensors
("Motor_3", 100), # From J623 Engine control module
("Airbag_1", 50), # From J234 Airbag control module
("Bremse_5", 50), # From J104 ABS/ESP controller
("GRA_Neu", 50), # From J??? steering wheel control buttons
("Kombi_1", 50), # From J285 Instrument cluster
("Motor_2", 50), # From J623 Engine control module
("Motor_5", 50), # From J623 Engine control module
("Lenkhilfe_2", 20), # From J500 Steering Assist with integrated sensors
("Gate_Komf_1", 10), # From J533 CAN gateway
]
if CP.transmissionType == TransmissionType.automatic:
pt_messages += [("Getriebe_1", 100)] # From J743 Auto transmission control module
elif CP.transmissionType == TransmissionType.manual:
pt_messages += [("Motor_1", 100)] # From J623 Engine control module
if CP.networkLocation == NetworkLocation.fwdCamera:
# Extended CAN devices other than the camera are here on CANBUS.pt
pt_messages += PqExtraSignals.fwd_radar_messages
if CP.enableBsm:
pt_messages += PqExtraSignals.bsm_radar_messages
cam_messages = []
if CP.networkLocation == NetworkLocation.fwdCamera:
cam_messages += [
("LDW_Status", 10) # From R242 Driver assistance camera
]
if CP.networkLocation == NetworkLocation.gateway:
# Radars are here on CANBUS.cam
cam_messages += PqExtraSignals.fwd_radar_messages
if CP.enableBsm:
cam_messages += PqExtraSignals.bsm_radar_messages
return {
Bus.pt: CANParser(DBC[CP.carFingerprint][Bus.pt], [], CANBUS.pt),
Bus.cam: CANParser(DBC[CP.carFingerprint][Bus.pt], [], CANBUS.cam),
Bus.pt: CANParser(DBC[CP.carFingerprint][Bus.pt], pt_messages, CANBUS.pt),
Bus.cam: CANParser(DBC[CP.carFingerprint][Bus.pt], cam_messages, CANBUS.cam),
}

View File

@@ -526,3 +526,12 @@ FW_QUERY_CONFIG = FwQueryConfig(
)
DBC = CAR.create_dbc_map()
if __name__ == "__main__":
cars = []
for platform in CAR:
for doc in platform.config.car_docs:
cars.append(doc.name)
cars.sort()
for c in cars:
print(c)

View File

@@ -508,7 +508,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QFrame(parent) {
if(false) {
panels.append({tr("Firehose"), new FirehosePanel(this)});
}
panels.append({ tr("Carrot"), new CarrotPanel(this) });
panels.append({ tr("CarrotPilot"), new CarrotPanel(this) });
panels.append({ tr("Developer"), new DeveloperPanel(this) });
nav_btns = new QButtonGroup(this);
@@ -784,6 +784,10 @@ CarrotPanel::CarrotPanel(QWidget* parent) : QWidget(parent) {
all_items.append(get_list((QString::fromStdString(Params().getParamPath()) + "/SupportedCars_gm").toStdString().c_str()));
all_items.append(get_list((QString::fromStdString(Params().getParamPath()) + "/SupportedCars_toyota").toStdString().c_str()));
all_items.append(get_list((QString::fromStdString(Params().getParamPath()) + "/SupportedCars_mazda").toStdString().c_str()));
all_items.append(get_list((QString::fromStdString(Params().getParamPath()) + "/SupportedCars_honda").toStdString().c_str()));
all_items.append(get_list((QString::fromStdString(Params().getParamPath()) + "/SupportedCars_ford").toStdString().c_str()));
all_items.append(get_list((QString::fromStdString(Params().getParamPath()) + "/SupportedCars_tesla").toStdString().c_str()));
all_items.append(get_list((QString::fromStdString(Params().getParamPath()) + "/SupportedCars_volkswagen").toStdString().c_str()));
QMap<QString, QStringList> car_groups;
for (const QString& car : all_items) {
@@ -795,11 +799,11 @@ CarrotPanel::CarrotPanel(QWidget* parent) : QWidget(parent) {
}
QStringList manufacturers = car_groups.keys();
QString selectedManufacturer = MultiOptionDialog::getSelection("Select Manufacturer", manufacturers, manufacturers.isEmpty() ? "" : manufacturers.first(), this);
QString selectedManufacturer = MultiOptionDialog::getSelection(tr("Select Manufacturer"), manufacturers, manufacturers.isEmpty() ? "" : manufacturers.first(), this);
if (!selectedManufacturer.isEmpty()) {
QStringList cars = car_groups[selectedManufacturer];
QString selectedCar = MultiOptionDialog::getSelection("Select your car", cars, selected, this);
QString selectedCar = MultiOptionDialog::getSelection(tr("Select your car"), cars, selected, this);
if (!selectedCar.isEmpty()) {
if (selectedCar == "[ Not Selected ]") {
@@ -843,7 +847,7 @@ CarrotPanel::CarrotPanel(QWidget* parent) : QWidget(parent) {
startToggles->addItem(new CValueControl("SoftwareMenu", tr("Enable Software Menu"), "", 0, 1, 1));
startToggles->addItem(new CValueControl("IsLdwsCar", tr("IsLdwsCar"), "", 0, 1, 1));
startToggles->addItem(new CValueControl("HardwareC3xLite", tr("Hardware is C3x Lite"), "", 0, 1, 1));
startToggles->addItem(new CValueControl("ShareData", "Share Data", tr("0:None, 1:TCP JSON Data(Reboot required)"), 0, 1, 1));
startToggles->addItem(new CValueControl("ShareData", tr("Share Data"), tr("0:None, 1:TCP JSON Data(Reboot required)"), 0, 1, 1));
//startToggles->addItem(new CValueControl("CarrotCountDownSpeed", "NaviCountDown Speed(10)", "", 0, 200, 5));
//startToggles->addItem(new ParamControl("NoLogging", "Disable Logger", "", this));
//startToggles->addItem(new ParamControl("LaneChangeNeedTorque", "LaneChange: Need Torque", "", this));

View File

@@ -245,7 +245,15 @@
</message>
<message>
<source>0:None, 1:Stopping only, 2: Stop &amp; Go</source>
<translation>0:关闭, 1:仅停, 2:停走</translation>
<translation>0:, 1:仅停, 2:停走</translation>
</message>
<message>
<source>AChangeCostStarting</source>
<translation></translation>
</message>
<message>
<source>TrafficStopDistanceAdjust</source>
<translation>绿</translation>
</message>
<message>
<source>Laneline mode speed(0)</source>
@@ -775,6 +783,50 @@
<source>ATC Auto Map Change(0)</source>
<translation>ATC (0)</translation>
</message>
<message>
<source>Share Data</source>
<translation></translation>
</message>
<message>
<source>Hardware is C3x Lite</source>
<translation> C3x Lite</translation>
</message>
<message>
<source>0:None, 1:TCP JSON Data(Reboot required)</source>
<translation>0:, 1:TCP JSON ()</translation>
</message>
<message>
<source>Smart Speed Control(0)</source>
<translation>(0)</translation>
</message>
<message>
<source>0: off, 1:accel, 2:decel, 3: all</source>
<translation>0:关闭, 1:加速, 2:减速, 3:全部</translation>
</message>
<message>
<source>Model TurnSpeed Factor(0)</source>
<translation>(0)</translation>
</message>
<message>
<source>Enable Software Menu</source>
<translation></translation>
</message>
<message>
<source>Select your car</source>
<translation></translation>
</message>
<message>
<source>Wait for list...</source>
<translation>...</translation>
</message>
<message>
<source>Select Manufacturer</source>
<translation></translation>
</message>
<message>
<source>SELECT YOUR CAR</source>
<translation></translation>
</message>
</context>
<context>
<name>ConfirmationDialog</name>
@@ -1515,7 +1567,7 @@ Firehose Mode allows you to maximize your training data uploads to improve openp
</message>
<message>
<source>0:None, 1:Stopping only, 2: Stop &amp; Go</source>
<translation >0:关闭, 1:仅停, 2:车后起步</translation>
<translation >0:, 1:仅停, 2:</translation>
</message>
<message>
<source>Laneline mode speed(0)</source>
@@ -1915,6 +1967,118 @@ This may take up to a minute.</source>
<source>Carrot</source>
<translation>Carrot</translation>
</message>
<message>
<source>Share Data</source>
<translation></translation>
</message>
<message>
<source>0:None, 1:TCP JSON Data(Reboot required)</source>
<translation>0:, 1:TCP JSON数据()</translation>
</message>
<message>
<source>Hardware is C3x Lite</source>
<translation> C3x Lite</translation>
</message>
<message>
<source>Hardware is C3x</source>
<translation> C3x</translation>
</message>
<message>
<source>Hardware is C3</source>
<translation> C3</translation>
</message>
<message>
<source>Hardware is TICI</source>
<translation> TICI</translation>
</message>
<message>
<source>Hardware is EON</source>
<translation> EON</translation>
</message>
<message>
<source>Hardware is Unknown</source>
<translation></translation>
</message>
<message>
<source>Open SSH</source>
<translation> SSH</translation>
</message>
<message>
<source>Record UI</source>
<translation> UI</translation>
</message>
<message>
<source>Stop Recording UI</source>
<translation> UI</translation>
</message>
<message>
<source>Reset UI</source>
<translation> UI</translation>
</message>
<message>
<source>Developer Menu</source>
<translation></translation>
</message>
<message>
<source>Reset Calibration</source>
<translation></translation>
</message>
<message>
<source>Are you sure you want to reset calibration?</source>
<translation></translation>
</message>
<message>
<source>Review Training Guide</source>
<translation></translation>
</message>
<message>
<source>Regulatory</source>
<translation></translation>
</message>
<message>
<source>Change Language</source>
<translation></translation>
</message>
<message>
<source>Are you sure you want to reset all settings?</source>
<translation></translation>
</message>
<message>
<source>Reset</source>
<translation></translation>
</message>
<message>
<source>Disengaged</source>
<translation></translation>
</message>
<message>
<source>Engaged</source>
<translation></translation>
</message>
<message>
<source>Warning</source>
<translation></translation>
</message>
<message>
<source>Critical</source>
<translation></translation>
</message>
<message>
<source>openpilot Longitudinal Control (Alpha)</source>
<translation>openpilot (Alpha)</translation>
</message>
<message>
<source>WARNING: openpilot longitudinal control is in alpha for this car and will take over the gas and stop buttons. Look for once it has been tested and verified.</source>
<translation> openpilot alpha </translation>
</message>
<message>
<source>Show Debug UI</source>
<translation> UI</translation>
</message>
<message>
<source>Display debug UI elements.</source>
<translation> UI </translation>
</message>
</context>
<context>
<name>Setup</name>
@@ -2176,6 +2340,33 @@ This may take up to a minute.</source>
<translation></translation>
</message>
</context>
<context>
<name>SettingsWindow</name>
<message>
<source>CarrotPilot</source>
<translation>CarrotPilot</translation>
</message>
<message>
<source>Device</source>
<translation></translation>
</message>
<message>
<source>Network</source>
<translation></translation>
</message>
<message>
<source>Toggles</source>
<translation></translation>
</message>
<message>
<source>Software</source>
<translation></translation>
</message>
<message>
<source>Developer</source>
<translation></translation>
</message>
</context>
<context>
<name>SshControl</name>
<message>

View File

@@ -200,6 +200,10 @@ def main() -> None:
os.system(f"python ../../opendbc/car/gm/values.py > {Params().get_param_path()}/SupportedCars_gm")
os.system(f"python ../../opendbc/car/toyota/values.py > {Params().get_param_path()}/SupportedCars_toyota")
os.system(f"python ../../opendbc/car/mazda/values.py > {Params().get_param_path()}/SupportedCars_mazda")
os.system(f"python ../../opendbc/car/honda/values.py > {Params().get_param_path()}/SupportedCars_honda")
os.system(f"python ../../opendbc/car/ford/values.py > {Params().get_param_path()}/SupportedCars_ford")
os.system(f"python ../../opendbc/car/tesla/values.py > {Params().get_param_path()}/SupportedCars_tesla")
os.system(f"python ../../opendbc/car/volkswagen/values.py > {Params().get_param_path()}/SupportedCars_volkswagen")
if os.getenv("PREPAREONLY") is not None:
return