243 Commits

Author SHA1 Message Date
infiniteCable2
2c672df49a Merge branch 'master' of https://github.com/sunnypilot/opendbc into sync 2026-02-04 19:22:19 +01:00
Jason Wen
3e8f303b6a Merge branch 'upstream/opendbc/master' into sync-20260203 2026-02-03 23:29:42 -05:00
Jason Wen
807fc0dd9a Merge branch 'upstream/opendbc/master' into sync-20260201
# Conflicts:
#	.github/workflows/tests.yml
#	opendbc/car/honda/interface.py
2026-02-02 22:21:37 -05:00
Jacob Waller
c2eba0b51d Fix Subaru message definitions for HighBeamAssist and static messages (#3102)
Co-authored-by: Jacob Waller <jacob.waller@inspire11.com>
2026-01-31 21:18:21 -08:00
Shane Smiskol
cc29c45979 Subaru: remove unused safety angle measurement (#3100)
* we simply don't use this

* as well
2026-01-31 02:14:39 -08:00
infiniteCable2
b8c700137a Merge branch 'master' of https://github.com/sunnypilot/opendbc into sync 2026-01-25 11:48:11 +01:00
commaci-public
f88c531576 [bot] Update cppcheck to 2.19.1 (#2982)
* [bot] Update cppcheck to 2.19.1

* update table

* try assistance

* not needed with --platform?

* rm

---------

Co-authored-by: Vehicle Researcher <user@comma.ai>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2026-01-23 21:55:27 -08:00
Warren Togami
0185a52154 Toyota: Prevent EPS fault during unwind after sharp turn (#2859)
* 2019-2021 RAV4
* 2021-2023 RAV4 Prime
* 2021-2023 Sienna

These Toyota models can experience a rare EPS fault.

After a sharp, low-speed manual turn the human lets go of the wheel.
During or shortly after the unwind the EPS faults. It can be difficult
to reproduce.

PR #24067 "Toyota: remove 100°/sec steering lockout" attempted to prevent
this high angle rate EPS fault by cutting torque if more than 18 frames.
I found reducing this threshold by just one frame fixes the problem.

Co-authored-by: Jason Young <jyoung8607@gmail.com>
2026-01-22 22:07:06 -08:00
Jason Wen
0035b6752e Merge branch 'upstream/opendbc/master' into sync-20260111
# Conflicts:
#	.github/workflows/tests.yml
#	SConstruct
#	opendbc/car/docs.py
#	opendbc/car/gm/interface.py
#	opendbc/car/interfaces.py
#	opendbc/car/tesla/teslacan.py
#	opendbc/safety/modes/chrysler.h
#	opendbc/safety/modes/tesla.h
#	opendbc/safety/tests/test.sh
#	opendbc/safety/tests/test_tesla.py
2026-01-19 21:42:56 -05:00
Adeeb Shihadeh
796ece26ac libsafety: switch to clang 18 and only build mull in standalone mode (#3044)
* just switch to 18

* try this

* just clang

* rm that

* try this
2026-01-19 15:30:32 -08:00
Lukas
a9f6796ac5 Tesla: Brake to ESP_status (#2628)
* docs: Scheduled auto-update CARS.md

* use esp_status

* Update opendbc/safety/modes/tesla.h

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* consistent logic

* docs: Scheduled auto-update CARS.md

* fix formatting

* use esp_status

* Update opendbc/safety/modes/tesla.h

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* consistent logic

* Honda: 25 MDX community doc cleanup (#2655)

remove due to MDX PR 2129

* Toyota: Add FW for 2020 Toyota Yaris (#2656)

* Add Toyota Yaris 2020 EU

* fix sorting

* expand supported model-years

---------

Co-authored-by: Jason Young <jyoung8607@gmail.com>

* docs: Scheduled auto-update CARS.md

* Honda: CRV 2023-2025 (canfd) (#2475)

* init CANFD CRV

* init CANFD CRV Hybrid

* remove

* remove

* remove import for now

* remove import for now

* shane fixes

* rebase fixes

* fix

* update

* remove whitespace

* new test route

* remove CRV Hybrid

* 2025

* rename honda pilot dbc to canfd common

* rename canfd common dbc to canfd common can dbc

* renaming dbc to honda_canfd_common

* updating car specs

* separate steer interface and increase to 5000 per testers

* adding brake_error commands for canFD

* autocalculate alt brake for canfd

* adding canfd safety value

* adding bosch canfd safety value

* canfd required safety changes from pr 2129

* canfd required safety changes from pr2129

* renaming dbc to honda_canfd_common

* typo fix

* fix coding style per CI

* move canfd altbrake to autodetection

* clearer diff, for now

* Adding 24 CRV Hybrid fingerprint

* switch to torque controller

* updating hybrid test route

* applying log-determined values for CRV 6G Hybrid

* updating values from additional log

* updating steer threshold based on log

* udpating values based on log

* found higher numbers in CRV log

* repoint ICE to Hybrid

* typo fix

* typo fix

* remove CRV from car template

* remove CRV from extra cars

* Adding 23 ICE fingerprints (Taiwan market)

* Adding CRV ICE test route

* whitespace fix

* collapse CRV_HYBRID_6G into CRV_6G

* verified max of 2560 from dashcam route

* cleanup

* not seeing data to elevate this above other CAN-FD

* swag after actuator rescale

* it wants a little more SR

* same steerActuatorDelay as the others

* prepare to recreate FW lists

* auto_fingerprint 864613393836f643/00000002--3cef07213f

* auto_fingerprint 51dea302d9d61e22/00000006--f3732a4905

* auto_fingerprint 0a84f6dd8372aef6/00000005--aff7debbbe

* auto_fingerprint ea1fc707f10a580a/00000016--a6e25f0867

* auto_fingerprint c6dc5864bedfeaa9/00000000--b11ca96af3

* auto_fingerprint 63568e3e2f56c8ad/00000001--2c87c755e1

* don't have a verified dongle with MY2023 yet

* adding 2023 to community docs

* auto_fingerprint 472a018ff8fd479a/0000006f--72d838b24d

* Revert "adding 2023 to community docs"

This reverts commit bdaf5bff0a2ca3f1c826dc4257580822f95baf1b.

* Revert "don't have a verified dongle with MY2023 yet"

This reverts commit 0e8b8e300168ab3404cc74980a182bec1d3f50e0.

---------

Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
Co-authored-by: Jason Young <jyoung8607@gmail.com>

* Toyota: Add FW for 2020 Toyota Corolla Sport JDM (#2644)

Japanese Toyota Corolla Sport 2019-22

* HKG: Add FW for 2019 Kia Sorento (#2641)

Kia Sorento Aus 2018/2019

Co-authored-by: Jason Young <46612682+jyoung8607@users.noreply.github.com>

* Honda: Add FW for 2025 Honda HR-V (#2652)

* docs: Scheduled auto-update CARS.md

* kotarou fingerprint

---------

Co-authored-by: AlexandreSato <AlexandreSato@users.noreply.github.com>

* Tesla: Add FW for Tesla Model 3 (#2658)

added new tesla fingerprint

* HKG: add FW for 2023 Hyundai Kona (#2613)

* Update Hyundai Kona 2022 fingerprints and docs

Added new firmware versions for Hyundai Kona 2022 in fingerprints.py and updated the documentation string to 'Hyundai Kona 2022-23' in values.py to reflect model year coverage.

* ALT_LIMITS

* Revert "ALT_LIMITS"

This reverts commit 9ad75d1d5663354f6cedcdbb433c1f229c1b5bd4.

* fix sorting order

---------

Co-authored-by: Jason Young <jyoung8607@gmail.com>

* HKG: Add FW for 2022 Kia Niro EV (#2102)

Update fingerprints.py

* docs: Scheduled auto-update CARS.md

* Hyundai: fix Kia Sportage test route

the auto-selected segment has a legitimate timeout on the TCS CAN message that was just slipping by the thresholds

* CANParser: determine can_valid on read (#2665)

props

* Torque controller: refactor calculations to be in accel space (#2528)

* gains need to be in lat accel space too (but behavior is still different)

* actually it may make more sense

* use siglin

* fix

* conflict

* cleanups

* more cleanup

* unused import

* remove gravity

* imports

* inverse

* cleanup

* more cleanip

* lint

* whitespace

* more cleanup

---------

Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>

* Fix mutation test timing out for big changes (#2668)

* PSA AEE2010_R3: Initial Platform Support (#2379)

* spam at 100Hz

* try higher STEER_MAX

* delete torque based control

* set measured steerActuatorDelay

* add route

* fix: set static status when lat not active

* clean checksum

* clean: carcontroller

* clean: carstate, interface

* clean: psacan

* clean: values

* fix

* comments

* try 0_3s actuator

* enable lanechange

* implement standstill

* fix: blinkers

* fix: e208 car specs

* fix: set ovveride.toml to angle based

* actuatorDelay to 0.5s

* add: standstill signal

* add: translated DBC

* fix: recuperation

* test: status change

* clean up status ramp

* cleanup

* add: ESP and cruisestate signals

* actuatorDelay to 0.2

* cleanup

* test max angle

* set verified STEER_MAX

* test fingerprinting

* match nissan angle limits

* Revert "match nissan angle limits"

This reverts commit 4ef75889ac9e73127a8ae6dd98b875b52604132b.

* fix tests

* DEBUG: test fingerprint

* actuatorDelay to 0.4

* DEBUG: use non-negative ECU offsetc

* DEBUG: enable Dashcam mode

* DEBUG: try to fix values.py

* Revert "DEBUG: enable Dashcam mode"

This reverts commit 4c632bcbaf78a4185232daa96df845e073764583.

* set more ecu addresses

* DBC: name DIAG frames

* use simple fw request

* cleanup

* fix: rename carname to brand

* swap CAN0/2

* add: carstate signals

* fix: steeringRateSign

* move PSA safety to opendbc

* fix: adhere to new ANGLE_LIMITS

* add: mandatory ignores for chks and counter

* fix: fingerprint

* disable radar ECU

* translate HS2_DAT_MDD_CMD_452 msg

* add ACC cancel request message

* translate HS2_DAT_MDD_CMD_452 signals

* rename to SPEED_SETPOINT

* checksum init

* add acc status msg

* add structure for longitudinal

* update test route

* remove debug code

* fix: ecu version requests

* adjust ActuatorDelay to 0.3

* disable bus multiplexing

* disable radar

* enable longitudinal

* add: artiv (radar) signals

* rename

* implement radar fake messages

* add radar tx safety

* fix

* implement radar spoof

* fix

* disable long signals

* DEBUG: test checksums

* set checksum chk_ini

* fix checksum 2f6

* checksum helper 2f6

* checksum helper 2b6

* fix checksum 2b6

* checksum helper 3f2

* try fixed radar values

* unify checksum script

* enable radar control

* cleanup

* add acc values

* adjust long params

* fix radar msg

* enable resume from standstill

* fix braking threshold

* set standstill cruise false

* set long tuning to default

* DEBUG: test AUTO_BREAKING always on

* DEBUG: AUTO_BRAKING on after 1 s of car startup

* DEBUG: spoof radar after 10 seconds

* sync 2f6 and 2b6 radar signals

* DEBUG: set KiV long tune

* DEBUG: set mult to 1000

* fix fwd hook

* fix interface

* adjust tuning

* ARC STATUS=1

* scale torque multiplier with speed

* scale fix

* use simple acc to torque factor

* use factor 80

* simplify

* cleanup

* set mult to 70

* DEBUG: try kiV

* no kiV, linear accel/brake

* AEB enable test

* AEB always disabled test

* add 100Hz gas pedal

* op long optional

* add acc related signals

* set steerAtStandstill

* fix: dbc message name typo

* add steeringSaturated debug

* adapt to master changes

* safety: set meas_angle

* chg: set steer_driver_allowance to 1.5 Nm

* fix: steering wheel nudge on disengage

* safety: add torque_driver

* DEBUG: enable long

* fix: req_diag_artiv

* disable long

* chg: reduce DRIVER_ALLOWANCE to 1 Nm

* remove longitudinal

* cleanup

* move safety_psa

* fw request

* decrease torque

* fw query

* steerLimitTimer = 0.1

* DEBUG: fix fw query for psa

* query test 1

* query test 2

* fw query test 3

* add ecu versions

* fix fw query

* fix ECU names

* add tester preset

* reactivate brand_matches skip

* adapt to opendbc changes

* fix linter

* fix misra

* fix pytest: add psa fw query timings

* fix: rxchecks

* adapt to master changes

* clean values.py

* DEBUG: fw_versions.py debug print

* Revert "DEBUG: fw_versions.py debug print"

This reverts commit c298f4f1711c055a31600587ba25f89cfbffc0e3.

* use firmware request

* PSA ECUs:  is_tester_present_response exception

* cleanup

* rename dbc

* peugeot 208

* delete opel corsa

* clean

* fix tests

* comments

* align angle rates to values.h

* set rx counters

* refactor

* add checksum and counter hooks

* set chk ini bytes

* remove one message

* fix misra

* fix main bus

* Revert "PSA ECUs:  is_tester_present_response exception"

This reverts commit 3387200097a62b4cda14840f198657876bcdedc8.

* revert fingerprints.py entry

* remove leading empty line

* psa safety ALLOW_DEBUG

* cleanup

* fix tests

* enable fw query for route recording

* Revert "enable fw query for route recording"

This reverts commit f81915ad27f125adb6424de793b87e4b3e40142d.

* add better route

* remove FW Query

* remove DRIVER

* sort alphabetical

* cleanup

* fix test

* clean

* clean

* conservative steerLimitTimer

* fix names

formatting

* psa test setup

add helper to psa test

add more helper

* add StockSafety test

* remove ESP signal

* remove steerFaultPermanent

* fix parse_wheel_speed and gasPressed

* move frequency in rx checks

* to_push/to_send -> msg

* align formatting with values.py

* rm GET_BUS

* rm GET_ADDR

* rm GET_BYTE

* fix some tests

* Update opendbc/car/psa/values.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* use opendbc.car.lateral import

* use opendbc.car.lateral import

* remove legacy fingerprint

* fix misra

* fix CHECKSUM/COUNTER dbc names

* use can packer for psa_checksum

* fix tests

* fix coverage

* Apply suggestions from code review

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* clean psacan

* set steerLimitTimer to 0.1

* Update opendbc/car/psa/carcontroller.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Update opendbc/car/psa/carstate.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Update opendbc/safety/modes/psa.h

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* add newline in safety_declratations.h

* fix indentation

* remove fwd hook

* Update opendbc/car/psa/carstate.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Update opendbc/car/psa/carstate.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* fix main/cam bus naming

* use brake_pressed instead brake_pressure

* fix ruff

* remove manual gear

* fix ChecksumState

* send steering at 20Hz

* replicate stock LKAS behavior

* fix mutations

* Update opendbc/car/psa/carcontroller.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Update opendbc/car/psa/carstate.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* fix dbc comment

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>

* HKG: fix 1b5 (#2637)

Update hyundai_canfd.dbc

* docs: Scheduled auto-update CARS.md

* Honda: remove EPS mod support (#2672)

* Nissan: add new fingerprint for Nissan Leaf 2021 UK  (#2669)

* nissan: add new firmware version 476605SH7E to FW_VERSIONS

* fix sorting order

---------

Co-authored-by: chris-moming4k <moming2k@igpsd.com>
Co-authored-by: Jason Young <jyoung8607@gmail.com>

* Hyundai: fix CAN errors due to CRUISE_BUTTONS ECU TX jank (#2673)

* Increase timeout if cache not hit (#2678)

* no cache timeout

* hmm

* 90 fine

* [bot] Fingerprints: add missing FW versions from new users (#2677)

Export fingerprints

* Honda: Update package availability for Civic (#2680)

* correcting documentation

* changed to automatic transmission, reads better on website

* Remove automatic transmission requirements

* Honda: Honda City (Brazil only) 2023 (#2425)

* init Honda City

* tmp fix EPB status error

* test route and comments

* updates

* add this

* fix handbrake

* minSteerSpeed

* fix

* change

* fix

* current test route

* follow parking brake signal name change

* i hope this is wrong :(

* wheelbase was wrong, also wants more SR

* rm torque substitute

* add generation to CAR name

* one more ref

* separate config block, rescaled actuator range

* remove, will be restored with #2481

* adjust steeringPressed threshold

* ultra swag due to undetected steer overrides

* one more tweak

* maybe two

* this thing really wants SR

---------

Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
Co-authored-by: Jason Young <jyoung8607@gmail.com>

* docs: Scheduled auto-update CARS.md

---------

Co-authored-by: lukasloetkolben <lukasloetkolben@users.noreply.github.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: mvl-boston <manuel@alumni.virginia.edu>
Co-authored-by: Grzegorz Gajoch <gajoch@gmail.com>
Co-authored-by: Jason Young <jyoung8607@gmail.com>
Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
Co-authored-by: Yasuhiro Ohno <84763339+yasu-oh@users.noreply.github.com>
Co-authored-by: Andrew Frahn <andrew@emmertex.com>
Co-authored-by: Jason Young <46612682+jyoung8607@users.noreply.github.com>
Co-authored-by: Alexandre Nobuharu Sato <66435071+AlexandreSato@users.noreply.github.com>
Co-authored-by: AlexandreSato <AlexandreSato@users.noreply.github.com>
Co-authored-by: Amy Jeanes <mattjeanes23@gmail.com>
Co-authored-by: royjr <royjr96@gmail.com>
Co-authored-by: James Vecellio-Grant <159560811+Discountchubbs@users.noreply.github.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>
Co-authored-by: elkoled <elkoled@gmail.com>
Co-authored-by: Chris Chan <moming2k@gmail.com>
Co-authored-by: chris-moming4k <moming2k@igpsd.com>
Co-authored-by: Thales Ceolin <thalesac@users.noreply.github.com>
2026-01-15 22:54:51 -08:00
Shane Smiskol
58f0332026 Tesla: support FSD 14 (#2934)
* they switched

* from https://github.com/commaai/opendbc/pull/2860

* from https://github.com/commaai/opendbc/pull/2924

* forgot to flip here

* parameterize

* do safety

* fix

* misra

* ok misra, this is more confusing but sure

* kinda works

* simplify

* same function in safety

* more stuff

* fix

* debug

* clean up

* cmt

* detect fsd 14

* fix
2026-01-12 20:38:31 -08:00
Shane Smiskol
dc67cb143d Minor Tesla cleanup 2026-01-12 19:52:17 -08:00
Shane Smiskol
de02716a72 Reapply "safety: single libsafety.so" (#3030)
This reverts commit c80388aece.
2026-01-12 15:45:03 -08:00
Shane Smiskol
c80388aece Revert "safety: single libsafety.so" (#3030)
Revert "safety: single libsafety.so (#3013)"

This reverts commit f812bf7cde.
2026-01-12 14:37:53 -08:00
T3vl
d12538dd9e VW PQ: Update HCA Status to use Mode 2 (Status 7) (#2722)
* VW PQ: Update HCA Status to use Mode 2 (Status 7)

* VW PQ: update PQ safety test to use HCA status 7

---------

Co-authored-by: Jason Young <46612682+jyoung8607@users.noreply.github.com>
2026-01-05 09:09:01 -05:00
Adeeb Shihadeh
f812bf7cde safety: single libsafety.so (#3013)
* safety: single libsafety.so

* llvm
2025-12-31 15:03:29 -08:00
Adeeb Shihadeh
9fc469ae0f safety: always run tests with UBSAN (#3007) 2025-12-30 08:53:12 -08:00
Adeeb Shihadeh
508fa28823 board/ is dead (#3003)
* board/ is dead

* add that back
2025-12-29 19:33:34 -08:00
Adeeb Shihadeh
7391f464de get mutation tests running on macOS (#2998)
* install mull on macOS

* runs

* run in ci

* more readable

* fail early

* who doesn't have curl

* fix that?

* uv sourcing

* unset that

* mit

* cleanup
2025-12-29 17:23:00 -08:00
Adeeb Shihadeh
df0f84b160 libsafety: fix building with mutation env (#3001)
* build_env

* default

* conditional

* need it there

* try that

* fix

* rm those
2025-12-29 17:14:04 -08:00
Adeeb Shihadeh
edf19be8ef ty: less ignores (#2994)
* less ignore

* one more

* one more

* lil more
2025-12-28 00:44:48 -08:00
Adeeb Shihadeh
fe7dbcfd59 Add ty type checker (#2993) 2025-12-28 00:26:14 -08:00
infiniteCable2
c09ce28d75 Reliable Gas Pressed Detection Signal (#23)
* use reliable gas signal

* gas pressed form motor_51
2025-12-27 15:11:26 +01:00
infiniteCable2
24845a2b4b Merge branch 'master' of https://github.com/sunnypilot/opendbc into sync 2025-12-18 18:06:16 +01:00
Jason Wen
05e7377182 Merge branch 'upstream/opendbc/master' into sync-20251217
# Conflicts:
#	opendbc/car/tests/routes.py
#	opendbc/car/toyota/carcontroller.py
#	opendbc/car/toyota/values.py
#	opendbc/safety/modes/subaru_preglobal.h
2025-12-17 19:36:33 -05:00
infiniteCable2
836dd29732 Update test_volkswagen_meb.py cleanup 2025-12-15 19:22:58 +01:00
Jason Young
0d6979ab25 Update cppcheck to 2.18.3 (fixed) (#2925)
* [bot] Update cppcheck to 2.18.0

* fix issue with ignore path wildcard handling

* fix false alert on typeof in SAFETY_[ABS/MIN/MAX/CLAMP]

* cleanup GET_FLAG to avoid false alerts on typeof

* fix implicit declaration of microsecond_timer_get()

* bump to 2.18.3 while we're here

* hopefully fix macos

* new (uncached) cppcheck build took longer, sorry not sorry

---------

Co-authored-by: Vehicle Researcher <user@comma.ai>
2025-12-10 10:20:26 -08:00
infiniteCable2
d941085073 adapt to upstream 2025-11-16 12:43:25 +01:00
infiniteCable2
a5a9438844 Merge branch 'master' of https://github.com/sunnypilot/opendbc into sync 2025-11-16 12:18:09 +01:00
Jason Wen
e37271117b Revert "Toyota: SecOC Longitudinal Control (#126)"
This reverts commit d2002787f6.
2025-11-14 02:05:25 -05:00
Jason Wen
c7780b18e8 Merge branch 'upstream/opendbc/master' into sync-20251114
# Conflicts:
#	SConstruct
#	opendbc/car/tests/routes.py
#	opendbc/car/toyota/carcontroller.py
#	opendbc/car/toyota/carstate.py
#	opendbc/safety/lateral.h
#	opendbc/safety/modes/subaru.h
#	opendbc/safety/modes/subaru_preglobal.h
#	opendbc/safety/modes/toyota.h
#	opendbc/safety/tests/common.py
#	opendbc/safety/tests/libsafety/safety_helpers.h
#	opendbc/safety/tests/libsafety/safety_helpers.py
#	opendbc/safety/tests/misra/main.c
#	opendbc/safety/tests/test_chrysler.py
#	opendbc/safety/tests/test_honda.py
#	opendbc/safety/tests/test_hyundai.py
#	opendbc/safety/tests/test_hyundai_canfd.py
#	opendbc/safety/tests/test_toyota.py
2025-11-14 02:05:19 -05:00
Jason Young
dd629a7e9c VW MLB: Porsche Macan (dashcam mode) (#2846)
* add DBC

* add platform definition data

* carstate checkpoint

* checkpoint carcontroller/mlbcan/interface

* checkpoint safety and safety test

* PEBCAK

* checkpoint various fixes

* fixes

* more fixes

* Blinkmodi_01 is genuinely on-demand only, add a fixme

* get turn signal state from a less annoying source

* add @Bentley's route for dev/test only

* gearshift position

* cleanup

* auto_fingerprint e8dac44d3a3458a5/00000000--9b83a227ce

* smooth move, ex-lax

* Kombi_01 COUNTER isn't real, at least not universal

* use lat accel torque controller

* checkpoint refactor

* Revert "always CANFD"

This reverts commit ac6122e272.

* auto_fingerprint 3a4f7c559c2f1215/00000001--5dc72af277

* add the VIN just to be sure

* auto_fingerprint a3bd1cb95d7c2f97/00000082--dbb4d37c0d

* she's a quick one

* more torque

* use different turn state signal

* slight reduction in ramp-up rate for jerk limit safety

* fix HCA status handling

* FINE

* add seatbelt signal

* enable door states

* Revert "use different turn state signal"

This reverts commit fb334567544d1adbeb71289310356e3ddcba17c6.

* use turn stalk helper to handle one-touch lane changes

* derp

* more friction

* a little more SR

* cleanup test routes

* reduce whitespace diff

* unnecessary for now

* dashcam

* cleanup

* Reapply "always CANFD"

This reverts commit 38e304f898107f16d963c976b3ef79978eb49e1d.

* VW: Safety code cleanup

* not yet

* consolidate ESP_05 for MQB

* retry CI after pinning pycapnp

* DRY not worth it here

* a little more DRY

* convert another single-bit read to GET_BIT

* separate MLB checksum handling, add XOR support

* XOR checksum support for LS_01

* shared message handling for LH_EPS_03 and LWI_01

* selective signal pass-through for LS_01

* add note for later consolidation

* consolidate create_lka_hud_control, unpretty but works

* XOR checksum support for TSK_05

* add TODO

* try it out

* good enough for who it's for
2025-11-10 00:24:36 -05:00
infiniteCable2
3a08a37c3e Merge branch 'master' of https://github.com/sunnypilot/opendbc 2025-11-03 18:08:28 +01:00
Jason Wen
c32e79f3c6 Subaru Global Gen2: bump steering limits and update tuning (#299)
* Subaru Global Gen2: bump steering limits

* no longer applies

* must be lowered

* Revert "must be lowered"

This reverts commit 12d86e4272d52c92d4806f9c0f24ee18507dc985.

* lower rate down

* lower

* ui: ensure Cruise panel widget is reset when `hideEvent`
2025-11-03 03:19:01 -05:00
MVL
107f41b042 Honda: Nidec hybrid baseline brake support (#323)
* generalize Clarity to Nidec Hybrid

* generalize Clarity to Nidec Hybrid

* generalize Clarity to Nidec Hybrid

* generalize Clarity to Nidec Hybrid

* generalize Clarity to Nidec Hybrid

* add hybrid alt-brakehold

* adding alt brakehold

* generalize Clarity to Nidec Hybrid

* generalize Clarity to Nidec Hybrid

* generalize Clarity to Nidec Hybrid

* remove unused car import

* whitespace fixes

* remove unneded HondaFlagsSP

* typo fixes

* remove .value from HondaSafetyFlagsSP

* autodetect hybrid

* merge fix

* Apply suggestion

* Apply suggestion

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-11-02 11:57:47 -05:00
infiniteCable2
09c217f287 Basic Safety Tests for Volkswagen MEB (#20)
* Create test_volkswagen_meb.py

* Update longitudinal.h add override safety checks

* Update volkswagen_meb.h cleanup and point to longitudinal.h checks

* Update lateral.h unused custom

* Update safety_declarations.h

* Update test_volkswagen_meb.py clean

* Update lateral.h

* Update safety_declarations.h

* Update volkswagen_meb.h

* Update volkswagen_meb.h

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update volkswagen_meb.h

* Update safety_declarations.h

* Update longitudinal.h

* Update safety_declarations.h

* Update longitudinal.h

* Update volkswagen_meb.h

* Update test_volkswagen_meb.py

* Update common.py adapted long accek safety test with overriding mechanism

* Update common.py

* Update common.py

* Update test_volkswagen_meb.py

* Update common.py

* Update test_volkswagen_meb.py

* Update common.py

* Update common.py

* Update common.py

* Update test_elm327.py adapt test to vw range

* Update routes.py

* Update volkswagen_pq.h cleanup unused

* Update test_volkswagen_pq.py adapt

* Update test_volkswagen_pq.py for now, MADS later if neccessary

* Update test_volkswagen_meb.py

* Update common.py

* Update common.py

* Update common.py

* Update common.py

* Update test_volkswagen_meb.py

* Update common.py

* Update common.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update common.py

* Update common.py

* Update safety_helpers.h

* Update test_volkswagen_meb.py

* Update longitudinal.h

* Update common.py

* Update safety_helpers.py

* Update test_volkswagen_meb.py

* Update longitudinal.h

* Update test_elm327.py

* Update common.py

* Update common.py

* Update test_volkswagen_pq.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update common.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update common.py

* Update test_volkswagen_meb.py

* Update common.py

* Update lateral.h

* Update volkswagen_meb.h

* Update volkswagen_meb.h

* Update safety_helpers.h

* Update safety_helpers.py

* Update safety_helpers.h

* Update safety_helpers.py

* Update safety_helpers.h

* Update common.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update common.py

* Update test_volkswagen_meb.py

* Update safety_helpers.py

* Update common.py

* Update test_volkswagen_meb.py

* Update common.py

* Update common.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update common.py

* Update common.py

* Update test_volkswagen_meb.py

* Update common.py

* Update test_volkswagen_meb.py

* Update volkswagen_meb.h fix

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update common.py

* Update common.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update common.py

* Update common.py

* Update test_volkswagen_meb.py

* Update common.py

* Update common.py

* Revert "Update common.py"

This reverts commit eee29957ab.

* Update common.py

* Update common.py

* Update common.py

* Update common.py

* Update common.py

* Update test_volkswagen_meb.py

* Update lateral.py

* Update common.py

* Update common.py

* Update common.py test

* Update common.py

* Update test_volkswagen_meb.py

* Update common.py

* Update common.py

* Update common.py

* Update common.py

* Update common.py

* Update common.py

* Update common.py

* Update common.py

* Update common.py

* Update test_volkswagen_meb.py

* Update common.py

* Update common.py

* Update common.py

* Update lateral.py

* Update lateral.h

* Update safety_declarations.h

* Update lateral.h

* Update routes.py

* Update routes.py

* Create icbm.py

* Delete opendbc/sunnypilot/car/volkswagen/icbm.py wrong branch

* Update common.py vw diag range

* Update common.py fix

* Update common.py fix vw diag range

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py

* Update test_volkswagen_meb.py fixes

* Update test_volkswagen_meb.py

* Update common.py testing

* Update volkswagen_meb.h fix steer power range

* Update common.py

* Update volkswagen_pq.h

* Update test_volkswagen_pq.py

* Update volkswagen_meb.h

* Delete opendbc/car/volkswagen/pandacan.py

* Update carcontroller.py cleanup

* Update test_volkswagen_meb.py

* Update common.py

* Update vw_mqbevo.dbc

* Update vw_mqbevo.dbc

* Update test_volkswagen_pq.py

---------

Co-authored-by: infiniteCable <75014343+infiniteCable@users.noreply.github.com>
2025-10-28 20:29:40 +01:00
T3vl
337af45352 VW PQ: update Motor_5 signal definitons (#2725)
* VW PQ: update Motor_5 signal definitons

* VW PQ: update carstate to match updated DBC

* VW PQ: update safety mode comments to match updated signal names

* VW PQ: update Motor_5 signal name to match updated DBC

* VW PQ: update DBC to add proper CAN multiplex handling

* Merge commaai/master

---------

Co-authored-by: Jason Young <46612682+jyoung8607@users.noreply.github.com>
2025-10-10 08:06:57 -04:00
T3vl
11f91cfd33 VW PQ: Update Motor_3 & Getriebe_1 Signals (#2724)
* VW PQ: Correct Motor_3 Signals

* VW PQ: update carstate for updated Motor_3 Signals in DBC

* VW PQ: update comments to match updated signals in DBC

* VW PQ: update safety test for updated DBC

* VW PQ: update Getriebe_1 signal definitons

* VW PQ: update Getriebe_1 signals

* VW PQ: update values.py for updated Getriebe_1 signal definitons

* Merge commaai/master

---------

Co-authored-by: Jason Young <46612682+jyoung8607@users.noreply.github.com>
2025-10-10 08:03:26 -04:00
firestar5683
75d20ced7f GM: Non-ACC platforms with steering only support (#229)
* opgm

* sunnylateral

* Revert "sunnylateral"

This reverts commit ac59045c3a11c0ca553e4966f197d55fc7b36229.

* Remove Pedal

* Remove CC_LONG

* oops

* init sunnypilot dedicated flags

* Update car_list.json

* re-enable tests

* slight cleanup

* oopsie

* Update opendbc/car/gm/carcontroller.py

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

* Update opendbc/car/gm/carcontroller.py

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

* Update opendbc/car/gm/interface.py

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

* Ext Attempt

* D param

* Update interface.py

* Try #2

* fix

* need this for safety mode

* lint

* only use car list in tests

* skip test routes for now

* move around

* update car list

* extra

* Update carcontroller.py

* Update interface.py

* Revert "Update carcontroller.py"

This reverts commit 8d4a997f26a4ddf6d2aec768d0f1067eebea932c.

* Update interface.py

* Update interface.py

* Update interface.py

* line

* update MY

* logic fix

* duplicated rx check

* rename and use sunnypilot safety flags

* safety checks for ICE and EV non-ACC

* safety tests for ICE and EV non-ACC

* default should be false

* NO_ACC > NON_ACC

* misra

* set flag for now

* let's make sure it uses the correct checks

* Revert "let's make sure it uses the correct checks"

This reverts commit 0be39cc63ef266c70a4ad4be7078464c419331f4.

* not this pr

* all should have flag

* split fingerprints and add merge_fingerprints

* lint

* start cleanup

* in another PR

* cleanup most in interface

* wrap more

* use get_bit

* update

* undashcam

* dashcam at the end

* uncomment from dashcam for now

* split

* use generations

* more gens

* even more gens

* 23 non-CC bult fingerprints

* treat all as camera for now

* more 17 bolt non acc

* panda doesn't like it and would get stuck in resetting state

* Revert "panda doesn't like it and would get stuck in resetting state"

This reverts commit 4515300cc1f9d0cc02729e505ef7297b46b978ed.

* dashcam untested

* do it

* these are not fwdCamera cars

* less

* not in this list

* none are op long

* unused

* unused

* update list

* uncommented

* no longer needed

* do not include yukon yet

* default all non acc are allowed

* ruff

* cleanup

* safety: these are camera cars

* interface: these are camera cars

* gotta undashcam them

* non pcm cruise only check

---------

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
2025-10-07 19:59:22 -04:00
Jason Wen
6999183714 FCA: Intelligent Cruise Button Management support (#302)
* init safety

* implement

* not used

* type hints

* fix

* parse buttons

* one more try?

* expose in carstate

* just buttons

* FCA: Parse cruise control buttons

* eh

* Revert "just buttons"

This reverts commit cfb83fa351c570a4d762b46f43361d9118d5e07e.

* one last try

* max of 5 hz

* another fix

* consolidate

* make them all the same

* Revert "make them all the same"

This reverts commit 4f933cb61df28468126f91fe0b7bd2b81e9acf14.

* try something new

* ok too fast

* Revert "ok too fast"

This reverts commit 3d2a5a41a8986cf620f4331891830b3274f300ff.

* Revert "try something new"

This reverts commit 0e16426c4349e8a8df54ada8ad6050a75d203aef.

* new one again

* no longer used
2025-10-05 21:10:45 -04:00
Jason Wen
296f6b920c Tesla: MADS full support with VEHICLE bus harness (#239)
* Tesla: MADS full support with VEHICLE bus harness

* fix msg size

* enable safety

* safety tests

* 6 instead of 8 bytes

* Revert "6 instead of 8 bytes"

This reverts commit 240db92d37397b67196a5dbf52fcf4f7d63d3104.
2025-10-02 14:07:08 -04:00
Jason Wen
862828ad6f Hyundai: Intelligent Cruise Button Management support (#281)
* more infra setup

* try it out for HKG for now

* oops

* legacy

* more

* icbm

* need to allow

* name

* use cs is_metric

* just send it

* Using the param store properly for the is metric

* try this out

* Revert "try this out"

This reverts commit 9da11cd33da85be94719fee18111c1bcb13e09c7.

* try new method

* this is slightly better

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
2025-10-01 22:59:13 -04:00
Jason Wen
dfcfacb667 Longitudinal: reimplement Gas Interceptor (comma Pedal) support (#295)
* init

* readd dbc

* no more gas

* fixes

* no secoc

* mutation

* fix

* fix

* sdsu

* fixes

* another fix

* dead routes

* wrong dead route

* ok not that dead

* mutation

* some tests

* Revert "no more gas"

This reverts commit 8e2cec84b835a15da89f8857dd74b649017a5fc8.

* deprecated

* recheck openpilot long availability

* revert

* need for safety tests

* no need

* old tuning

* Revert "old tuning"

This reverts commit e495e83e0cd5ba3dff3f3b7ce39bce7b398201b2.

* alt brake has sdsu too

* ignore quality

* already separated

* no disengage on gas

* slight

* more coverage

* slight fixes

* explicitly skip it

* skip counters

* make sure they're skipped

* honda pedal init

* honda pedal opendbc

* some fixes

* already gate at rx checks init

* old tuning for TSS-P

* flipped

* apparently it's yucky, reverting most

* rename

* fix dbc

* no way

* fix

* test sdsu distance

* halved the max

* final tuning for pedal
2025-09-30 22:07:52 -04:00
Jason Young
1f68add3d0 fix build breakage (#2819)
* fix build breakage

* more
2025-09-29 17:34:02 -04:00
Chris Patterson
4d93a55906 Toyota: Add SECOC longitudinal control (#1385)
* Add secoc ACC command

* Remove commented out secoc long disable code

* Add Toyota 2021 SecOC route

* Send 0 accel for ACC_CONTROL to match stock

* Update opendbc/car/toyota/carcontroller.py

Co-authored-by: Jason Young <46612682+jyoung8607@users.noreply.github.com>

* Add new ACC steering wheel message for SecOC cars. Update distance_button with the new message.

* Add new DBC file for Toyota SecOC cars.

* Update Toyota Rav4 Prime and 4th Gen Sienna to use SecOC DBC file.

* Update carstate.py l

* dont save button state on secoc

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

* Update opendbc/car/toyota/carstate.py

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

* Remove unreachable code

* Move secoc safety to opendbc

* Update R4P SecOC route

* Build safety with -Wextra

* safety: relay malfunction config (#1959)

* Do Toyota relay malfunction config

* clean up

* not needed

* rm this

* rm

* fix

* great name (rename after https://github.com/commaai/opendbc/pull/1954)

* do gm

* need this since we will dynamically block it

* subie

* some more brands

* Ford

* Chrysler

* Hyundai

* huge oof hyundai

* toyota & vw

* fix

* tesla

* 0x194 isn't on Honda Bosch

* Honda: we can check bus 1 for 0xe4

* misra

* static

* ugh need this

* correct

* nl

* like

* space

* Hyundai: dashcam FCEV (#1973)

* Disable FCEV

* coverage

* fixme

* misra

misra

* Hyundai CAN FD: Accurate hybrid powertrain detection (#1891)

* Hyundai CAN FD: Accurate hybrid  powertrain detection

* label message names

* use 0xFA

* Tesla: Autopilot enabled signal (#1978)

* new Tesla signals

* consistent

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Tesla: fix incorrect DBC msg length (#1980)

actually DBC is wrong

* Subaru Pre-Global: fix missing rx checks (#1982)

passes tm

* Honda Nidec: missing brake command rx check (#1981)

* missing honda rx nidec brake command

* misra

* move up

* Honda safety: only test alt brake for alt brake param

split from https://github.com/commaai/opendbc/pull/1903

* safety tests: remove redundant test skips (#1983)

remove useless skiptests

* GM safety: add missing regen rx check (#1984)

* from pr

* forgot

* fix test

* cleaner

* misra

* Fingerprint: 2022 Civic Si (#1952)

* 2022 Civic Si

* fix

* Hyundai CAN FD safety: more clear what is common (#1986)

* more clear what is common

* here too

* Hyundai CANFD safety tests: common safety param combinations (#1987)

clean this up

* Hyundai CAN FD safety: replace alt buttons live detection with param (#1985)

* alt buttons needs to be checked with the param

* flip

* do tests

* Hyundai safety: add missing rx checks (#1989)

* add torque driver addr check and always check buttons (for interaction)

* fix

* safety: rename allowed

less confusing next to `safety_allowed`

* safety: only run rx hooks on whitelisted msgs (#1903)

* don't run rx hook on non-allowed messages

* better name

* fix toyota (bug w/ secoc)

* looks like honda is broken

* rivian is also bad! (missing EPAS_SystemStatus)

* misra so far

rivian is also bad!

* nissan is fine

* tesla is also borked

* mazda's good

* subaru's fine

* gm broke

* ford's good

* chrysler's good

* vw is good

* hyundai is broky, canfd is good

* Fix Rivian

* revert these

* do relay malfunction check on all addresses

* Found a Tesla bug

* fix subaru pg

* body

* rm

* Fix Honda

* stash

* fix Hyundai

* fix

* Hyundai: buttons are used always (for interaction)

* revert tesla

* body: we don't rx _torque_cmd_msg

* Revert "body: we don't rx _torque_cmd_msg"

This reverts commit 2f973f603a34d07386ca810c78a871e9723c6444.

* simpler

* GM EV param for correct rxchecks

* no need

* might read better

* rm extras

* fix hyundai

* we weren't testing lfa (non-hda2), alt buttons, long

* fix

* tested

* rm

* not needed

* clean up

* that too

* .

* Hyundai: Fix FCEV RX check and move out of dashcam (#1974)

* Revert "Hyundai: dashcam FCEV (#1973)"

This reverts commit 6254215a84.

* Hyundai: Fix FCEV RX check and move out of dashcam

* less duplication

* line

* same

* add missing test

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* HKG: spas remove unused frame param (#1966)

spas remove unused frame param

* Added FW for Mazda CX5 2025 (#1911)

Add other CX-5 2025 FP fw

* Hyundai CAN FD: Fix steering messages in safety replay (#1975)

* Hyundai: split car controller by CAN FD (#1990)

* split main can sends part

* use_clu11 was confusing

* better

* bet

* clean up

* Toyota: add static rx check for alt brake (#1991)

rx check for alt brake

* whoops bad pull

* PR suggestions

* Remove unnecessary parens

* PR suggestions

* Fix some logical errors

* Fix tester present test

* Update safety for non-op long secoc

* Update tests

* Update safety

* Update tests

* whitespace adjustment for clarity

* PR suggestions

---------

Co-authored-by: Jason Young <46612682+jyoung8607@users.noreply.github.com>
Co-authored-by: PenitentTangent2401 <klabuschagne@kd9atp.com>
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Lukas <61192133+lukasloetkolben@users.noreply.github.com>
Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
Co-authored-by: royjr <royjr96@gmail.com>
Co-authored-by: kenhuang14 <97474725+kenhuang14@users.noreply.github.com>
Co-authored-by: Warren Togami <wtogami@gmail.com>
Co-authored-by: Jason Young <jyoung8607@gmail.com>
2025-09-29 13:05:58 -04:00
Adeeb Shihadeh
aa3d32a63b safety: remove board/ folder (#2814)
* safety: remove board/ folder

* debug build
2025-09-28 13:35:10 -07:00
Adeeb Shihadeh
d2cc46ac15 safety: namespace helpers (#2813)
* declarations

* lowercase

* namespace

* screaming
2025-09-28 13:20:26 -07:00
Adeeb Shihadeh
e013b2b539 always build libsafety for mutation tests (#2811) 2025-09-27 17:57:51 -07:00
Adeeb Shihadeh
0c90bdb434 build system cleanups (#2810)
* build system cleanups

* fix coverage
2025-09-27 17:45:03 -07:00