Commit Graph

57 Commits

Author SHA1 Message Date
Adeeb Shihadeh
92c26f71e6 remove dead mull stuff (#2208)
* remove dead mull stuff

* rm clang

* fix
2025-05-19 19:40:50 -07:00
Adeeb Shihadeh
8bd83750c2 setup opendbc dependency properly (#2202)
* rm that

* bump

* lil more

* update

* fix libpanda

* update

* fix misra

* python3?

* update ref

* fix mutation
2025-05-17 19:15:19 -07:00
Trey Moen
6adac802b5 fix(macos): macOS 15 and greater (#2196)
* fix macos

* Revert "fix macos"

This reverts commit f52d30c97c43c1d66e5447b194d6e2f599c81187.

* use gcc on < macOS 15

* link to issue
2025-05-13 10:27:00 -07:00
Shane Smiskol
9804e2607e Move car safety modes to opendbc (#2143)
* move safety tests

* move libsafety

* move safety

* remove safety test job

* fix compilation

* update ref

* rm safety mutation test

* fix misra test

* no safety here

* fix build for both local and docker

* already tested

* fix misra mutation

* move Safety Model readme section to opendbc

* and panda

* fix

* in

* not here

* not here
2025-02-19 17:19:18 -08:00
Shane Smiskol
b2b28f9326 split libpanda library (#2149)
* duplicate libpanda

* rename

rename

* update libpanda to remove safety helpers

* libpanda -> libsafety

* remove some stuff in libsafety

* rm some stuff from safety.c

* libc

* fix

* dont include safety helpers
2025-02-12 21:24:26 -08:00
Willem Melching
4a11d52e07 Control over FD flag of CAN messages (#2085)
* Control over FD flag of CAN messages

* misra
2024-11-21 11:04:09 -08:00
Maxime Desroches
b6644f7a35 revert libpanda with clang (#2044)
* revert

* adapt this
2024-09-26 12:35:45 -07:00
Maxime Desroches
78b49ab155 safety mutation tests (#2040)
* mutation

* clone

* origin

* get diff

* better example

* better

* fix docker

* work on push

* make test fail

* real change

* test all modes

* ignore

* better

* reco

* fix

* no libpanda on device

* curl

* nl

* nl again

* delete

* clean

* clean

* this

* add this back

* cleanup
2024-09-25 21:56:09 -07:00
Maxime Desroches
fb67bda00e compile libpanda with clang (#2041)
* clang

* report

* safety.h

* fix lines

* cleaner

* better

* remove this

* revert this

* fix

* tici build

* revert

* revert

* fix
2024-09-25 20:14:12 -07:00
Maxime Desroches
32eecd7211 misra8.4: board/*.h (#2026)
* main

* can_comms

* main_declarations->main_definitions

* rename this also

* can_definitions

* faults

* power_saving

* provision

* gitversion

* not included

* no include for now
2024-09-19 21:15:08 -07:00
Hoang Bui
f6375848ca add set_gas_pressed_prev() helper (#1986)
add set_gas_pressed_prev helper
2024-07-17 20:49:10 -07:00
Adeeb Shihadeh
de061e4f73 remove rest of gmlan (#1908)
* remove rest of gmlan

* fix

* update struct

* update
2024-03-21 13:56:36 -07:00
Adeeb Shihadeh
567dbfe6d8 remove comma pedal (#1902) 2024-03-17 22:22:46 -07:00
Cameron Clough
0c7d5f11d7 use pyupgrade to update syntax (#1889) 2024-02-24 13:56:28 -08:00
Adeeb Shihadeh
6eed036473 (almost) enable cppcheck unusedFunction (#1875)
* remove some unused

* more

* kinda works

* rest are false positives

* disable for now

* add back exhaustive
2024-02-17 14:16:15 -08:00
Shane Smiskol
6e645d2d33 safety: fully reset dynamic rx check fields (#1767)
* stash

* clean up

* clean up

* more clean up

* just status

* status

* does nothing

* not here
2023-12-15 21:59:19 -08:00
Justin Newberry
7e2b312fa8 helpers: get last vehicle speed (#1777)
get last speed
2023-12-15 14:37:28 -08:00
Shane Smiskol
bb75afc84e safety: add safety param for gas interceptor (#1735)
* some refactoring still needing to be done here

* 50hz

* set rx checks

* tx msgs

* test

* fix

* forgot to check this since it's static now

* enable_gas_interceptor

* more

* remove int funcs since are common

* generic!

* not generic

* need to set counter now

* set_enable_gas_interceptor not needed

* already reset in safety init

* fix test

* remove gas_interceptor_detected (partly)

* oof need for hjonda too

* edit structs

* more honda (still broken)

* fix typo

* shift these down

* can also make this extensible

* stash

* defining classes is much simpler, maybe in future we will have some sort of wrapper after some more thought

* remove create_interceptor_test now

* add lta interceptor

* clean up print

* clean up

* once

* type hint

* rm

* no interceptor with stock long + good test

* add interceptor counter to honda

* need alt interceptor + set rx checks for honda

* we were never testing button enable with nidec + interceptor!

honda almost all passing

* these fixes make sense

* clean up

* better

* clean up test cov

* clean up

* not needed

* fix tx msgs

* clean up

* cppcheck

* fix

* unnecessary
2023-12-14 15:22:17 -08:00
Shane Smiskol
a5753a2077 safety helpers: hide debug print for now 2023-12-09 02:28:10 -08:00
Shane Smiskol
2ee6e36e99 safety replay: set angle measurement (#1752)
set angle meas in safety replay
2023-11-29 23:04:14 -08:00
Adeeb Shihadeh
f1cd12651c safety: remove LIN hook (#1741)
* safety: remove LIN hook

* rm more
2023-11-23 16:30:20 -08:00
Shane Smiskol
c345bc3cae Rename forgotten functions (#1731)
fix forgotten functions
2023-11-20 11:37:51 -08:00
Adeeb Shihadeh
933a301cad safety: do TX whitelist check in top level hook (#1730)
* new fields

* add check

* do first one

* first two

* all done

* fix all output

* simpler

* unused now

* fix body and elm

* fix that

* fix misra

* revert that
2023-11-20 00:15:46 -08:00
Adeeb Shihadeh
b1ca493580 safety: fix ambiguous names (#1729)
renames
2023-11-19 22:44:13 -08:00
Adeeb Shihadeh
606d7580c8 safety: cleanup init return struct (#1728)
* try 1

* do the rest

* fix misra
2023-11-19 21:05:53 -08:00
Adeeb Shihadeh
c6248d6504 safety: cleanup ints that are bools (#1726)
* safety: cleanup ints that are bools

* update tests
2023-11-19 16:47:09 -08:00
Shane Smiskol
e7f8b598d7 safety tests: safety_defaults (#1705)
* test safety_defaults

* rename panda safety test

* add PandaSafetyTest base back

* remove car-specific tests from PandaSafetyTest (for ALLOUTPUT, NOOUTPUT, ELM327 tests)

duh

* Add TestAllOutput comparison

* needs to be list

* fix extra loops (faster)

* create lin msg correctly

according to ad79b7f4d2

* use bytes

* some clean up

* revert coverage

* ensure same

* fix typing

* rx hook: scan all addrs

* this is cleanest

* parameterized_class doesn't work nicely

* Revert "parameterized_class doesn't work nicely"

This reverts commit 3a46f1f5140d2c6070ce99b73b6022cf93c2916d.

* add test for silent

* rm spaces

* common?

forgot

* Revert "common?"

This reverts commit f136ae276fa9c9a9fa3ac5c04382c5e1ef38f383.

* Update tests/safety/test_defaults.py
2023-11-06 16:19:27 -08:00
Shane Smiskol
d2f9e14062 Honda: add latching AEB test (#1704)
* use get bit

* simplify parsing

* add get_honda_fwd_brake for latching test

rm print

* can also test with txing brake

* Revert "can also test with txing brake"

This reverts commit f75eb6eb562268a2d297656080e346594ab0c85b.

* rm this
2023-10-31 21:20:59 -07:00
Shane Smiskol
bc69d25335 safety tests: clean up state reset (#1703)
* this is already reset in set_safety_hooks

* move these car-specific variables into their own init hooks
2023-10-31 21:19:55 -07:00
Shane Smiskol
f3bdfdd435 Rename safety coverage flag 2023-10-30 11:43:56 -07:00
Shane Smiskol
da66779b43 safety: coverage report (#1696)
* coverage report

* test script

* not needed

* option

* options

* re-build if file missing

* rename

* rename flag

* just always build

* cmt

* fix rebuild, panda.c is what does gens gcno

* clean up

* check coverage

* rename

* add skip flag

* Revert "add skip flag"

This reverts commit 6991c174cebb8529b67199033e017155eff917b0.

* both do same thing

* clean up script

* don't test here

* Revert "don't test here"

This reverts commit 43fe4c961fcc1693d5efc33cabb8162be56a1b88.

* try running in CI

* nproc

* move

* Revert "try running in CI"

This reverts commit 912017c7fa93ba3faf31267b9b144cc9faee591b.

* don't test here

* fix path

* re-compiling does this
2023-10-25 22:01:01 -07:00
Adeeb Shihadeh
b6e37f25b6 Remove flash logging (#1674)
* Revert "Disable flash logging (#1667)"

This reverts commit 62db60595b.

* Revert "Faster log retrieval (#1484)"

This reverts commit 694aae9c26.

* Revert "Flash bounds checking outside of bootstub (#1459)"

This reverts commit 054344de6b.

* Revert "Logging (#1445)"

This reverts commit 0cc91a7f7b.

* cleanup

* cleanup
2023-09-30 12:49:46 -07:00
Adeeb Shihadeh
62db60595b Disable flash logging (#1667)
* disable logging to flash

* update tests

* fix hitl
2023-09-21 15:28:19 -07:00
Willem Melching
a48678f625 MacOS: Homebrew GCC is now version 13 (#1603) 2023-08-24 13:52:59 -07:00
Justin Newberry
4ea50fbb09 Ruff: propgate config from OP (#1579) 2023-08-14 12:52:02 -07:00
Adeeb Shihadeh
b976cf426a libpanda: silence build warning 2023-08-04 22:16:49 -07:00
Justin Newberry
7b6806c270 Safety: Add desired angle to safety helpers (#1554)
add desired angle
2023-08-04 17:30:10 -07:00
Adeeb Shihadeh
1950ba6f83 cleanup bus count constant 2023-08-04 10:47:03 -07:00
Adeeb Shihadeh
f37f8d90ba cleanup build, prep for jungle (#1549)
* cleanup build, prep for jungle

* cleanup

* update pedal obj path
2023-08-03 19:07:41 -07:00
Shane Smiskol
8e31711aa2 safety helpers: cruise engaged prev setter (#1511)
* bbb

* Apply suggestions from code review
2023-07-14 18:21:28 -07:00
Adeeb Shihadeh
21843092ff bump to python 3.11.4 (#1481)
* bump to python 3.11.4

* Update .pre-commit-config.yaml

* lint

* import

* no | yet

* rm ignores

* Update tests/libpanda/libpanda_py.py

---------

Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
2023-07-01 17:43:34 -07:00
Robbe Derks
0cc91a7f7b Logging (#1445)
* try 1

* some fixes

* fix some misra

* first poc working

* more things

* more misra fixes

* fix misra

* add rate limiting

* fix misra

* add some unit tests through libpanda

* add more tests and fix some stuff

* fix misra again

* add startup log hitl test

* list

* don't fail on wrong timestamps

* improvements

* fix tests

* expected logs test?

* not sure why this passed

* oh, it doesn't reset

* only show last few

* guess at expected logs

* needs this

* ugh

* reduce compiler warnings

* adjust expected logs

* this is correct

* is it really 1?

* min max

* reduce spam in SPI test

* some cleanup
2023-06-13 17:00:56 +02:00
Adeeb Shihadeh
52f96bac68 spi: nack on can tx endpoint if buffer is full (#1426)
* spi: nack on can tx endpoint if buffer is full

* handle in python lib

* fix timeout

* fix timeout

* fix linter

* cleanup

* fix

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-05-19 22:43:34 -07:00
Kacper Rączy
822a7367c1 macOS: use homebrew gcc using version suffix. update setup instructions (#1409)
* Add version suffix to gcc on Darwin

* Update macos setup intructions

* Delete unused SConscript at tests/

* Move gcc stuff to tests/libpanda/SConscript
2023-05-12 11:06:08 -07:00
Shane Smiskol
3a64b6ccb5 safety: make vehicle_speed a sample (#1391)
* convert vehicle_speed into sample_t, change no behavior

* draft

* round

* test

* clean up

* round

* round all

* use min

* remove round macro from this PR

* reset speed measurement

* debug

* bbd

* rm

* revert

* test above and below

* need this now

* misra pt 1

* misra pt 2

* misra pt 3

* i don't understand this one, not different from other cases

* fix test

* test

* revert that

* draft

* test the sample_t works properly for safety modes that use it (angle only)

* can combine these tests

* test decimals

* global

* misra

comment

* suggestions

* fix

* use new helper
2023-05-04 03:37:56 +00:00
Shane Smiskol
5a9603600e safety tests: reset safety helper (#1398)
* reset safety

* use it

* clean it up

* two lines

* fix python linting
2023-05-04 02:51:08 +00:00
Shane Smiskol
dbe941004a safety: reset torque_meas on init properly (#1250)
* reset min torque meas too

* add test that fails

* cmt

* cmt

* clean up test

* don't be random

* above test tests this pretty much

* test angle too

* fix

* also test driver torque

* whoops

* whoops
2023-04-28 17:45:02 -07:00
Adeeb Shihadeh
7aef934d4c Fix undefined behavior in GET_BYTES macro (#1367) 2023-04-26 22:59:58 -07:00
Adeeb Shihadeh
85cc70d4aa safety: only pass addr to fwd hook (#1339) 2023-04-08 16:45:59 -07:00
Adeeb Shihadeh
2a567674dc Tesla: move reading AEB state to RX hook (#1340) 2023-04-08 16:20:38 -07:00