Rivian: Generation 2 Support#3227
Conversation
Car behavior reportReplays driving segments through this PR and compares the behavior to master. ✅ No changes detected |
This reverts commit 58c8f23.
|
cfacbcd to
7233836
Compare
These stock behaviors make it safe to skip seatbelt / door status checks in carstate. |
| self.sccm_wheel_touch = copy.copy(cp.vl["SCCM_WheelTouch"]) if self.CP.carFingerprint == CAR.RIVIAN_R1_GEN1 else None | ||
| vl_all = cp.vl_all["VDM_AdasSts"] | ||
| self.vdm_adas_status = [{s: vals[i] for s, vals in vl_all.items()} for i in range(len(next(iter(vl_all.values()))))] | ||
| num_frames = len(next(iter(vl_all.values()), [])) |
There was a problem hiding this comment.
Why are you using a generator?
|
81f1da2 to
42daa2d
Compare
8d94f21 to
8f55cd9
Compare
ed4ace0 to
637991a
Compare
Co-authored-by: elkoled <elkoled@gmail.com>
Co-authored-by: elkoled <elkoled@gmail.com>
Co-authored-by: elkoled <elkoled@gmail.com>
e5a90b0 to
e3a0c5a
Compare
Co-authored-by: elkoled <elkoled@gmail.com>
| RivianCarDocs("Rivian R1S 2025"), | ||
| RivianCarDocs("Rivian R1T 2025"), |
There was a problem hiding this comment.
do we know anything about 2026?
There was a problem hiding this comment.
I only had the chance to look at 2025 rivians
| # Seatbelt | ||
| ret.seatbeltUnlatched = cp.vl["RCM_Status"]["RCM_Status_IND_WARN_BELT_DRIVER"] != 0 | ||
| # stock ACC disengages when the driver unbuckles the seatbelt | ||
| ret.seatbeltUnlatched = cp.vl["RCM_Status"]["RCM_Status_IND_WARN_BELT_DRIVER"] != 0 if self.CP.carFingerprint == CAR.RIVIAN_R1_GEN1 else False |
There was a problem hiding this comment.
recommend rearranging all the "if GEN1" stuff into a single if block. it'll be much more clear what the difference is between GEN1 and GEN2, as opposed to these inline ifs
There was a problem hiding this comment.
I also like setting a GEN2 flag in interface/values and just using that instead of fingerprints. If Rivian comes out with new model type that works with GEN2, you don't need to update this check everywhere
| @dataclass | ||
| class RivianCarDocs(CarDocs): | ||
| package: str = "All" | ||
| car_parts: CarParts = field(default_factory=CarParts.common([CarHarness.rivian])) |
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
| (Ecu.eps, 0x733, None): [ | ||
| b'R1TS_v3.4.1(51),3.4.1\x00', | ||
| b'R1TS_v4.4.1(63),4.4.1\x00', | ||
| # b'R1TS_v4.4.1(63),4.4.1\x00', # shared with GEN2, use VIN matching instead |
There was a problem hiding this comment.
this file is autogenerated, so this will be deleted. put comment somewhere in values
| # Seatbelt | ||
| ret.seatbeltUnlatched = cp.vl["RCM_Status"]["RCM_Status_IND_WARN_BELT_DRIVER"] != 0 | ||
| # stock ACC disengages when the driver unbuckles the seatbelt | ||
| ret.seatbeltUnlatched = cp.vl["RCM_Status"]["RCM_Status_IND_WARN_BELT_DRIVER"] != 0 if self.CP.carFingerprint == CAR.RIVIAN_R1_GEN1 else False |
There was a problem hiding this comment.
I also like setting a GEN2 flag in interface/values and just using that instead of fingerprints. If Rivian comes out with new model type that works with GEN2, you don't need to update this check everywhere
| ret.safetyConfigs = [get_safety_config(structs.CarParams.SafetyModel.rivian)] | ||
|
|
||
| # GEN2 (2025+) doesn't have SCCM_WheelTouch on the bus | ||
| if 0x321 not in fingerprint[0]: |
There was a problem hiding this comment.
You can also hard code flag in values as a separate platform if you want to keep them separate, up to you
There was a problem hiding this comment.
i think the FLAG is fine.
|
|
||
| matches = FW_QUERY_CONFIG.match_fw_to_car_fuzzy({}, vin, FW_VERSIONS) | ||
| should_match = year != ModelYear.S_2025 and not bad | ||
| should_match = year in platform.config.years and not bad |
There was a problem hiding this comment.
Do we test models years above 2025 now or no?
There was a problem hiding this comment.
2026 is not in the VIN query, i haven't seen any 2026 VIN yet.
There was a problem hiding this comment.
Doesn't mean we can't test for it




No description provided.