Commit Graph

46 Commits

Author SHA1 Message Date
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 3a46f1f514.

* add test for silent

* rm spaces

* common?

forgot

* Revert "common?"

This reverts commit f136ae276f.

* 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 f75eb6eb56.

* 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 6991c174ce.

* both do same thing

* clean up script

* don't test here

* Revert "don't test here"

This reverts commit 43fe4c961f.

* try running in CI

* nproc

* move

* Revert "try running in CI"

This reverts commit 912017c7fa.

* 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
martinl f674084db5
MacOS: use gcc-12 for building tests (#1241)
* MacOS: use gcc-12 for building tests

* Update README.md

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-03-13 16:21:43 -07:00
Shane Smiskol 8bb62cf226
Ford: check quality flag (#1264)
* quality flag support

* add NULL to other safety modes

* add to safety helpers debug print

* comment

* rename to quality_flag and add comment
2023-02-24 22:54:51 -08:00
Robbe Derks 11d90f9e78
No more magic for the can chunks (#1191)
* no more magic

* bump version

* no need for this

* comment cleanup

* add comms_can_reset tests

* we can't ensure this for compatibility reasons

* add CANPacket_t checksum
2023-01-13 10:59:58 -08:00
Robbe Derks 288e14cde9
Simple CAN chunking (#1011)
* simple chunking

* make pylint happy

* misra happy?

* good practice anyways since we cast to a uint32_t later

* fix bug dropping packets

* minor fixes + prepare for shared lib testing

* working library now

* first queue test

* can send test

* fix running in github actions?

* add big rx test and fix it

* don't complain about empty buffers

* disable for now

* comment

* test runs

* some cleanup

* merge those

* test works

* rm that

* comment

* proper logging

* makes things too slow

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-30 23:38:00 -08:00
Adeeb Shihadeh 88b30e1a84
CAN comms test (#1181)
* CAN comms test

* remove those

* cleanup

* little more
2022-11-30 22:12:28 -08:00
Shane Smiskol 2ae7b9a4d5
scons: put targets in global SConscript (#1180)
* Revert "remove unused scons argument (#1169)"

This reverts commit 702e5281d8.

* try this

* clean up

* default true

* default true

* already built
2022-11-30 20:22:09 -08:00
Adeeb Shihadeh 1f73c70fdc
generic libpanda for tests (#1177)
* generic libpanda for tests

* move safety helpers

* fix ci build

* fix running

* opendbc is in the image

* make can packet

* rename
2022-11-30 17:41:24 -08:00