Skip to content

Rivian: Generation 2 Support#3227

Merged
elkoled merged 44 commits intocommaai:masterfrom
lukasloetkolben:rivian-gen-2
Mar 29, 2026
Merged

Rivian: Generation 2 Support#3227
elkoled merged 44 commits intocommaai:masterfrom
lukasloetkolben:rivian-gen-2

Conversation

@lukasloetkolben
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added car related to opendbc/car/ tesla rivian car safety vehicle-specific safety code labels Mar 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 25, 2026

Car behavior report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

✅ No changes detected

@lukasloetkolben lukasloetkolben marked this pull request as draft March 25, 2026 00:07
@sshane
Copy link
Copy Markdown
Contributor

sshane commented Mar 25, 2026

fault when above 90 degrees which we don't check
image

@lukasloetkolben
Copy link
Copy Markdown
Contributor Author

  • No fingerprinting possible via camera harness
  • No engage signal available (ACM_Status present, but not showing the ACC state)
  • Torque control does not work using the camera harness

@github-actions github-actions Bot removed the tesla label Mar 25, 2026
@lukasloetkolben
Copy link
Copy Markdown
Contributor Author

  • Stock ACC disengages when the driver unbuckles the seatbelt - Door locks prevent opening while driving; on standstill, stock ACC disengages when the door is opened

These stock behaviors make it safe to skip seatbelt / door status checks in carstate.

Comment thread opendbc/car/rivian/carstate.py Outdated
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()), []))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you using a generator?

@elkoled
Copy link
Copy Markdown
Contributor

elkoled commented Mar 26, 2026

  • We must set torque = 0 when steering >90° to not fault EPS
  • common_fault_avoidance to steer >90° works with hyundai values

@lukasloetkolben lukasloetkolben force-pushed the rivian-gen-2 branch 2 times, most recently from 81f1da2 to 42daa2d Compare March 27, 2026 23:58
lukasloetkolben and others added 4 commits March 27, 2026 17:08
Co-authored-by: elkoled <elkoled@gmail.com>
Co-authored-by: elkoled <elkoled@gmail.com>
Co-authored-by: elkoled <elkoled@gmail.com>
@github-actions github-actions Bot added car safety vehicle-specific safety code and removed car safety vehicle-specific safety code labels Mar 28, 2026
@github-actions github-actions Bot removed the car safety vehicle-specific safety code label Mar 28, 2026
@lukasloetkolben lukasloetkolben marked this pull request as ready for review March 28, 2026 03:43
Co-authored-by: elkoled <elkoled@gmail.com>
Comment thread opendbc/car/rivian/values.py Outdated
Comment on lines +56 to +57
RivianCarDocs("Rivian R1S 2025"),
RivianCarDocs("Rivian R1T 2025"),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know anything about 2026?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only had the chance to look at 2025 rivians

Comment thread opendbc/car/rivian/carstate.py Outdated
Comment thread opendbc/car/rivian/carstate.py Outdated
# 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to make rivian A/B @sshane

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Comment thread opendbc/car/rivian/fingerprints.py Outdated
(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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file is autogenerated, so this will be deleted. put comment somewhere in values

Comment thread opendbc/car/rivian/carstate.py Outdated
# 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@elkoled
Copy link
Copy Markdown
Contributor

elkoled commented Mar 29, 2026

Max lateral acceleration:

Route: c70d59e4150956fc/00000079--10534c389d

image image image

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]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also hard code flag in values as a separate platform if you want to keep them separate, up to you

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we test models years above 2025 now or no?

Copy link
Copy Markdown
Contributor Author

@lukasloetkolben lukasloetkolben Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026 is not in the VIN query, i haven't seen any 2026 VIN yet.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't mean we can't test for it

@elkoled elkoled merged commit c9f2ab3 into commaai:master Mar 29, 2026
12 checks passed
@lukasloetkolben lukasloetkolben deleted the rivian-gen-2 branch April 2, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

car related to opendbc/car/ rivian

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants