mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-07-26 20:32:04 +08:00
Added CX-8 as its own car
This commit is contained in:
@@ -268,6 +268,7 @@ MIGRATION = {
|
||||
"GENESIS GV80 2023": HYUNDAI.GENESIS_GV80,
|
||||
"GENESIS GV80 2025": HYUNDAI.GENESIS_GV80_2025,
|
||||
"MAZDA CX-5": MAZDA.MAZDA_CX5,
|
||||
"MAZDA CX-8": MAZDA.MAZDA_CX8,
|
||||
"MAZDA CX-9": MAZDA.MAZDA_CX9,
|
||||
"MAZDA 3": MAZDA.MAZDA_3,
|
||||
"MAZDA 6": MAZDA.MAZDA_6,
|
||||
|
||||
@@ -129,12 +129,31 @@ FW_VERSIONS = {
|
||||
b'SH9T-21PS1-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
],
|
||||
},
|
||||
CAR.MAZDA_CX8: {
|
||||
(Ecu.eps, 0x730, None): [
|
||||
b'K19G-3210X-A-00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.engine, 0x7e0, None): [
|
||||
b'PYW2-188K2-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.fwdRadar, 0x764, None): [
|
||||
b'K131-67XK2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.abs, 0x760, None): [
|
||||
b'K632-437K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.fwdCamera, 0x706, None): [
|
||||
b'GSH7-67XK2-T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
],
|
||||
(Ecu.transmission, 0x7e1, None): [
|
||||
b'PYV8-21PS1-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
],
|
||||
},
|
||||
CAR.MAZDA_CX9: {
|
||||
(Ecu.eps, 0x730, None): [
|
||||
b'K070-3210X-C-00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'KJ01-3210X-G-00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'KJ01-3210X-L-00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'K19G-3210X-A-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', # CX-8
|
||||
],
|
||||
(Ecu.engine, 0x7e0, None): [
|
||||
b'PX23-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
@@ -146,7 +165,6 @@ FW_VERSIONS = {
|
||||
b'PYD8-188K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'PYFM-188K2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'PYFM-188K2-H\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'PYW2-188K2-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', # CX-8
|
||||
],
|
||||
(Ecu.fwdRadar, 0x764, None): [
|
||||
b'K123-67XK2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
@@ -154,7 +172,6 @@ FW_VERSIONS = {
|
||||
b'K131-67XK2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'TK80-67XK2-E\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'TK80-67XK2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'K131-67XK2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', # CX-8
|
||||
],
|
||||
(Ecu.abs, 0x760, None): [
|
||||
b'TA0B-437K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
@@ -162,7 +179,6 @@ FW_VERSIONS = {
|
||||
b'TK79-437K2-F\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'TM53-437K2-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'TN40-437K2-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'K632-437K2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', # CX-8
|
||||
],
|
||||
(Ecu.fwdCamera, 0x706, None): [
|
||||
b'B61L-67XK2-P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
@@ -170,7 +186,6 @@ FW_VERSIONS = {
|
||||
b'GSH7-67XK2-J\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'GSH7-67XK2-K\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'TK80-67XK2-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'GSH7-67XK2-T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', # CX-8
|
||||
],
|
||||
(Ecu.transmission, 0x7e1, None): [
|
||||
b'PXM4-21PS1-A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
@@ -182,7 +197,6 @@ FW_VERSIONS = {
|
||||
b'PYD6-21PS1-B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'PYFM-21PS1-C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'PYFM-21PS1-D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
|
||||
b'PYV8-21PS1-\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', # CX-8
|
||||
],
|
||||
},
|
||||
CAR.MAZDA_3: {
|
||||
|
||||
@@ -72,7 +72,6 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
ret.dashcamOnly = False
|
||||
|
||||
ret.steerActuatorDelay = 0.1
|
||||
ret.steerLimitTimer = 0.8
|
||||
|
||||
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
|
||||
@@ -80,8 +79,6 @@ class CarInterface(CarInterfaceBase):
|
||||
if candidate not in (CAR.MAZDA_CX5_2022, CAR.MAZDA_3_2019, CAR.MAZDA_CX_30, CAR.MAZDA_CX_50, CAR.MAZDA_3_2023, CAR.MAZDA_CX_30_2023):
|
||||
ret.minSteerSpeed = LKAS_LIMITS.DISABLE_SPEED * CV.KPH_TO_MS
|
||||
|
||||
ret.centerToFront = ret.wheelbase * 0.41
|
||||
|
||||
ret.enableBsm = True
|
||||
|
||||
if p.get_bool("ManualTransmission"):
|
||||
@@ -91,6 +88,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.transmissionType = structs.CarParams.TransmissionType.automatic
|
||||
|
||||
if candidate in GEN1:
|
||||
ret.steerActuatorDelay = 0.335
|
||||
ret.safetyConfigs[0].safetyParam |= MazdaSafetyFlags.GEN1.value
|
||||
if p.get_bool("TorqueInterceptorEnabled"): # Torque Interceptor Installed
|
||||
ret.flags |= MazdaSafetyFlags.TORQUE_INTERCEPTOR.value
|
||||
@@ -115,9 +113,8 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.flags |= MazdaSafetyFlags.NO_FSC.value
|
||||
ret.safetyConfigs[0].safetyParam |= MazdaSafetyFlags.NO_FSC.value
|
||||
|
||||
ret.steerActuatorDelay = 0.1
|
||||
|
||||
if candidate in GEN2:
|
||||
ret.steerActuatorDelay = 0.5
|
||||
ret.safetyConfigs[0].safetyParam |= MazdaSafetyFlags.GEN2.value
|
||||
ret.alphaLongitudinalAvailable = alpha_long
|
||||
ret.openpilotLongitudinalControl = True
|
||||
@@ -129,13 +126,15 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.longitudinalTuning.kiBP = [0., 35.]
|
||||
ret.longitudinalTuning.kiV = [0.1, 0.1]
|
||||
ret.startingState = True
|
||||
ret.steerActuatorDelay = 0.335
|
||||
ret.steerAtStandstill = True
|
||||
ret.enableBsm = False
|
||||
|
||||
if candidate in GEN3:
|
||||
ret.steerActuatorDelay = 0.5
|
||||
ret.safetyConfigs[0].safetyParam |= MazdaSafetyFlags.GEN3.value
|
||||
ret.alphaLongitudinalAvailable = False
|
||||
ret.openpilotLongitudinalControl = False
|
||||
if p.get_bool("ManualTransmission"):
|
||||
ret.flags |= MazdaSafetyFlags.MANUAL_TRANSMISSION.value
|
||||
ret.enableBsm = False
|
||||
return ret
|
||||
|
||||
@@ -82,22 +82,27 @@ class MazdaPlatformConfig(PlatformConfig):
|
||||
class CAR(Platforms):
|
||||
MAZDA_CX5 = MazdaPlatformConfig(
|
||||
[MazdaCarDocs("Mazda CX-5 2017-21")],
|
||||
MazdaCarSpecs(mass=3655 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.5),
|
||||
MazdaCarSpecs(mass=3655 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.5, centerToFrontRatio=0.41),
|
||||
flags=MazdaSafetyFlags.GEN1,
|
||||
)
|
||||
MAZDA_CX8 = MazdaPlatformConfig(
|
||||
[MazdaCarDocs("Mazda CX-8 2018-23")],
|
||||
MazdaCarSpecs(mass=4314 * CV.LB_TO_KG, wheelbase=2.930, steerRatio=15.5, centerToFrontRatio=0.41),
|
||||
flags=MazdaSafetyFlags.GEN1,
|
||||
)
|
||||
MAZDA_CX9 = MazdaPlatformConfig(
|
||||
[MazdaCarDocs("Mazda CX-9 2016-20")],
|
||||
MazdaCarSpecs(mass=4217 * CV.LB_TO_KG, wheelbase=3.1, steerRatio=17.6),
|
||||
MazdaCarSpecs(mass=4217 * CV.LB_TO_KG, wheelbase=3.1, steerRatio=17.6, centerToFrontRatio=0.41),
|
||||
flags=MazdaSafetyFlags.GEN1,
|
||||
)
|
||||
MAZDA_3 = MazdaPlatformConfig(
|
||||
[MazdaCarDocs("Mazda 3 2017-18")],
|
||||
MazdaCarSpecs(mass=2875 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=14.0),
|
||||
MazdaCarSpecs(mass=2875 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=14.0, centerToFrontRatio=0.41),
|
||||
flags=MazdaSafetyFlags.GEN1,
|
||||
)
|
||||
MAZDA_6 = MazdaPlatformConfig(
|
||||
[MazdaCarDocs("Mazda 6 2017-20")],
|
||||
MazdaCarSpecs(mass=3443 * CV.LB_TO_KG, wheelbase=2.83, steerRatio=15.5),
|
||||
MazdaCarSpecs(mass=3443 * CV.LB_TO_KG, wheelbase=2.83, steerRatio=15.5, centerToFrontRatio=0.41),
|
||||
flags=MazdaSafetyFlags.GEN1,
|
||||
)
|
||||
MAZDA_CX9_2021 = MazdaPlatformConfig(
|
||||
@@ -112,27 +117,27 @@ class CAR(Platforms):
|
||||
)
|
||||
MAZDA_3_2019 = MazdaPlatformConfig(
|
||||
[MazdaCarDocs("Mazda 3 2019-24")],
|
||||
MazdaCarSpecs(mass=3000 * CV.LB_TO_KG, wheelbase=2.725, steerRatio=18.8),
|
||||
MazdaCarSpecs(mass=3300 * CV.LB_TO_KG, wheelbase=2.725, steerRatio=15.59, centerToFrontRatio=0.38),
|
||||
flags=MazdaSafetyFlags.GEN2,
|
||||
)
|
||||
MAZDA_CX_30 = MazdaPlatformConfig(
|
||||
[MazdaCarDocs("Mazda CX-30 2019-24")],
|
||||
MazdaCarSpecs(mass=3375 * CV.LB_TO_KG, wheelbase=2.814, steerRatio=15.5),
|
||||
MazdaCarSpecs(mass=3375 * CV.LB_TO_KG, wheelbase=2.814, steerRatio=15.5, centerToFrontRatio=0.38),
|
||||
flags=MazdaSafetyFlags.GEN2,
|
||||
)
|
||||
MAZDA_CX_50 = MazdaPlatformConfig(
|
||||
[MazdaCarDocs("Mazda CX-50 2022-24")],
|
||||
MazdaCarSpecs(mass=3375 * CV.LB_TO_KG, wheelbase=2.814, steerRatio=15.5),
|
||||
MazdaCarSpecs(mass=3375 * CV.LB_TO_KG, wheelbase=2.814, steerRatio=15.5, centerToFrontRatio=0.41),
|
||||
flags=MazdaSafetyFlags.GEN2,
|
||||
)
|
||||
MAZDA_3_2023 = MazdaPlatformConfig(
|
||||
[MazdaCarDocs("Mazda 3 2024-26")],
|
||||
MazdaCarSpecs(mass=3000 * CV.LB_TO_KG, wheelbase=2.725, steerRatio=18.8),
|
||||
MazdaCarSpecs(mass=3300 * CV.LB_TO_KG, wheelbase=2.725, steerRatio=15.59, centerToFrontRatio=0.38),
|
||||
flags=MazdaSafetyFlags.GEN3,
|
||||
)
|
||||
MAZDA_CX_30_2023 = MazdaPlatformConfig(
|
||||
[MazdaCarDocs("Mazda CX-30 23-26")],
|
||||
MazdaCarSpecs(mass=3375 * CV.LB_TO_KG, wheelbase=2.814, steerRatio=15.5),
|
||||
MazdaCarSpecs(mass=3375 * CV.LB_TO_KG, wheelbase=2.814, steerRatio=15.5, centerToFrontRatio=0.38),
|
||||
flags=MazdaSafetyFlags.GEN3,
|
||||
)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]
|
||||
"MAZDA_3" = "MAZDA_CX9_2021"
|
||||
"MAZDA_6" = "MAZDA_CX9_2021"
|
||||
"MAZDA_CX5" = "MAZDA_CX9_2021"
|
||||
"MAZDA_CX8" = "MAZDA_CX9_2021"
|
||||
"MAZDA_CX5_2022" = "MAZDA_CX9_2021"
|
||||
"MAZDA_CX9" = "MAZDA_CX9_2021"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user