diff --git a/opendbc/car/tests/routes.py b/opendbc/car/tests/routes.py index 91f47ea7..e1d3200e 100644 --- a/opendbc/car/tests/routes.py +++ b/opendbc/car/tests/routes.py @@ -38,6 +38,7 @@ non_tested_cars = [ HYUNDAI.KIA_SELTOS_2023_NON_SCC, HYUNDAI.GENESIS_G70_2021_NON_SCC, HONDA.HONDA_CLARITY, + TOYOTA.TOYOTA_WILDLANDER, ] diff --git a/opendbc/car/torque_data/substitute.toml b/opendbc/car/torque_data/substitute.toml index 07fd1215..b603eff6 100644 --- a/opendbc/car/torque_data/substitute.toml +++ b/opendbc/car/torque_data/substitute.toml @@ -97,3 +97,4 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "GENESIS_G70_2021_NON_SCC" = "HYUNDAI_SONATA" "HYUNDAI_BAYON_1ST_GEN_NON_SCC" = "HYUNDAI_SONATA" "HONDA_CLARITY" = "HONDA_CIVIC" +"TOYOTA_WILDLANDER" = "TOYOTA_RAV4_TSS2" diff --git a/opendbc/car/toyota/fingerprints.py b/opendbc/car/toyota/fingerprints.py index f320e40e..a5093dc7 100644 --- a/opendbc/car/toyota/fingerprints.py +++ b/opendbc/car/toyota/fingerprints.py @@ -2,6 +2,9 @@ from opendbc.car.structs import CarParams from opendbc.car.toyota.values import CAR +from opendbc.sunnypilot.car.fw_versions_ext import merge_fw_versions +from opendbc.sunnypilot.car.toyota.fingerprints_ext import FW_VERSIONS_EXT + Ecu = CarParams.Ecu FW_VERSIONS = { @@ -1859,3 +1862,5 @@ FW_VERSIONS = { ], }, } + +FW_VERSIONS = merge_fw_versions(FW_VERSIONS, FW_VERSIONS_EXT) diff --git a/opendbc/car/toyota/interface.py b/opendbc/car/toyota/interface.py index 7e38686b..6362efda 100644 --- a/opendbc/car/toyota/interface.py +++ b/opendbc/car/toyota/interface.py @@ -157,6 +157,14 @@ class CarInterface(CarInterfaceBase): if candidate in UNSUPPORTED_DSU_CAR: ret.safetyParam |= ToyotaSafetyFlagsSP.UNSUPPORTED_DSU + if candidate in (CAR.TOYOTA_WILDLANDER, ): + stock_cp.lateralTuning.init('pid') + stock_cp.lateralTuning.pid.kiBP = [0.0] + stock_cp.lateralTuning.pid.kpBP = [0.0] + stock_cp.lateralTuning.pid.kpV = [0.6] + stock_cp.lateralTuning.pid.kiV = [0.1] + stock_cp.lateralTuning.pid.kf = 0.00007818594 + return ret @staticmethod diff --git a/opendbc/car/toyota/values.py b/opendbc/car/toyota/values.py index fa6f96e7..63b3afed 100644 --- a/opendbc/car/toyota/values.py +++ b/opendbc/car/toyota/values.py @@ -396,6 +396,12 @@ class CAR(Platforms): flags=ToyotaFlags.UNSUPPORTED_DSU, ) + # port extensions + TOYOTA_WILDLANDER = ToyotaSecOCPlatformConfig( + [ToyotaCarDocs("Toyota Wildlander PHEV 2021", min_enable_speed=MIN_ACC_SPEED)], + CarSpecs(mass=4155. * CV.LB_TO_KG, wheelbase=2.69, steerRatio=16.88, tireStiffnessFactor=0.5533), + ) + # (addr, cars, bus, 1/freq*100, vl) STATIC_DSU_MSGS = [ diff --git a/opendbc/sunnypilot/car/car_list.json b/opendbc/sunnypilot/car/car_list.json index b070ba15..e37b8eb9 100644 --- a/opendbc/sunnypilot/car/car_list.json +++ b/opendbc/sunnypilot/car/car_list.json @@ -3585,6 +3585,16 @@ ], "package": "All" }, + "Toyota Wildlander PHEV 2021": { + "platform": "TOYOTA_WILDLANDER", + "make": "Toyota", + "brand": "toyota", + "model": "Wildlander PHEV", + "year": [ + "2021" + ], + "package": "All" + }, "Toyota Yaris (Non-US only) 2020, 2023": { "platform": "TOYOTA_YARIS", "make": "Toyota", diff --git a/opendbc/sunnypilot/car/toyota/fingerprints_ext.py b/opendbc/sunnypilot/car/toyota/fingerprints_ext.py new file mode 100644 index 00000000..1ea021af --- /dev/null +++ b/opendbc/sunnypilot/car/toyota/fingerprints_ext.py @@ -0,0 +1,24 @@ +from opendbc.car.structs import CarParams +from opendbc.car.toyota.values import CAR + +Ecu = CarParams.Ecu + +FW_VERSIONS_EXT = { + CAR.TOYOTA_WILDLANDER: { + (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', + ], + }, +}