A personal sunnypilot-based openpilot fork for the Rivian R1T & R1S. It combines:
- xnor-tech
rx-dev: angle-based lateral control through the angle harness, plus low-speed oscillation smoothing. - AdventurePilot
stg-agear-stalk MADS semantics: an upward stalk flick toggles or disengages lateral control, and lateral control disengages in Park and Reverse. Includes the matching panda safety support.
Warning
This is alpha-quality research software, not a product. It modifies lateral control and panda safety firmware. You are responsible for complying with local laws and for driving attentively at all times. No warranty, expressed or implied.
| Area | State |
|---|---|
| Base | xnor-tech/openpilot rx-dev prebuilt 8a627abb0 |
| Fork infrastructure (docs, commit conventions, CI) | ✅ |
| Gear-stalk MADS parity (panda safety + Python) | ✅ |
| Custom Outrun Screensaver (optimized for Comma 4) | ✅ |
GaryPilot Longitudinal Control (hardware-gated on 0x131a) |
✅ |
| Rivian Vehicle Tab (Diagnostics & Customization) | ✅ |
| Safety Gate (MISRA C:2012, 100% Coverage, Mutation Testing) | ✅ |
| Releases | Released! See FORK_CHANGELOG.md |
The table below summarizes GaryPilot's integration with the Rivian R1 platform, detailing system behavior, driver interaction, safety thresholds, and direct source code references:
| Integration Area & Driver Question | System Behavior & Driver Experience | Safety Limits & Thresholds | Source Code Reference |
|---|---|---|---|
|
Regen vs. Friction Braking Does the system use one-pedal regen or physical brake pads? |
Emulates Rivian Autonomous Control Module (ACM). Sends unified acceleration request 0x160 (ACM_longitudinalRequest) to Rivian's VDM (Vehicle Dynamics Module). VDM commands 100% regenerative braking via drive units first; blends Bosch ESP friction brakes only during heavy braking, cold/full battery, or standstill hold. Brake lights automatically trigger over |
Panda Safety Limits: Max accel: Min accel: Factory AEB ( ACM_AebRequest) immediately overrides openpilot. |
carcontroller.pyriviancan.pyrivian_primary_actuator.dbcrivian.h
|
|
Follow Distance Control Does follow distance adjust via the Rivian steering wheel? |
Scrolling the right steering wheel thumbwheel (RightButton_Scroll) emits gapAdjustCruise to cycle openpilot's LongitudinalPersonality via decrement: Standard (1) |
Software debounced against rapid misfires. Default initial personality is Standard (1). |
carstate_ext.pyselfdrived.py
|
|
ACC Set Speed Adjustments How are cruise speed steps commanded on the steering wheel? |
Single click Left/Right on the right thumbpad steps set speed by |
Cruise speed strictly clamped to |
carstate_ext.pyrivian.py
|
|
Native Radar & Sensor Fusion Does openpilot blend Rivian native radar readings for ACC? |
Reads 32 object tracking channels (RADAR_TRACK_500 through 51f) from Rivian's front millimeter-wave radar on Bus.radar. Filters stationary road clutter (guardrails) and fuses radar distance/velocity with vision model leads in radard.py for all-weather lead tracking. |
Lead Kalman filter tracks distance (dRel) and closing rate (vRel). Vision model vetoes false positives from overhead bridges. |
interface.pyradar_interface.pyradard.py
|
|
Blind Spot Detection (BSM) Are native Rivian blind spot sensors used for lane changes? |
Ingests corner radar status (BSM_BlindSpotIndicator_Fwd / 0x1350). When AutoLaneChangeBsmDelay is active, automated lane changes pause and wait while adjacent vehicles are detected until clear. Screen borders glow amber/red to mirror side mirrors. |
Prevents lane change initiation if leftBlindspot or rightBlindspot is true. Inhibits low-speed turn assist into occupied paths. |
carstate_ext.pydesire_helper.pyblind_spot_indicators.py
|
|
Dynamic Experimental Control (DEC) How does DEC stop at red lights and avoid jerky hesitation? |
Dynamically switches between ACC (speed-holding) and Blended (stopping for lights/signs). Employs 4 internal SmoothKalmanFilter instances (Lead, Slow Down, Slowness, MPC FCW) to filter trajectory endpoint shortages and eliminate mode flapping. |
Hysteresis thresholds require minimum mode duration (10 frames) unless emergency FCW triggers immediate override. |
dec.py (#L145-L172, #L242-L304) |
|
Stop Signs & Traffic Lights Does GaryPilot brake automatically for stop signs and red lights? |
When Dynamic Experimental Control (DEC) or Experimental Mode is active, the vision model predicts stopping trajectories for detected stop lines, signs, and traffic signals. Stopping behavior is probabilistic based on model confidence, lighting, and approach distance. Because there are no hard CAN failsafes for stop signs, the driver must always actively supervise intersections and be prepared to brake manually. | Factory Bosch ESP AEB remains active as an emergency safety net. Turning off Disengage on Accelerator allows the driver to override and accelerate through intersections without dropping cruise engagement. |
dec.pylongitudinal_planner.pymodeld.py
|
|
Accelerator Override & Resumption What happens when pressing the gas pedal while engaged? |
Pressing the accelerator allows the driver to manually override openpilot speed commands. When Disengage on Accelerator is turned OFF, releasing the accelerator returns the vehicle smoothly to the set speed without cancelling cruise or dropping MADS lateral steering. When turned ON, pressing the accelerator disengages cruise control. | Acceleration is strictly controlled by driver foot; openpilot resumes command only once driver lifts off below or at target set speed. |
carcontroller.pyselfdrived.pycontrols.yaml
|
|
Driving Model (WMI V12) Can WMI V12 run on Comma 4 with these features? |
Fully supported under tinygrad runner. Runs at native 20Hz (is20hz: true) with Generation 12 world model dynamics. Emits standard 33-point trajectory consumed identically by DEC and Vision Turn Speed. |
Hardware load on Comma 4 NPU remains under 60% with zero dropped frames. |
split_model_constants.pymodeld.py
|
|
Smart Cruise & Curve Slowdown How do vision and map-based turn speeds operate? |
Vision curve slowdown uses path predictions from the driving model; Map curve slowdown queries local OpenStreetMap geometry (OsmLocal) to preemptively brake before tight highway ramps or sharp turns. Slowdown sensitivity and target speed margins are adjustable in settings. |
Blended smoothly through longitudinal planner acceleration limits. Speeds offset by configurable margin (+5 mph). |
settings_ui.jsoncruise.yaml
|
|
Stalk Gestures & MADS State How do gear stalk controls manage lateral and longitudinal? |
UP_1: Configurable via Settings UP_2: Full disengage of lateral and longitudinal. Park: Disengages controls and triggers immediate Offroad mode. Reverse: Disengages lateral control. |
UP_2 MADS button press is inhibited in panda safety; full disengage latching and Park/Reverse transitions are enforced in car_specific.py. No steering actuation permitted outside Drive. |
carstate_ext.pyrivian.hcar_specific.pyrivian.py
|
|
Steering Limits & Overrides What are the physical and panda safety limits for steering? |
Dual-channel control (angle commands + cooperative torque). Steering angle clamped to 500°. Torque limited to 350 counts ( |
Panda Safety Limits: Max rate up: 3 / frame Max rate down: 5 / frame Max real-time delta: 125 Driver torque allowance: 100 max |
rivian.hcarstate.pyext_controller.pyvalues.pyrivian.py
|
|
Hardware & Harness Diagnostics How do I verify the angle harness and longitudinal hardware? |
Dedicated Settings 0x1310), Longitudinal Upgrade / XNOR XTREME (0x131a), Platform Generation (0x321), Front Radar (32 Tracks), and Corner Radar BSM (0x1350). Emits summary telemetry via RivianHarnessStatus. |
Live updates run at 1Hz in UI; controls customization is disabled during active drives (not_engaged gate) for on-road safety. |
rivian.pycarstate_ext.pyvehicle.yaml
|
|
Configuration Architecture Where are settings managed, and are there conflicting toggles? |
Streamlined control under Toggles 0x131a on bus 1) with safety confirmation modal. Dedicated Settings |
Persistent parameters: AlphaLongitudinalEnabled (defaults to "0" / disabled; activates factory Rivian ACC). Hardware and control preferences stored via atomic VIRTUAL_PARAMS (RivianHarnessStatus, RivianStalkUp1Action, RivianSpeedClickStep, RivianSteerOverrideSensitivity). |
toggles.pyrivian.pytoggles.yamlvehicle.yamlparams.py
|
|
Automated Safety Gate & Invariants How are safety, code quality, and branch invariants verified? |
Every push and pull request runs automated CI: 100% Panda safety line coverage, 26 SunnyLink/Rivian unit tests, automotive static analysis with MISRA C:2012 (268 active checkers, 0 violations), and tree-sitter mutation testing (3,422 mutants evaluated, 99.91% killed). Prebuilt branch invariants strictly protect compiled binaries and param schemas. | Strict gate in fork-ci.yml. Conventional commit headers enforced up to 120 characters via .githooks/commit-msg. |
fork-ci.ymlsafety_tests.shcheck_invariants.shtest_misra.shmutation.py
|
|
Updates & Remote Management Does Comma 4 auto-update, and can it be rebooted remotely? |
Devices automatically pull updates from branch GaryPilot when parked/offroad on Wi-Fi. Can be rebooted remotely via SSH (sudo reboot), web dashboard, or on-device UI. |
SSH disabled by default for vehicle security (SshEnabled: false). Updates stage safely before prompting reboot. |
updated.pyhardwared.py
|
Supported hardware: comma 3X and comma four, in a Rivian R1T/R1S with the angle harness.
-
On the device: Settings → Software → Uninstall (uninstalls driving software; does not factory-reset AGNOS or Wi-Fi).
-
The device reboots into the setup screen. Choose Custom Software and enter either:
- Full URL:
https://installer.comma.ai/caleb-collar/GaryPilot - Shorthand:
caleb-collar/GaryPilot
[!IMPORTANT] The branch name
GaryPilotis case-sensitive in git. Ensure bothGandPare capitalized. - Full URL:
-
On first boot the panda is reflashed with this branch's firmware automatically.
If your Comma was already running a previous branch or another fork pointing to caleb-collar/openpilot:
- Via On-Device UI (Fastest):
- Open Settings → Software → Select a branch.
- Select
GaryPilot. - Tap Check for Updates (or wait for the download to finish).
- Tap Reboot when prompted.
- Via SSH:
ssh comma@<device-ip> cd /data/openpilot git remote set-url origin https://github.com/caleb-collar/openpilot.git git fetch origin GaryPilot git checkout -B GaryPilot origin/GaryPilot git submodule sync git submodule update --init --recursive touch prebuilt sudo rm -rf /data/safe_staging/* sudo reboot
Rollback: repeat the steps with xnor-tech/rx-dev (https://installer.comma.ai/xnor-tech/rx-dev). The panda firmware is restored automatically.
Important
Installed devices auto-update from GaryPilot. Only verified changes are promoted to that branch.
This branch is rooted on xnor's prebuilt rx-dev tree. Libraries are vendored rather than submodules
(opendbc_repo/, panda/, msgq_repo/, …), and compiled aarch64 binaries are committed so the device skips the build.
| Remote | Repository | Purpose |
|---|---|---|
origin |
caleb-collar/openpilot |
This fork |
upstream |
xnor-tech/openpilot |
Base (rx-dev). Push disabled |
adventure |
AdventurePilotDev/openpilot |
Feature reference (stg-a). Push disabled |
Key Rivian code:
opendbc_repo/opendbc/car/rivian/: car state, controller, xnor angle smoothing (ext_controller.py)opendbc_repo/opendbc/sunnypilot/car/rivian/: stalk parsing, MADS car controlleropendbc_repo/opendbc/safety/modes/rivian.h: panda safety modeopenpilot/sunnypilot/selfdrive/car/car_specific.py,openpilot/sunnypilot/mads/: MADS event handling
git config core.hooksPath .githooks # Conventional Commits hook- Commits: Conventional Commits, enforced locally and in CI. See
CONTRIBUTING.md. - Checks:
fork/holds the sudo-free safety gate (tests, 100% coverage, MISRA, mutation), a reproducible panda firmware build and verify step, and the prebuilt-branch invariant checks. CI runs the same scripts. - Changelog: Keep a Changelog in
FORK_CHANGELOG.md. The rootCHANGELOG.mdis upstream sunnypilot's. The device parses it for release notes, so leave it untouched. - Plan, constraints, verification matrix, upstream resync workflow:
INTEGRATION_PLAN.md.
- comma.ai openpilot: the foundation
- sunnypilot: MADS and the fork this builds on
- xnor-tech: Rivian angle harness support and steering smoothing
- AdventurePilot: Rivian gear-stalk MADS design
- lukasloetkolben: original Rivian R1S/R1T port
By default, openpilot/sunnypilot uploads driving data to comma servers. You can access your data through comma connect. You are free to disable data collection.
openpilot logs the road-facing camera, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs. The driver-facing camera and microphone are only logged if you explicitly opt in in settings.
By using this software, you understand that use of this software or its related services will generate certain types of user data, which may be logged and stored at the sole discretion of comma. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma for the use of this data.
This fork is released under the MIT License, like sunnypilot and openpilot, from which it derives. The original openpilot license notice, including comma.ai's indemnification and alpha software disclaimer, is reproduced below as required:
openpilot is released under the MIT license. Some parts of the software are released under other licenses as specified.
Any user of this software shall indemnify and hold harmless Comma.ai, Inc. and its directors, officers, employees, agents, stockholders, affiliates, subcontractors and customers from and against all allegations, claims, actions, suits, demands, damages, liabilities, obligations, losses, settlements, judgments, costs and expenses (including without limitation attorneys' fees and costs) which arise out of, relate to or result from any use of this software by user.
THIS IS ALPHA QUALITY SOFTWARE FOR RESEARCH PURPOSES ONLY. THIS IS NOT A PRODUCT. YOU ARE RESPONSIBLE FOR COMPLYING WITH LOCAL LAWS AND REGULATIONS. NO WARRANTY EXPRESSED OR IMPLIED.
For full license terms, see the LICENSE and LICENSE.md files.
- Rivian®, R1T®, and R1S® are registered trademarks of their respective owners, RIVIAN AUTOMOTIVE, LLC and RIVIAN AUTOMOTIVE, INC.
- Rivian is a registered trademark of its respective owner. This project is independent and has no official affiliation with the manufacturer.
- No Endorsement or Affiliation: This project is an independent, community-driven open-source research fork. It is not affiliated with, endorsed by, sponsored by, or certified by Rivian Automotive, LLC, Rivian Automotive, Inc., or any of their affiliates.
- No License or Credit Taken: We do not claim any ownership, rights, or license to Rivian's trademarks, trade dress, or logos, nor do we take credit for or license Rivian's logo or intellectual property. Any references to Rivian vehicle makes or models are used strictly for vehicle identification, technical compatibility, and nominative fair use.
- Exclusion of Visual Assets: As stated in the
LICENSEandLICENSE.mdfiles, the MIT license applies solely to source code files. Visual assets and UI themes are excluded from this license.