Skip to content

Add core OP support for CRC validation, with extra support for Volkswagen MQB - #836

Merged
rbiasini merged 21 commits into
commaai:develfrom
jyoung8607:vw-064-crc-upstream
Oct 17, 2019
Merged

Add core OP support for CRC validation, with extra support for Volkswagen MQB#836
rbiasini merged 21 commits into
commaai:develfrom
jyoung8607:vw-064-crc-upstream

Conversation

@jyoung8607

@jyoung8607 jyoung8607 commented Oct 9, 2019

Copy link
Copy Markdown
Collaborator

Fourth of five PRs to upstream the Volkswagen, Audi, SEAT, and Škoda community port. This one reduces the size and scope of the final OP PR by giving you a look at the core CRC stuff separated from the traditional vehicle port.

This code teaches OP generally about the signal name "CRC", like it knows "CHECKSUM" today. It also teaches OP about the specific algorithm used by Volkswagen MQB, which is CRC-8/AUTOSAR with a twist. It enables OP to do CRC and counter validation on all Volkswagen MQB received messages it relies on, similar to Honda and Toyota, and to set the CRC on transmitted messages.

I wrote the overarching CRC signal stuff with extension to other vehicle ports in mind. It could see use for Pedal, Hyundai, Mazda, and Nissan at a minimum. The wrapper function init_crc_lookup_tables() exists for the purpose of adding other CRC lookup tables as needed. In the beginning I had them embedded as static lookup tables, but switched to computing them at startup on informal feedback from @rbiasini.

Note: this code requires the CRC signal be named exactly "CRC", just as CHECKSUM and COUNTER work today. OP would need some nontrivial refactoring to support magic signal names that vary by message. As such, our PR commaai/opendbc#191 changes those signal names to CRC and COUNTER respectively for select Volkswagen MQB messages we rely on. I do not like this and would much prefer to keep the signal names canonical, and am willing to talk more about it if you see a reasonable path to fix it.

csouers and others added 5 commits October 10, 2019 10:16
* Add 2018 Civic Hatchback 1.0l CVT support

test_fingerprints returns fine
3d90c78 Fix wrong event enum
f4c92cf add none/invalid usb power mode
12bc189 Add fields and states required for robust Volkswagen safety compliance (#8)
16b5850 let's spell wolkswagen
6243622 Safety cereal (#9)
5cf3c2c change order of UsbPowerMode to preserve panda lib behavior
18a2917 usbPowerMode is more useful to log and it comes from panda
1526784 add ldw to visual hud alerts (#5)
24f6fa7 merge commaai/msgq#3 after fixing conflicts
4d5862c added event about internet connection
ca070f9 Added usbPowerOn to health
e2eaa76 add HW type for UNO
e528a20 Read RPM from fan connected to Panda
8472175 Added invalidGiraffeToyota event
71be970 placeholders for mazda, nissan and vw safety models

git-subtree-dir: cereal
git-subtree-split: 3d90c78
30c7ca8 bump version to 1.5.3
9403dbe Need to fix wifi test before re-enabling.
0812362 GPS UART fix until boardd is refactored (commaai#294)
ffbdb87 python2 -> 3 fixes to pedal flasher (commaai#292)
78b75ef Added build type to release version strings
736c2cb Fixed sending of bytes over PandaSerial
0894b28 Fixed USB power mode on black (commaai#291)
4b3358c patch to be able to switch from EON to PC with a Panda that has EON b… (commaai#290)
a95c44a Made setting of NOOUTPUT on no heartbeat more efficient (commaai#287)
9486836 UART instability fix with high interrupt load (commaai#283)
9a9e9d4 Fix usb_power_mode missing initialization (commaai#289)
af0960a DFU fix (commaai#288)
70219d7 match safety enum in cereal (commaai#285)
a338d39 Fix build for jenkins test
78ef4a6 Stop charge (commaai#284)
5266a40 Fix typo (commaai#286)
f4787ec Revert "turn on CDP when ignition switches on (commaai#281)"
d37daee Revert "NONE and CLIENT should be the same thing in white/grey pandas"
e97b283 NONE and CLIENT should be the same thing in white/grey pandas
8c1df55 turn on CDP when ignition switches on (commaai#281)
847a35d Fix bullet points
fac0277 Misra update (commaai#280)
5a04df6 Added description of regression tests to README
c4aabae Fixed some python3 bugs in the test scripts and PandaSerial
9af0cb3 Bump version
c4ac3d6 Disable GPS load switching on black pandas
078ee58 This is the correct table, actually
578b95e Misra table of coverage added
d383a26 bump panda
b98ca01 fix sdk build in python3 env (commaai#279)
63d3dc7 Set python3 env before runnign get_sdk, so we know if it fails
e951d79 legacy code we don't control can remain python2
11b7151 Merge pull request commaai#276 from commaai/python3
9893a84 Merge pull request commaai#277 from zorrobyte/patch-1
d326869 Revert "revert back esptool to python2 and force to build esptools with python2"
875e760 revert back esptool to python2 and force to build esptools with python2
9c40e62 needed to install python3
ed2ac87 Also moved safety tests to python3
6842b2d move esptool sdk installation before python3 env is set. Kind of a cheat
b5a2cab this hopefully fixes build test
6280509 Fixes safety replay
2c220b6 this fixes language regr test
fdbe789 use python 3 in Docker container
ee1ae4f Better hash print
0de9ef7 Revert "Final 2to3 on the whole repo"
c92fd3b Final 2to3 on the whole repo
5f2bc44 better
b2a30fd make works!
b74005d fix sign.py
fe72770 read file as byte and no tab before sleep
32a344ef6 Update README.md
2dc3409 2to3 applied
ffa68ef undo unnecessary brackets for print
dbc2480 Fix all the prints with 2to3, some need to be undo
5a7aeba xrange is gone
982c4c9 one more python3 env
1e2412a env python -> env python3

git-subtree-dir: panda
git-subtree-split: 30c7ca8
f3b5735 move generator to python3
9efff40 2019+ New Prius Steer Angle (commaai#189)
f3461d1 add units and a couple new signals for toyota (commaai#188)
16033b3 Remove non ascii characters
de162d8 Toyota no dsu: fix steer angle factor, it's 1% of a rad
2fb5245 Lexus CT200H seems to have the safetyParam 1 instead of 0.73
b2fde8b toyota time signal (commaai#187)
6cfe0c4 Fixed brake signal unit in Bosch Honda

git-subtree-dir: opendbc
git-subtree-split: f3b5735
Comment thread selfdrive/can/process_dbc.py
@rbiasini

Copy link
Copy Markdown
Contributor

Nice. I would like to merge this in. 3 things:

As we discussed, I agree I don't like canonicalizing the dbc files. On the other hand, we can come back to this after we have a MVP VW port. Thanks!

@jyoung8607

jyoung8607 commented Oct 11, 2019

Copy link
Copy Markdown
Collaborator Author

Thanks for the review.

Per our DM discussion I will push a commit to rename things to CHECKSUM for now, and we'll follow up with support for the correct MSG_NAME_[CRC|BZ] scheme later. I already have the conflicts fixed, and I will look at adopting the start bit generalization from your comment.

It may be a few days until I can follow up, because my CAN bus implodes when I try to run 0.6.5 for reasons I have not yet identified, and I don't have cycles to hack on it further today.

@jyoung8607

Copy link
Copy Markdown
Collaborator Author

Nice. I would like to merge this in. 3 things:

Rename CRC with CHECKSUM so it's compatible with the dbc file we already merged in?

Done per our discussion.

there are some conflicts

The PR has been brought current with OP 0.6.5-devel.

see comment
...
What about defining both counter_start_bit and checksum_start_bit as well? Basically after this line there should be no reference to car_type, except for the call to template.render.

I've refactored parser_dbc.py to be cleaner, hopefully in the way you were thinking. We can't really verify exact start bits per se, because those messages move around for at least some cars. Honda seems to do this a lot. The existing code was really just checking alignment for the most part.

The refactor doesn't check it in precisely the same way (it will allow a Honda checksum to start on bit 7, or a Honda counter to start on any odd bit) but I trust it complies with the spirit of your request. There's really no other way to do this in a manufacturer-generic way.

The refactored code does the alignment check based on endianness, and along the way it checks the DBC for correctness. It found two issues in the 2016 Accord Touring DBC, and you'll notice the Travis build for this PR fails at that point. I've submitted commaai/opendbc#193 to fix it properly.

Comment thread selfdrive/can/process_dbc.py
@jyoung8607

jyoung8607 commented Oct 17, 2019

Copy link
Copy Markdown
Collaborator Author

Two final comments:

First, my 0.6.5 merge for conflict resolution seems to have added some new-in-0.6.5 files to the PR. My git-fu is not that strong and I'm not sure of the right way to pull them out, I wonder if deleting them might make things worse? Let me know if you can fix this, or if I should withdraw and resubmit the PR from a clean 0.6.5 fork.

Second, you'll notice some extra instrumentation to print the name of the DBC when a fault occurs. In the past, depending on when and why process_dbc.py ran, you might get no information at all about which DBC failed to process, or worse, something extremely misleading if there's more than one file with problems.

Here's an example of two files broken, Honda and VW. The make is triggered by the Honda DBC change, but the process_dbc failure is actually from the VW file:

bad-process-dbc-output

Example of a situation where you'd normally have no context at all, but the refactored code tells you what DBC it's working with now:

good-process-dbc-output

@rbiasini

rbiasini commented Oct 17, 2019

Copy link
Copy Markdown
Contributor

RE: added files: yeah, just delete them. You also want to add the opendbc changes to this PR (at least the accord fix), so tests won't fail.

Don't worry about how clean is the history of commits of the PR, I'll squash all your commits before merging. As long as the diffs are good and there are no conflicts reported, we are good.

And nice addition printing the dbc file that fails.

@jyoung8607

Copy link
Copy Markdown
Collaborator Author

RE: added files: yeah, just delete them.

Done.

You also want to add the opendbc changes to this PR (at least the accord fix),

Done.

so tests won't fail.

Looks good now.

Don't worry about how clean is the history of commits of the PR, I'll squash all your commits before merging.

Hulk squash!

As long as the diffs are good and there are no conflicts reported, we are good.

And nice addition printing the dbc file that fails.

Thank you for your support through this process!

Comment thread selfdrive/can/process_dbc.py Outdated
@rbiasini
rbiasini merged commit d953b6a into commaai:devel Oct 17, 2019
BogGyver referenced this pull request in BogGyver/openpilot Nov 12, 2019
* fix ALCA module

* Update ALCA_module.py

* Promote panda fixes from alpha to devel (#98)

* Fix for mock car crash

* fix ALCA module

* do not use

* radar_interface logic improvements

* remove radar logging

* radar_interface refactoring

* Log radar_interface CAN error, Process Comm Errors (#95)

* Log radar_interface CAN error

* Add support for process comm error logging

* Improve Process Comm error logging

* Can and CommError throttling

* Update radar_interface.py

* fixing push per Raf's comments

* ALCA and radar_interface work (#96) (#97)

* do not use

* radar_interface logic improvements

* remove radar logging

* radar_interface refactoring

* Update radar_interface.py

* fixing push per Raf's comments

* fix process comm issue

* switch radard from lane_parser to model

* radar/ALCA changes

* fix lane width

* switched back to not deleting CarParams to avoid radar failure when rebooting EON while driving

* cleanup some debug info to be able to restart ALCA research

* tweaks on safety_tesla.h for can bus isolation

* few more cleanups to safety_tesla.h

* fix start signal logic

* Increase LEXUS_IS safetyParam to 77 (#841)

* use list comprehension (#839)

* use list comprehension

* oops index range fix

* simplify encode/decode in dbc (#840)

* simplify encode/decode

* 2019 Highlander Hybrid Limited Platinum (#843)

fingerprint from ogdragonzypher on Discord

* Allow to lock safety mode to keep gm/tesla cars supported (#844)

* Force subaru to assume the stock camera is connected (#849)

* Revert to using the sum of the lane line probabilities instead of the the product

* Add core OP support for CRC validation, with extra support for Volkswagen MQB (#836)

* Generalized core OP CRC support plus extra bits for Volkswagen MQB.

* Update ref to process_replay regression test

* Remove unneded use of replace, causing json to fail loading the alert

* Add supported car for 2019 Toyota Altis Hybrid (#859)

* add supported car for 2019 Toyota Altis Hybird / Corolla hybrid 2020 (US market)

* remove unnecessary comprehensions (#863)

* Added fingerprint from Sienna XLE AWD (#848)

* Added fingerprint from Sienna XLE AWD

* Update driver_monitor.py

* Update driver_monitor.py

* Update driver_monitor.py

* fix stupid merge issue

* Adds 2019 Lexus ES (non hybrid) (#866)

* Adds 2019 Lexus ES (non hybrid)

* Updated test route

* merge issues

* Update README with now supported Subaru Harness

* Disable LDW for 4 seconds after blinker transition from on to off (#112)

If we want to change lanes with a blinker tap (3 blink mode), then we need to disable LDW for enough time to allow a smooth manual lane change. 4 seconds as it seems the freq is actually around 50Hz, not 100Hz.

* Disable HSO for 3 seconds after blinker has been active (#111)

Avoid HSO will deactivate and try to take the car back into the lane during a manual lane change with blinker tapped (3 blinks mode)

* params learner to only learn @ cons speed

Acceleration/deceleration in turns affect yaw as measured by phone and will create potential issues with learner. This code changes the learner to only adjust parameters when speed is constant

* Update to match new version of python in eons

* python 3 fixes for test client / server

* async/await server

* Don't log for action message as it's too often, and we throttle it internally.

* fix merge issue in thermald

* fixes and tweaks; code simplification

* Saving P,I,F parameters from pid controller (#116)

Added separate save/load functions, try catch - and saving the right constants to the params file.

* Feature/tinklad throttling + linting (#118)

* Throttle tinlkad's attemptToSendPendingMessages

* Remove get_git_remote from registration. It's defined in version already.

* tinklad linting

* tesla linting

* Prevent multiple readings of the pid params file (#119)

..only load the pid values when we initiate the LoC

* missing V_PID_FILE constant (#121)

* show cars in IC for non-radar users (#120)

* bug fixes

* Fix issue where user info was being dropped on no connectivity (#122)

* move pisParams, fix GPS logging

* Bugfix tinklad throttling (#124)

* ALCA4 (still in dev)

* ALCA4 tuning

* ALCA4 alpha release

* ALCA4 tweak for turns

* ACC fix; LDW mite during ALCA

* ALCA polishing

* fix enter_canloader.py for python 3

* should_ldw changes

moved the should_ldw code closer together and added status messages for when LDW is active and inactive

* thermald and ALCA

* ALCA sinplified logic
@MikhailTik55

Copy link
Copy Markdown

Hello,i make the correction table CRC DataIDList VW MQB.
Bus dumps Gateway_MQB Running (Bremse), Powertrain (Motor), Extended are required.
I will be grateful for any information.
CRC: ID 0x117 I got a correction of 0x16 in the 0xAC program.

@jyoung8607

jyoung8607 commented Jan 29, 2020

Copy link
Copy Markdown
Collaborator Author

@MikhailTik55 I don't quite understand what you're asking for.

To the extent I've solved the CRC pad byte for a given message, you can already find the solution in this PR. Each message requires a different solution; I have not found a general approach. I have not bothered to solve the pad byte for all messages, only the ones I needed.

I have some code that helps me with the per-message brute force process, but I'm not planning to publish it, because it's a write-only disaster full of cruft from when I was trying to find the overall algorithm, and would not be usable for anyone else.

If you have an openpilot related need to solve a certain message, I'm willing to do one or two on your behalf. If you need it for something else, or want a solution for every message, there's sufficient information in this PR to trivially write your own brute force tester.

Further questions would best be asked in #volkswagen on Comma's Discord.

@MikhailTik55

Copy link
Copy Markdown

Hello! Thank you for your interest to my message.
I adapt VAG assistants to CAN bus Runault.
The protocol of VAG MQB messages is similar to specification AUTOSAR CRC8H2F E2E Profile 2.
https://www.autosar.org/fileadmin/user_upload/standards/classic/4-3/AUTOSAR_SWS_E2ELibrary.pdf
Here’s an interesting file, have a look at it:
https://android.googlesource.com/kernel/msm/+/c1aabdf379bc2feeb0df7057ed5bad96f492133e/net/can/gw.com
In order to make right messages with correct CRC I need hex-dumps of tires Gateway MBQ, like:
GW MQB Extended
00000117 75 0C 00 40 68 00 00 FF C2 00 08
000003DC FF 01 00 00 00 01 00 00 CF 00 08
00000117 11 0D 00 40 68 00 00 FF D6 00 08
0000030C 71 FF 3F FF 63 30 00 00 D7 00 08
000003DB FF 03 00 00 80 00 00 FE E3 00 08
00000117 BD 0E 00 40 68 00 00 FF EA 00 08
00000324 37 0F 00 00 04 00 00 00 EB 00 08
000003DF FF 00 01 38 15 00 00 00 ED 00 08
00000117 D9 0F 00 40 68 00 00 FF FE 00 08

ghost pushed a commit to dragonpilot/dragonpilot that referenced this pull request Apr 7, 2020
…agen MQB (commaai#836)

* Generalized core OP CRC support plus extra bits for Volkswagen MQB.
@jyoung8607
jyoung8607 deleted the vw-064-crc-upstream branch July 24, 2020 08:40
debugged-tech pushed a commit to debugged-tech/DebuggedPilot that referenced this pull request Apr 28, 2021
wtogami pushed a commit to wtogami/openpilot that referenced this pull request Apr 20, 2025
* test

* prevent overflowing

* unused
wtogami added a commit to wtogami/openpilot that referenced this pull request May 2, 2025
* FCA: Ram 1500 improvements

* updating reference to my opendbc

* syncing latest opendbc

* move to car_specific_sp

* bump

* Realfast ram1500 (commaai#1)

* Bump tinygrad to upstream master (commaai#34973)

bump tg

* test_onroad: test liveParameters service timing (commaai#34977)

Add live params to test onroad

* selfdrived: remove ignored processes list (commaai#34978)

* selfdrived: remove ignored processes list

* it's a set

* calibrationd: read carParams from Params (commaai#34981)

* Read CarParams once from Params

* Remove it from process replay

* locationd: make pose_kf inherit from KalmanFilter (commaai#34982)

* Read message not json for initial state

* Delete lines

* Fix param

* MADS: prevent `wrongCarMode` from disabling MADS enabled state (commaai#792)

* MADS: prevent `wrongCarMode` from disabling MADS enabled state

Add wrongCarModeNoEntry as a NO_ENTRY event to replace wrongCarMode (USER_DISABLE)
that would incorrectly disable MADS when in the wrong car mode. Provides
contextual guidance to users based on car brand, showing appropriate
instructions for re-engagement without requiring MADS to be re-enabled.

* move down

* warning only?

* cereal SIKE

* remove duplicate

* try this out

* final

* Readme: update with links to new branches and info about rewrite and reflash agnos (commaai#795)

* Adding the new branches info and adding a warning to reflash agnos

* Using more blockquote

* it

---------

Co-authored-by: Stupefacient <brianbrownt@gmail.com>

* agnos 11.13 (commaai#34980)

* agnos 11.12

* new build

* Multilang: Update pt-BR translation (commaai#34983)

* [bot] Update Python packages (commaai#34987)

Update Python packages

Co-authored-by: Vehicle Researcher <user@comma.ai>

* Multilang: Update ja translation (commaai#34986)

* 日本語訳2025/3/19

* numerusform追加。

* connect to an unmetered networkに対応

* panda是正

* opendbc_repo是正

* Multilang: Update zh translation (commaai#34985)

* update to latest userdata partition (commaai#34990)

update

* paramsd: cache backwards compatibility (commaai#34991)

* LiveParametersV2 key

* Param key

* Fix tests

* Remove old params if error

* Update exception message

* Update the test

* Add test for corrupted byte format in v1

* Rename params_reader => params

* hardwared: give stuck LTE connections a kick

This reverts commit e3e6940.

* Revert "hardwared: give stuck LTE connections a kick"

This reverts commit e4aa346.

* process_replay: fix GM and replace TOYOTA3 (commaai#34996)

* Add volt and bolt param migration

* Remove mazda due to invalid sensor timings

* Fix the import

* Add mazda to excluded

* Bring back mazda, but add todo

* New segment for TOYOTA3

* Fix

* Update ref commit

* bump opendbc

* test_models: update relay malfunction check (commaai#34999)

relay is checked in fwd hook

* process_replay: remove GM (volt) (commaai#35000)

Remove volt segment

* Revert "test_models: update relay malfunction check" (commaai#35002)

Revert "test_models: update relay malfunction check (commaai#34999)"

This reverts commit 2cd0079.

* Reapply "Online lateral lag learning" (commaai#34975)

* Online lateral lag learning (commaai#34974)

This reverts commit b4cc9e6.

* pad to the best size for fft

* Fix static analysis

* Add typing

* Fix typing

* MAX_LAG

* Calculate cross correlation regardless if the points are valid

* Back to lagd

* Add lagd to process_config

* Lagd in test onroad

* Move lag estimator for lagd

* Remove duplicate entry from test_onroad

* Update process replay

* pre-fill the data

* Update cpu usage

* 25sec window

* Change the meaning of lateralDelayEstimate

* No newline

* Fix typing

* Prefill

* Update ref commit

* Add a unit test

* Fix static issues

* Time limit

* Or timeout

* Use mocker

* Update estimate every time

* empty test

* DT const

* enable RIVIAN again

* Update ref commit

* Update that again

* Improve the tests

* Fix static

* Add masking test

* Increase timeout

* Add liveDelay to selfdrived

* Add liveDelay to selfdrived in process_replay

* Fix block_avg restore after num_blocks

* regen most

* Update bolt

* Update ref commit

* Change the key name

* Add assert

* True weighted average

* Raise thermal setpoint (commaai#35008)

We don't need to control all the way down to 70C

* UI: Update `AbstractControlSP_SELECTOR` and `OptionControlSP` (commaai#800)

* controls

* Adjust label width dynamically based on layout type.

Updated the label's fixed width to be conditional on the layout type, improving adaptability for different inline layouts. Additionally, corrected indentation in the width calculation loop for consistency.

* Refactor OptionControlSP to improve parameter value handling and encapsulate logic in dedicated methods

* Refactor getParamValue to return an integer and ensure value is updated correctly in button click handler

* Trying to unify a bit the logic. still WIP

* Reducing a bit the change footprint

* Refactor spacing item handling to prevent duplicate insertion and improve layout management

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>

* bump panda

* Radard: vision-based yRel for Hyundai single-lead systems (commaai#805)

Introduced processing for custom yRel values using HyundaiFlagsSP when the enhanced SCC flag is enabled. Updated `radard` to handle `CarParamsSP` and make necessary adjustments for Hyundai vehicles with specific SCC configurations.

* MADS: transition to soft-disable for specific gear states (commaai#791)

* MADS: transition to soft-disable for specific gear states

This commit enhances the condition checking functionality of the Modular Assistive Driving System (MADS) to implement a 'soft-disable' feature during the vehicle's active motion when a non-forward drive gear is engaged. It includes utilizing structs to reference various car state attributes and modifying a function definition to improve clarity. This adjustment boosts the system's reaction to gear shifts, increasing the safety and efficiency of the driving assist system.

* structs

* UI: Device & Sunnylink Panels - Standardize push button size & alignment (commaai#806)

* layout adjustments

* sunnylink_panel

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* [bot] Update Python packages (commaai#35012)

* Update Python packages

* update refs

---------

Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Shane Smiskol <shane@smiskol.com>

* ci: Remove redundant Panda build step from prebuilt workflow (commaai#810)

The Panda build step was unnecessary as it is not utilized in this workflow. This change simplifies the workflow and reduces redundant actions, improving efficiency.

* Device: Customizable Max Time Offroad (commaai#796)

* Max Time Offroad

* Refactor & Fix param

* Error Handling

* rename SP variable

* Update selfdrive/ui/sunnypilot/qt/widgets/controls.h

Co-authored-by: DevTekVE <devtekve@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/widgets/controls.h

Co-authored-by: DevTekVE <devtekve@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/widgets/controls.h

Co-authored-by: DevTekVE <devtekve@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/widgets/controls.h

Co-authored-by: DevTekVE <devtekve@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/widgets/controls.cc

Co-authored-by: DevTekVE <devtekve@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/max_time_offroad.h

Co-authored-by: DevTekVE <devtekve@gmail.com>

* Update selfdrive/ui/sunnypilot/qt/offroad/settings/lateral/max_time_offroad.cc

Co-authored-by: DevTekVE <devtekve@gmail.com>

* UI layout changes for better alignment

selector is not big enough -> make it bigger ;)

OptionControlSP now includes a QMap argument to allow actual values to be set in param directly

* Rebase & resolve reviews

* change default to be closer to OP default

* me dumb

* MaxTimeOffroad: Add support for 30h limit and improve label formatting

* power_monitoring: Refactor MaxTimeOffroad parameter handling for clarity

* test: Add unit tests for MaxTimeOffroad parameter handling

* power_monitoring: Update MaxTimeOffroad handling to use seconds and improve shutdown logic

* power_monitoring: Improve exception handling and remove redundant shutdown check for MaxTimeOffroad

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* Hyundai longitudinal: Parse lead info for camera-based SCC platforms (commaai#809)

* Hyundai longitudinal: Parse lead info for camera-based SCC platforms

* fix

* update

* bump

* update tests

* lol why is this here

* bump

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
Co-authored-by: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com>

* Models: point to v2 of driving models json for recompiled models (commaai#817)

Use newer model version json since they have been recompiled

* ci: update squash script for external contributors (commaai#811)

* Get head ref info

* Simpify adding the comment with the newest flagg by gh cli

* Dynamic origin

* Enhance PR processing: add label handling for forked PRs and improve variable naming

* Refactor PR label handling: use constant for trust-fork label and improve comments

* Fix remote addition in PR processing: change subprocess call to not check for errors

* Refactor PR comment handling: support multiple comments and improve clarity

* Refactor PR processing: streamline comment handling and improve error management

* Refactor add_pr_comments function: specify comments type as list of strings

* Maybe we don't prevent "behind" branches to be merged as lon as the PR itself is mergeable

* lint, leave me alone

---------

Co-authored-by: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com>

* sunnylink: fix sunnylink backup restore version parsing (commaai#816)

* improvement

* fix: Improve version parsing logic for sunnypilot

---------

Co-authored-by: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* DM: Enforce monitoring of MADS state in driver monitoring (commaai#818)

* DM: Enforce monitoring of MADS state in driver monitoring

Added `selfdriveStateSP.mads.enabled` to track MADS engagement. This ensures monitoring logic accounts for MADS alongside the existing selfdrive state checks, improving feature integration and event handling.

* how

* [bot] Update Python packages (commaai#35017)

Update Python packages

Co-authored-by: Vehicle Researcher <user@comma.ai>

* Rename experimental long (commaai#35011)

* now alpha long

* fix

* rename param

* thought i did this

* debug

* debug

* more

* more

* moar

* Revert "moar"

This reverts commit e347106.

* Revert "more"

This reverts commit 0746e6d.

* Revert "more"

This reverts commit 0db5a87.

* Revert "debug"

This reverts commit 72f235b.

* Revert "debug"

This reverts commit 7871b69.

* Temporary disable UI preview from CI (commaai#35018)

disable

* Update Python packages (commaai#819)

* Fix possible CAN ignition overlap due to incorrect counter tracking (commaai#35019)

* fix-rivian-ign

* bump

* UI: Bugfix Max Time Offroad (commaai#820)

bugfixes

Co-authored-by: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com>

* CI: Improve `dev-c3-new` auto build (commaai#825)

* force commit to force PR

* ci: add job to manage PR labels and remove trust label on new commits

* Add pull request trigger

* empty commit to test

* ci: update pull request label management logic and remove FORCE_RUN flag

* ci: update trust label management to use TRUST_FORK_PR_LABEL

* ci: update workflow to manage PR labels and adjust trigger conditions

* ci: rename jobs in workflow for consistency and clarity

* ci: add unleash-nightly-squash branch to workflow

* ci: add checkout step with GITHUB_TOKEN to workflow

* force wait

* what happens if negated the wait

* ci: add 'Wait for Tests' action to monitor workflow execution

* ci: update wait-for-tests action conditions and cleanup

* ci: refine conditions for managing PR labels and waiting for tests

* ci: enhance PR label conditions for workflow execution

* Cant use env on if

* maybe

* ci: update pull request workflow conditions and cleanup

* Missing end of line

* ci: rename workflow and update job name for clarity

* Cleaning

* ci: refine conditions for pull request handling in workflow

* ci: update handling of TRUST_FORK_LABEL in PR processing

* ci: remove fork trust warning from PR processing

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* CI: Update PR list query to exclude draft pull requests (commaai#829)

* lagd: check sensors valid (commaai#35027)

* Check if sensors valid

* Fix test

* Fix static

* Constants

* time buffer for pose valid

* Fix static

* Revert "DM: Enforce monitoring of MADS state in driver monitoring" (commaai#830)

Revert "DM: Enforce monitoring of MADS state in driver monitoring (commaai#818)"

This reverts commit 3615b1a.

* DM: Enforce monitoring of MADS state in driver monitoring (commaai#831)

* DM: Enforce monitoring of MADS state in driver monitoring

Added `selfdriveStateSP.mads.enabled` to track MADS engagement. This ensures monitoring logic accounts for MADS alongside the existing selfdrive state checks, improving feature integration and event handling.

* how

* okay, only when active

* ui(raylib): update spinner progress bar to match Qt (commaai#35028)

* lagd: estimate std (commaai#35009)

* Std

* Fix static

* Refactor

* Assert std zero

* update

* ui(raylib): fix typos (commaai#35030)

* Update modeld action logic (commaai#35032)

* add action logic

* magic numbers

* unused

* plot accel

* more changes

* lagd: check for validity of the estimate when restoring state (commaai#35034)

Do not restore if invalid

* Multilang: Update de translation (commaai#35025)

added missing German translations

* Tomb raider 2 (commaai#35029)

* db56b8fb-9135-4ab6-af18-99b7df7b2245/400

* fixes

* linter unhappy

* 6dbe0991-baa1-49ad-836a-ab370d1f0d92/400

* This one is good: 19387087-1005-475e-9015-9458dd8e7c5f/400

* Better every day: 39ed911c-0937-417f-97d2-58a8bb3caa53/400

* Actually end-to-end

* typo

* smooooooth: 94e23541-eb84-4fef-9f51-6a2d82aff314/360

* Revert "smooooooth: 94e23541-eb84-4fef-9f51-6a2d82aff314/360"

This reverts commit edd4f02.

* 11632ef7-f555-489c-8480-e3bf97d9285e/400

* 08712d27-f6bd-4536-a30e-c729e5f62356/400

* 0a92a35e-1f72-476a-8cb6-c9f103f36822/400

* ee6d2394-2072-420c-a664-b4c0d4ed0b61/400

* no prev curv

* No double work

* fix bug

* smooth

* update prev action

* whitespace

* add little accel

* new ref

* Update plant.py

* DEC: adjust dynamic speed adaptation parameters (commaai#813)

* early and better

* Update sunnypilot/selfdrive/controls/lib/dec/constants.py

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
Co-authored-by: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com>

* OS04C10: use IFE downscaler for road cameras (commaai#35023)

* squashh

* wrong

* clean up

* rename

* process replay migration: fix longitudinalPlan (commaai#35035)

* ci: ui preview add unicode characters and emojis (commaai#835)

Add unicode characters and emojis!

* ui(raylib): update text window font, new lines and indentation (commaai#35031)

* NNLC: decreased low-speed factor (commaai#822)

* NNLC: decreased low-speed factor

* np.float to float

* format

* add tests for sanity check

---------

Co-authored-by: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* ui(raylib): calculate spinner progress in set_text (commaai#35036)

* bugfix: Auto lane change - Add mode to disable lane changes (commaai#826)

* off is off

* sugg

* line

* Update sunnypilot/selfdrive/controls/lib/tests/test_auto_lane_change.py

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
Co-authored-by: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com>
Co-authored-by: DevTekVE <devtekve@gmail.com>

* NNLC: use `safe_exp` to prevent overflow in `sigmoid` (commaai#836)

* test

* prevent overflowing

* unused

* NNLC: fix weak torque in high lat-accel turns (commaai#823)

* NNLC: fix weak torque in high lat-accel turns

* np.float to float

---------

Co-authored-by: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>

* ci: trigger prebuilt builds via label from PR

* ci: enhance pull request handling for prebuilt workflows

* ci: add wait-for-action step to monitor selfdrive_tests workflow

* ci: add validation job to monitor selfdrive_tests for prebuilt workflows

* test

* force negative condition to validate flow

* force negative condition to validate flow

* ci: add wait_for_tests input to control selfdrive_tests workflow execution

* ci: update description for wait_for_tests input in workflow

* Cleaning

* Remove PR label when triggered by the label

* Rename

* Changing to target and only caring about labeled for the time being

* gh action needs cancelled not canceled

* Line ending

* ci: avoid deadlock on dev-c3 branch build when PR labeled dev-c3 (commaai#839)

* ci: enhance PR checks to validate individual check runs before merging and ignore reset-and-squash as candidate for fail

* reset and squash script shouldn't will be cancelled only if a push to master has been made which always should take priority. The rest will be put on hold to avoid parallel squash scripts running

* Set concurrencty at workflow level?

* Set concurrencty at workflow level?

* change trigger to pull_request to validate

* Reducing the types of "pull request" events

* Keep it as target

* Playing eith run name a little

* Change to pull request not target

* simplifying

* set to just pull request without target

* maintain as pull request target

* ci: update auto pr review config and split turst fork pr (commaai#842)

* Updating auto pr labeler

* auto pr review revamp

* Leaving event as pull request :)

* Check permission

* add chore

* Bringing back as original

* ci: bugfix flipped contains check for pull requests

* ci: bugfix cancelling only when push to master or workflow dispatch.

Otherwise don't let it cancel as it seems that when running with pull_request_target we are with ref pointing to target and thus the cancel condition was being met

* ui(raylib): constant spinner rotation speed (commaai#35037)

* ci: improve conditions for publish and notify steps in workflow (commaai#844)

* [bot] Update translations (commaai#35040)

Update translations

Co-authored-by: Vehicle Researcher <user@comma.ai>

* Long planner: make work with training (commaai#35043)

* revert useless

* update ref

* Modeld: small refactor (commaai#35044)

refactor

* update smooth

* raylib: init updater (commaai#35045)

* raylib: init updater

* cleanup

* Revert "OS04C10: use IFE downscaler for road cameras" (commaai#35046)

Revert "OS04C10: use IFE downscaler for road cameras (commaai#35023)"

This reverts commit 3b60b22.

* Tomb Raider 3 (commaai#35042)

* 92b64884-4506-4a03-87ad-33e1a177fe73/400

* faster lat

* DM: Use `carControl.latActive` for MADS DM monitoring (commaai#845)

* ci: fixes for trigger conditions on sync (commaai#847)

pull_request_target is needed for security, but at the same time it makes life a little harder because the ref is different so we need to do some work to make sure we get what we are supposed to get

* ui(raylib): reduce spinner rotation artifact (commaai#35048)

* ui(raylib): reduce spinner rotation artifact

A visual artifact (white pixels) appeared on the edge of the
rotating spinner track texture, likely due to RGB color bleed during
bilinear filtering in Raylib.

Pre-multiplying the alpha channel of the spinner track image using
`rl.image_alpha_premultiply` significantly reduces the visibility of the
artifact.

* lint

* ui(raylib): increase font size and wrap text in spinner (commaai#35049)

- Wrap text onto separate lines
- Increase font size to be closer to Qt
- Remove extra letter spacing - 0.0 should use font default spacing, and this is used in `wrap_text`

Will fix vertical alignment separately, as both the text and progress bar layouts need to be considered

* ui(raylib): update spinner vertical pos (commaai#35051)

Adjust the spinner vertical position when displaying text or a progress bar

- When displaying the progress bar, center the comma logo and spinner in the middle of the screen
- When displaying text, center the entire content vertically

Also updated `wrap_text` to not include an empty line in the array if it's the first line, so that `wrap_text("")` always returns `[]`

* ui(raylib): "exit" btn in text window on PC (commaai#35052)

* ui(raylib): "exit" btn in text window on PC

* unused import

* Revert "ui(raylib): "exit" btn in text window on PC (commaai#35052)"

This reverts commit f9767d2.

* plotjuggler: support relative paths (commaai#35054)

* Support relative paths

* Abspath for rlog too

* Reapply "ui(raylib): "exit" btn in text window on PC" (commaai#35053)

* ui(raylib): "exit" btn in text window on PC

* unused import

* request close

* this was missing

* Disable low speed steer in modeld (commaai#35056)

* disable low speed steer

* No steer under

* TOYOTA_RAV4_PRIME NNLC tuning gen 1 (commaai#850)

neural_network_data: TOYOTA_RAV4_PRIME NNLC tuning gen 1

* SL: updating localproxy implementation (commaai#841)

* Adding capabilities to route localProxy via sunnylink

* Undo

* Thx lint

* get api token

* cert is not valid when it's an IP. Still use cert, but don't validate

* move to car_specific_sp

* bump

---------

Co-authored-by: Harald Schäfer <harald.the.engineer@gmail.com>
Co-authored-by: Kacper Rączy <gfw.kra@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
Co-authored-by: DevTekVE <devtekve@gmail.com>
Co-authored-by: Stupefacient <brianbrownt@gmail.com>
Co-authored-by: Alexandre Nobuharu Sato <66435071+AlexandreSato@users.noreply.github.com>
Co-authored-by: commaci-public <60409688+commaci-public@users.noreply.github.com>
Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: programanichiro <99449198+programanichiro@users.noreply.github.com>
Co-authored-by: eFini <ricklan@gmail.com>
Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Robbe Derks <robbe.derks@gmail.com>
Co-authored-by: Nayan <nayan8teen@gmail.com>
Co-authored-by: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com>
Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
Co-authored-by: niko001 <nikolaus_fischer@t-online.de>
Co-authored-by: Kumar <36933347+rav4kumar@users.noreply.github.com>
Co-authored-by: ZwX1616 <zwx1616@gmail.com>
Co-authored-by: YassineYousfi <yyousfi1@binghamton.edu>
Co-authored-by: Tim Wilson <twilsonco@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Warren Togami <wtogami@gmail.com>

* fixing missing event

* more event fixes

* fixing spacing

* more fixes

* revert

* update

* update

* update

* reverting unneeded event

* S P A C I N G

* bumping opendbc

* bump

* Update sunnypilot/selfdrive/car/car_specific.py

* Update sunnypilot/selfdrive/car/car_specific.py

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
Co-authored-by: Harald Schäfer <harald.the.engineer@gmail.com>
Co-authored-by: Kacper Rączy <gfw.kra@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: DevTekVE <devtekve@gmail.com>
Co-authored-by: Stupefacient <brianbrownt@gmail.com>
Co-authored-by: Alexandre Nobuharu Sato <66435071+AlexandreSato@users.noreply.github.com>
Co-authored-by: commaci-public <60409688+commaci-public@users.noreply.github.com>
Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: programanichiro <99449198+programanichiro@users.noreply.github.com>
Co-authored-by: eFini <ricklan@gmail.com>
Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Robbe Derks <robbe.derks@gmail.com>
Co-authored-by: Nayan <nayan8teen@gmail.com>
Co-authored-by: Discountchubbs <159560811+Discountchubbs@users.noreply.github.com>
Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
Co-authored-by: niko001 <nikolaus_fischer@t-online.de>
Co-authored-by: Kumar <36933347+rav4kumar@users.noreply.github.com>
Co-authored-by: ZwX1616 <zwx1616@gmail.com>
Co-authored-by: YassineYousfi <yyousfi1@binghamton.edu>
Co-authored-by: Tim Wilson <twilsonco@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Warren Togami <wtogami@gmail.com>
66thparallel pushed a commit to 66thparallel/janes_openpilot_fork that referenced this pull request May 1, 2026
…agen MQB (commaai#836)

* Generalized core OP CRC support plus extra bits for Volkswagen MQB.
old-commit-hash: d953b6a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants