feat(toyota): 添加 Toyota Wildlander PHEV 车型支持
新增 Toyota Wildlander PHEV 车型的指纹、参数配置和相关控制逻辑,包括: - 在 substitute.toml 中将其映射为 TOYOTA_RAV4_TSS2 以复用现有参数 - 增加车辆指纹识别信息 - 配置车辆规格参数(质量、轴距、转向比等) - 更新 carstate 和 interface 逻辑以适配该车型 - 添加对应的神经网络前馈模型文件 此外,临时注释了 controlsd.py 中的无 GPS 事件触发逻辑,待后续修复。
This commit is contained in:
parent
bb667214ca
commit
5e253a54ba
1
frogpilot/assets/nnff_models/TOYOTA_WILDLANDER_PHEV.json
Normal file
1
frogpilot/assets/nnff_models/TOYOTA_WILDLANDER_PHEV.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"input_std":[[9.668097],[1.5244726],[1.2700657],[0.03216253],[1.6078212],[1.5848233],[1.5577372],[1.3927742],[1.2935301],[1.1931615],[1.1020583],[0.032136116],[0.03217024],[0.032196537],[0.03225218],[0.032214258],[0.032031752],[0.03179372]],"model_test_loss":0.018995385617017746,"input_size":18,"current_date_and_time":"2025-05-15_14-47-45","input_mean":[[18.09652],[-0.017798662],[0.027145168],[-0.0054331655],[-0.025215305],[-0.022640774],[-0.019500963],[-0.010056124],[-0.0057649272],[0.001960505],[0.0020118994],[-0.005499858],[-0.005477372],[-0.005444631],[-0.0053683305],[-0.005257134],[-0.005035867],[-0.0050971555]],"input_vars":["v_ego","lateral_accel","lateral_jerk","roll","lateral_accel_m03","lateral_accel_m02","lateral_accel_m01","lateral_accel_p03","lateral_accel_p06","lateral_accel_p10","lateral_accel_p15","roll_m03","roll_m02","roll_m01","roll_p03","roll_p06","roll_p10","roll_p15"],"output_size":1,"layers":[{"dense_1_b":[[-0.016405884],[1.4187009],[-0.30671495],[-1.4047697],[-0.20383339],[-0.3632745],[-0.028944347]],"dense_1_W":[[0.13070685,-0.6662394,-1.0739188,-0.41523784,0.019285621,-0.5666617,0.02941118,0.2413377,0.11430891,-0.15557496,-0.36541316,0.44118378,0.038414165,0.117383294,-0.026998837,-0.3802126,-0.23443018,0.43427357],[0.5493235,0.7341044,0.30259728,-0.09170222,-0.066015296,0.41798133,-0.062179696,-0.1925674,-0.15322368,0.017662844,0.21162434,-0.12112619,-0.027021965,0.05653779,0.14749303,0.28017008,-0.15880422,-0.07834965],[1.3052936,-0.038109165,1.2192534,-0.18676366,0.21888737,0.45998427,0.94506985,-0.87686205,0.044812016,-0.07512292,0.69492793,-0.59623814,0.3278255,0.39913544,0.15354112,0.04995451,-0.031020898,-0.10582342],[-0.4683151,1.0002598,0.29120648,-0.05860625,0.010191997,0.17896307,-0.3321235,0.19332078,-0.44497126,0.09236495,0.17685813,0.022076255,-0.23972619,0.11622197,0.11574386,0.1640551,0.028836682,-0.14775941],[1.2240227,0.5504716,-1.161672,0.10151114,-0.6311718,-0.4365897,-0.63896364,0.4033335,0.012773022,0.025944846,-0.62420815,0.05751297,0.043608528,-0.13193272,-0.33345297,0.18925929,0.0925279,-0.03600548],[-0.0033800902,-0.41361037,-8.50345,0.27523437,2.0881453,2.3587928,2.1091182,-2.467406,-1.9167688,-0.8961217,-0.22510983,0.037862107,-0.23643681,0.03247474,0.067485854,0.04660773,-0.2583531,0.077512406],[0.0035197088,-0.43985325,0.07051937,0.38219255,-0.67769414,-0.29911998,1.0818627,-0.6217103,-0.5443828,0.22882973,0.013560748,-0.29820752,0.11540977,-0.40309906,-0.00034299958,0.69976795,0.13301164,-0.32934943]],"activation":"σ"},{"dense_2_W":[[-0.014842439,-0.3306524,0.254514,-0.6639507,-0.534733,0.07840164,0.2324318],[-0.15334646,-0.290343,-1.047474,0.41780674,0.04612693,-0.73001504,-0.3465528],[-0.6260714,-0.5115335,-0.71161246,0.4046027,-1.2324069,-1.2851475,-0.16620061],[-0.05566019,0.48536706,-0.42460826,0.83332616,0.47045597,-0.061004266,-1.1440438],[0.42156544,-0.6722497,-0.10824958,-0.32994938,0.31952205,-0.46266714,-0.07230821],[-0.38416666,-0.7271572,-0.39645803,-0.4259647,-0.24740903,-0.17667961,-0.10970643],[0.19652602,0.026280575,-0.1651507,-0.38475782,-0.5457258,-0.1882665,0.82107437],[-0.08976335,0.35238677,0.25231764,0.004611504,-0.5936927,-0.29342756,-0.22477138],[0.25490662,-0.4851788,-0.07538396,-0.36808714,-0.05157315,-0.2439695,0.9720866],[0.48479185,-0.68759876,0.42557424,-0.56957704,-0.32759178,-0.3047872,0.7597776],[0.4211342,-1.4932247,-0.66635305,-0.10591562,-0.9298172,1.04872,0.32208702],[-0.2918295,0.63893354,0.044817235,0.87641054,0.38387123,-0.48429132,-0.8803729],[-0.60936576,-0.29061803,-0.94329685,0.6586833,0.15280105,-0.8124564,-0.538523]],"activation":"σ","dense_2_b":[[-0.009386154],[-0.25074136],[0.02986496],[-0.028872054],[-0.06481484],[-0.2976481],[-0.072934344],[-0.117011935],[0.028236326],[-0.009000545],[-0.42297846],[0.030614687],[-0.105583444]]},{"dense_3_W":[[-0.035136532,-0.27008098,-0.5048698,-0.5295355,0.29823285,0.5058221,-0.09186966,0.26433602,0.50751793,0.49806535,0.8154631,-0.5854975,-0.525581],[0.08374179,0.16962804,0.2263017,0.5973136,0.2815238,-0.0505521,0.26001385,0.36577544,-0.68805265,-0.8057493,-0.42594707,0.633128,0.08724391],[0.5107981,0.064214274,-0.061156582,-0.33331737,0.07700428,-0.40398338,0.3673148,-0.42669702,0.38095382,0.33056983,-0.3025643,-0.58125204,-0.3484819]],"activation":"identity","dense_3_b":[[0.01880667],[-0.04986152],[0.030190725]]},{"dense_4_W":[[-1.0120764,0.477425,-1.0690569]],"dense_4_b":[[-0.027314244]],"activation":"identity"}]}
|
||||||
@ -10,6 +10,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]
|
|||||||
"TOYOTA_ALPHARD_TSS2" = "TOYOTA_SIENNA"
|
"TOYOTA_ALPHARD_TSS2" = "TOYOTA_SIENNA"
|
||||||
"TOYOTA_PRIUS_V" = "TOYOTA_PRIUS"
|
"TOYOTA_PRIUS_V" = "TOYOTA_PRIUS"
|
||||||
"TOYOTA_RAV4_PRIME" = "TOYOTA_RAV4_TSS2"
|
"TOYOTA_RAV4_PRIME" = "TOYOTA_RAV4_TSS2"
|
||||||
|
"TOYOTA_WILDLANDER_PHEV" = "TOYOTA_RAV4_TSS2"
|
||||||
"TOYOTA_SIENNA_4TH_GEN" = "TOYOTA_RAV4_TSS2"
|
"TOYOTA_SIENNA_4TH_GEN" = "TOYOTA_RAV4_TSS2"
|
||||||
"LEXUS_IS" = "LEXUS_NX"
|
"LEXUS_IS" = "LEXUS_NX"
|
||||||
"LEXUS_CTH" = "LEXUS_NX"
|
"LEXUS_CTH" = "LEXUS_NX"
|
||||||
|
|||||||
@ -207,7 +207,7 @@ class CarState(CarStateBase):
|
|||||||
if self.CP.carFingerprint in (TSS2_CAR - RADAR_ACC_CAR) or (self.CP.flags & ToyotaFlags.SMART_DSU and not self.CP.flags & ToyotaFlags.RADAR_CAN_FILTER):
|
if self.CP.carFingerprint in (TSS2_CAR - RADAR_ACC_CAR) or (self.CP.flags & ToyotaFlags.SMART_DSU and not self.CP.flags & ToyotaFlags.RADAR_CAN_FILTER):
|
||||||
# distance button is wired to the ACC module (camera or radar)
|
# distance button is wired to the ACC module (camera or radar)
|
||||||
self.prev_distance_button = self.distance_button
|
self.prev_distance_button = self.distance_button
|
||||||
if self.CP.carFingerprint in (SECOC_CAR - RADAR_ACC_CAR):
|
if self.CP.carFingerprint in (SECOC_CAR - RADAR_ACC_CAR) and self.CP.carFingerprint not in [CAR.TOYOTA_WILDLANDER_PHEV]:
|
||||||
self.distance_button = cp.vl["PCM_CRUISE_4"]["DISTANCE"]
|
self.distance_button = cp.vl["PCM_CRUISE_4"]["DISTANCE"]
|
||||||
elif self.CP.carFingerprint in (TSS2_CAR - RADAR_ACC_CAR):
|
elif self.CP.carFingerprint in (TSS2_CAR - RADAR_ACC_CAR):
|
||||||
self.distance_button = cp_acc.vl["ACC_CONTROL"]["DISTANCE"]
|
self.distance_button = cp_acc.vl["ACC_CONTROL"]["DISTANCE"]
|
||||||
@ -277,7 +277,7 @@ class CarState(CarStateBase):
|
|||||||
("SECOC_SYNCHRONIZATION", 10),
|
("SECOC_SYNCHRONIZATION", 10),
|
||||||
("GAS_PEDAL", 42),
|
("GAS_PEDAL", 42),
|
||||||
]
|
]
|
||||||
if CP.carFingerprint not in RADAR_ACC_CAR:
|
if CP.carFingerprint not in RADAR_ACC_CAR and CP.carFingerprint not in [CAR.TOYOTA_WILDLANDER_PHEV]:
|
||||||
messages.append(("PCM_CRUISE_4", 1))
|
messages.append(("PCM_CRUISE_4", 1))
|
||||||
else:
|
else:
|
||||||
messages.append(("VSC1S07", 20))
|
messages.append(("VSC1S07", 20))
|
||||||
|
|||||||
@ -1047,6 +1047,29 @@ FW_VERSIONS = {
|
|||||||
b'\x028646F4210100\x00\x00\x00\x008646G3305000\x00\x00\x00\x00',
|
b'\x028646F4210100\x00\x00\x00\x008646G3305000\x00\x00\x00\x00',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
CAR.TOYOTA_WILDLANDER_PHEV: {
|
||||||
|
(Ecu.engine, 0x700, None): [
|
||||||
|
b'\x01896630R57001\x00\x00\x00\x00',
|
||||||
|
],
|
||||||
|
(Ecu.abs, 0x7b0, None): [
|
||||||
|
b'\x01F152642C4000\x00\x00\x00\x00',
|
||||||
|
],
|
||||||
|
(Ecu.eps, 0x7a1, None): [
|
||||||
|
b'\x018965B4221000\x00\x00\x00\x00',
|
||||||
|
],
|
||||||
|
(Ecu.fwdCamera, 0x750, 0x6d): [
|
||||||
|
b'\x028646F0R01000\x00\x00\x00\x008646G4202000\x00\x00\x00\x00',
|
||||||
|
],
|
||||||
|
(Ecu.fwdRadar, 0x750, 0xf): [
|
||||||
|
b'\x018821F3301400\x00\x00\x00\x00',
|
||||||
|
],
|
||||||
|
(Ecu.srs, 0x780, None): [
|
||||||
|
b'\x018917F0R18000\x00\x00\x00\x00'
|
||||||
|
],
|
||||||
|
(Ecu.hybrid, 0x7d2, None): [
|
||||||
|
b'\x02899830R24000\x00\x00\x00\x00899850R05000\x00\x00\x00\x00'
|
||||||
|
],
|
||||||
|
},
|
||||||
CAR.TOYOTA_RAV4_TSS2: {
|
CAR.TOYOTA_RAV4_TSS2: {
|
||||||
(Ecu.engine, 0x700, None): [
|
(Ecu.engine, 0x700, None): [
|
||||||
b'\x01896630R58000\x00\x00\x00\x00',
|
b'\x01896630R58000\x00\x00\x00\x00',
|
||||||
|
|||||||
@ -73,7 +73,7 @@ class CarInterface(CarInterfaceBase):
|
|||||||
elif candidate in (CAR.LEXUS_RX, CAR.LEXUS_RX_TSS2):
|
elif candidate in (CAR.LEXUS_RX, CAR.LEXUS_RX_TSS2):
|
||||||
ret.wheelSpeedFactor = 1.035
|
ret.wheelSpeedFactor = 1.035
|
||||||
|
|
||||||
elif candidate in (CAR.TOYOTA_RAV4_TSS2, CAR.TOYOTA_RAV4_TSS2_2022, CAR.TOYOTA_RAV4_TSS2_2023, CAR.TOYOTA_RAV4_PRIME, CAR.TOYOTA_SIENNA_4TH_GEN):
|
elif candidate in (CAR.TOYOTA_RAV4_TSS2, CAR.TOYOTA_RAV4_TSS2_2022, CAR.TOYOTA_RAV4_TSS2_2023, CAR.TOYOTA_RAV4_PRIME, CAR.TOYOTA_SIENNA_4TH_GEN, CAR.TOYOTA_WILDLANDER_PHEV):
|
||||||
ret.lateralTuning.init('pid')
|
ret.lateralTuning.init('pid')
|
||||||
ret.lateralTuning.pid.kiBP = [0.0]
|
ret.lateralTuning.pid.kiBP = [0.0]
|
||||||
ret.lateralTuning.pid.kpBP = [0.0]
|
ret.lateralTuning.pid.kpBP = [0.0]
|
||||||
|
|||||||
@ -271,6 +271,10 @@ class CAR(Platforms):
|
|||||||
[ToyotaCarDocs("Toyota RAV4 Prime 2021-23", min_enable_speed=MIN_ACC_SPEED)],
|
[ToyotaCarDocs("Toyota RAV4 Prime 2021-23", min_enable_speed=MIN_ACC_SPEED)],
|
||||||
CarSpecs(mass=4372. * CV.LB_TO_KG, wheelbase=2.68, steerRatio=16.88, tireStiffnessFactor=0.5533),
|
CarSpecs(mass=4372. * CV.LB_TO_KG, wheelbase=2.68, steerRatio=16.88, tireStiffnessFactor=0.5533),
|
||||||
)
|
)
|
||||||
|
TOYOTA_WILDLANDER_PHEV = ToyotaSecOCPlatformConfig(
|
||||||
|
[ToyotaCarDocs("Toyota Wildlander PHEV 2021-23", min_enable_speed=MIN_ACC_SPEED)],
|
||||||
|
CarSpecs(mass=4155. * CV.LB_TO_KG, wheelbase=2.69, steerRatio=16.88, tireStiffnessFactor=0.5533),
|
||||||
|
)
|
||||||
TOYOTA_YARIS = ToyotaSecOCPlatformConfig(
|
TOYOTA_YARIS = ToyotaSecOCPlatformConfig(
|
||||||
[ToyotaCarDocs("Toyota Yaris (Non-US only) 2020, 2023", min_enable_speed=MIN_ACC_SPEED)],
|
[ToyotaCarDocs("Toyota Yaris (Non-US only) 2020, 2023", min_enable_speed=MIN_ACC_SPEED)],
|
||||||
CarSpecs(mass=1170, wheelbase=2.55, steerRatio=14.80, tireStiffnessFactor=0.5533),
|
CarSpecs(mass=1170, wheelbase=2.55, steerRatio=14.80, tireStiffnessFactor=0.5533),
|
||||||
|
|||||||
@ -435,7 +435,8 @@ class Controls:
|
|||||||
if not SIMULATION or REPLAY:
|
if not SIMULATION or REPLAY:
|
||||||
# Not show in first 1 km to allow for driving out of garage. This event shows after 5 minutes
|
# Not show in first 1 km to allow for driving out of garage. This event shows after 5 minutes
|
||||||
if not self.sm['liveLocationKalman'].gpsOK and self.sm['liveLocationKalman'].inputsOK and (self.distance_traveled > 1500):
|
if not self.sm['liveLocationKalman'].gpsOK and self.sm['liveLocationKalman'].inputsOK and (self.distance_traveled > 1500):
|
||||||
self.events.add(EventName.noGps)
|
# self.events.add(EventName.noGps)
|
||||||
|
pass
|
||||||
if self.sm['liveLocationKalman'].gpsOK:
|
if self.sm['liveLocationKalman'].gpsOK:
|
||||||
self.distance_traveled = 0
|
self.distance_traveled = 0
|
||||||
self.distance_traveled += CS.vEgo * DT_CTRL
|
self.distance_traveled += CS.vEgo * DT_CTRL
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -28,9 +28,9 @@ def dmonitoringd_thread():
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
valid = sm.all_checks()
|
valid = sm.all_checks()
|
||||||
if valid:
|
if DM.always_on and valid:
|
||||||
DM.run_step(sm)
|
DM.run_step(sm)
|
||||||
elif driver_view_enabled:
|
elif DM.always_on and driver_view_enabled:
|
||||||
DM.face_detected = sm['driverStateV2'].leftDriverData.faceProb > DM.settings._FACE_THRESHOLD or sm['driverStateV2'].rightDriverData.faceProb > DM.settings._FACE_THRESHOLD
|
DM.face_detected = sm['driverStateV2'].leftDriverData.faceProb > DM.settings._FACE_THRESHOLD or sm['driverStateV2'].rightDriverData.faceProb > DM.settings._FACE_THRESHOLD
|
||||||
|
|
||||||
# publish
|
# publish
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user