Commit Graph

77 Commits

Author SHA1 Message Date
Justin Newberry 4d90edada0 replace 2024-01-12 11:13:17 -08:00
Shane Smiskol c57a3c2d15
safety replay: support Nissan (#1753)
* nissan safety replay

* hex
2023-11-29 23:07:25 -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
Shane Smiskol c345bc3cae
Rename forgotten functions (#1731)
fix forgotten functions
2023-11-20 11:37:51 -08:00
Shane Smiskol 229107f120
replay drive: fix space formatting 2023-10-19 19:57:10 -07:00
Shane Smiskol 549fa32fc7
safety replay: support Toyota LTA angle control (#1693)
* safety replay: support toyota lta

* one line
2023-10-17 16:48:13 -07:00
Justin Newberry 104d708547
Precommit: ensure executable bit is set (#1650)
* precommit ensure executable

* fix the violations

* the correct shebang
2023-09-05 15:32:44 -07:00
Adeeb Shihadeh 57ec466a91
prefix openpilot imports (#1593) 2023-08-20 17:50:31 -07:00
Adeeb Shihadeh 61e987f6e2
remove safety replay test (#1569) 2023-08-07 18:38:01 -07:00
Justin Newberry 0a738b7ee8
Subaru: rename legacy to preglobal (#1415)
* rename

* missing some variables

* fix find/replace error
2023-05-15 17:22:40 -07:00
Shane Smiskol 810df6b5c1
safety replay: safety tick (#1364)
* make explicit, there was no bug only because the if statement is identical to above

* debug

* Revert "debug"

This reverts commit 2ec83677c3.

* Revert "make explicit, there was no bug only because the if statement is identical to above"

This reverts commit fcb2a106b9.

* fixes

* remove

* allow 1 second

* remove

* clean up

* call every can msg

* safety_tick_rx_invalid like test_models

* order

* skip end

* try that
2023-05-03 05:01:44 +00:00
Shane Smiskol 14cfb78ab2
Subaru: add gen 2 Outback route (#1386)
gen2 outback route
2023-05-02 13:45:21 -07:00
Shane Smiskol 1d1284e863 Revert "Subaru: add gen 2 Outback route (#1385)"
This reverts commit c43f33191c.
2023-05-02 13:18:26 -07:00
Shane Smiskol c43f33191c
Subaru: add gen 2 Outback route (#1385)
gen2 outback route
2023-05-02 13:07:50 -07:00
Shane Smiskol 2fb25c4a0b
Subaru: fix Impreza replay route (#1384)
* fix

* impreza route
2023-05-02 01:21:33 -07:00
Shane Smiskol 23b5130de9
replay drive: fixes (#1362)
* make explicit, there was no bug only because the if statement is identical to above

* debug

* Revert "debug"

This reverts commit 2ec83677c3.

* Revert "make explicit, there was no bug only because the if statement is identical to above"

This reverts commit fcb2a106b9.

* fixes

* clean that up

* and this
2023-04-26 17:45:04 -07:00
AlexandreSato 6cb3561f16
safety replay: update Honda steer value getter (#1292)
* safety replay: update Honda steer value getter 

I think now it´s right!

```
BO_ 228 STEERING_CONTROL: 5 EON
  SG_ STEER_TORQUE : 7|16@0- (1,0) [-4096|4096] "" EPS
```

* ops
2023-03-25 19:02:34 -07:00
AlexandreSato 6585cae978
safety replay: update steer value getter (#1273)
* toyota torque on toyota for safety replay

* Honda torque on Honda for safety replay

* Chrysler torque on Chrysler for safety replay

* Subaru torque on Subaru for safety replay

* fix

* Honda is Big Endian!

* Update helpers.py

* we already do this every where

* Update tests/safety_replay/helpers.py

* Update tests/safety_replay/helpers.py

* Update tests/safety_replay/helpers.py

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-03-15 21:19:05 -07:00
Shane Smiskol e0e754de2c
safety replay: make Ford work (#1272)
* make replay work for ford

* revert debugging stuff

* clean that up
2023-03-03 20:48:04 -08:00
Shane Smiskol 17450b277d
Same mypy checks as openpilot (#1233)
* no specific revision for mypy

* bump to ~OP version

* same warnings as openpilot

* ignore

* fix

* rm that

* switch to ignore so mypy lets us know when it's fixed

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-02-11 12:25:13 -08:00
Adeeb Shihadeh 9e5c28e568 safety replay updates for CAN-FD 2022-12-13 20:21:04 -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
Shane Smiskol 72fd7775ab
safety replay: fix gm segments (#1147)
get torque on gm for safety replay
2022-11-10 17:14:32 -08:00
Shane Smiskol a01513d970
safety replay: fix hyundai segments (#1140)
* fix hyundai safety replay

* clean up
2022-11-08 13:37:02 -08:00
Shane Smiskol 73a4099efb
safety replay: fix setting desired torque (#1127)
* .

* Update tests/safety_replay/helpers.py
2022-11-03 00:23:42 -07:00
Jason Young 0ca6d9d924
VW MQB: Longitudinal safety (#920)
* VW MQB: Longitudinal safety

* disregard ACC_13 for now

* abstraction cleanup

* fix long control flag name

* quick hack

* VW MQB: Cleanup message counter handling

* various cleanup

* try without ACC_04

* follow DBC updates

* bump Docker opendbc ref

* additional main switch and cancel handling/testing

* pacify linter

* style

* handle the overlap tests like HKG CANFD

* update replay route

* commonize elements between MQB and PQ

* Apply suggestions from code review

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

* proper use of globals/conventions

* make these global

* this is better for now

* better comment on accel boundary scaling

* spelling error

* reset on init

* try bumping openpilot

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-01 08:13:58 -07:00
Jason Young 199bc10db3
VW PQ: Longitudinal control safety, lateral torque update (#989)
* VW PQ: Updated checksum and counter handling

* first pass PQ long control safety

* refactor stock test to prep for long test

* long control tests

* falling edge enable logic and tests

* accidentally worked but this is better

* test misra/cppcheck evaluation of debug build

* Revert "test misra/cppcheck evaluation of debug build"

This reverts commit 7594fc5e2f.

* allow use of manufacturer ramp-up rate

* soften wheel-touch threshold

* fix tests

* check/test ACC main switch state

* fix CRC for Motor_5

* derp

* retry CI

* try that again

* fuuuu

* fix Motor_5 checksum validation

* use existing acc_main_on global

* re-pin opendbc

* no need for resume spam in longitudinal mode

* concise

* consistency cleanup

* comment and whitespace cleanup

* more cleanup

* more

* restore driver torque threshold

* add long control replay route

* obsolete comment

* proper flag name

* wild to mild-ish

* bump openpilot ref

* Update test_safety_replay.py

* handle non existent routes

* comment consistency/polish

* flip comparison order for falling edge clarity

* restore refs

* read the diff next time, speedy

* srsly

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-08-12 18:50:00 -07:00
Adeeb Shihadeh 4b86b83991
Subaru: support Outback and Global Gen 2 (#991)
* Subaru: support Outback and Global Gen 2

* send 0x321

* check bus

* fwd that

* gen2 limits

* lower max steer

* update safety replay route
2022-07-29 20:44:41 -07:00
Adeeb Shihadeh fae3ee2e81
Chrysler: Ram 1500 support (#969)
* RamInit

* Some fixes

* ram param

* cleanup steering

* invert

* couple fixups

* tests pass

* check that

* misra fixes

* same limits

* revert that

* remove those

Co-authored-by: Jonathan <jraycec@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-07-06 22:50:29 -07:00
Shane Smiskol 3dbd30864e
Honda Civic 2022 (radarless): car safety (#942)
* civic 2022

* remove

* maybe not the right way

* Honda Radarless: add tests

* update

* different bus

* other bus

* Revert "other bus"

This reverts commit 691e045f87.

* add new HUD message

* add

* different bus

* correct freq

* small updates

* comma

* remove

* remove for now

* missing

* not needed

* make into a safety param and clean up

* this can be reverted

* clean up tests (something's broken)

* fix some errors

* this message doesn't exist on any bus

* this car doesn't have BRAKE_MODULE

* make safety more explicit and fix button safety

* fix some tests

* fix tests

formatting

clean up

* radarless uses SCM_FEEDBACK too

* fix tx msgs, clean up, make test common between bosch tests

* misra

* Fix python linting errors

add comment

* not sure where that came from

* add comments

add comments

* we can guarantee honda_bosch_long is true only if not radarless

* these are the same! 🎉

* use updated route with correct tx msgs

* helper pt bus function

* this is explained above

* use function

* no more blocked messages!

* bump openpilot

* comment

* line too long

* needs system

* send on bus 0

* Camera needs bus 2 for buttons

This reverts commit f90db5d359.

* fix button tests

* bump openpilot

* move this down

* make this explicit

* comments

Co-authored-by: vanillagorillaa <ntmccoy@yahoo.com>
Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
2022-06-16 19:02:44 -07:00
Shane Smiskol 6c1738814b
safety replay: set alternative experience (#961)
* Set alternative experience in safety replay

* fix

* smaller clean up diff
2022-06-13 10:59:27 -07:00
Adeeb Shihadeh 7986b8b1e4 make safety replay nice 2022-03-25 20:00:44 -07:00
Adeeb Shihadeh 224736b22a no more wraparound 2022-01-02 14:49:40 -08:00
Adeeb Shihadeh 652367d2e8
Honda: add support for new Bosch LKAS_HUD msgs (#793) 2021-12-05 13:10:47 -08:00
Adeeb Shihadeh c9992a80c0 bosch_harness -> bosch 2021-11-21 14:51:47 -08:00
Adeeb Shihadeh 5d2d4ce1e7
Honda: remove bosch giraffe support (#791) 2021-11-18 23:35:14 -08:00
Igor Biletskyy ae26b75d7b
CAN_FIFOMailBox to CANPacket struct + USB dynamic packet size (#739)
* Squashed commits, no cleanup

* Few fixes

* No init = garbage

* Only receive with new canpacket

* Add send with canpacket

* Revert "Add send with canpacket"

This reverts commit 7d06686ddd6d447c714b5289d31af24403d36931.

* Packet must be aligned to word, or bad performance

* Cleaner

* Fix tests

* Tests...

* MISRA 10.4

* More MISRA

* libpandasafety_py

* cffi

* even more tests...

* typo

* ...

* ...

* ...

* Slight cleanup

* MISRA 6.1

* MISRA 17.7

* Bug in bxcan + even style

* MISRA 10.1

* Revert "MISRA 10.1"

This reverts commit 404ae7fcc39556f80f528de9015702e69f4ea0a5.

* ...

* MISRA 10.1 and 10.4 suppress until next PR

* MISRA 20.1

* ...

* test_honda

* ...

* ...

* test_toyota

* test_volkswagen_mqb

* test_volkswagen_pq

* Sketchy thing...

* Revert "Sketchy thing..."

This reverts commit 3b2e5715bdc1954f7b7b3b7469ba3d0eaa06bdf9.

* remove comment

* bxcan extended address bug

* Concept, experimental dynamic usb packet size

* increase each buffer to 10240 bytes

* raise python bulk read/write limits

* ...

* Move packet size to start

* Experimental send, stream-like

* New receive test, stream-like

* cleanup

* cleanup + rebase fixes

* MISRA

* Extra receive method, stream-like, commented out

* type change

* Revert back to buffer for send, stream commented

* forgot ZLP

* lower buffer, add rx failsafe

* ... remove ZLP

* return ZLP back

* Add tx checks to panda fw

* TX stream with counter

* fix counter overflow

* 13 free slots should be enough

* limit tx usb packet

* ...

* Revert max_bulk_msg doubling

* python lib improve speed

* Stream with counter for RX, dirty, needs cleanup

* Increase chunk length to 4096 bytes

* cleanup fdcan.h

* cleanup __init__.py

* MISRA 12.1

* MISRA 10.8

* remove non-streaming usb functions

* more main.c cleanup

* MISRA 15.6

* MISRA 15.5

* MISRA 18.4 and suppress objectIndex

* handling usb pakcets > 63bytes, naming and cleanup

* Cleanup old from tests and update CANPacket_t struct

* Switch to 4 bit DLC instead of 6 bit length

* ops)

* ...

* pylint

* receive python buffer increase

* USB increase receive packet len

* tweak buffers

* No need for so high limits

* MISRA 20.1 workaround

* performance tweaks

* cleanup, dlc to data_len_code naming

* main.c naming

* comments and cleanup for main.c usb

* clean py lib

* pylint

* do not discard good rx messages on stream fail

* cleanups

* naming

* remove bitstruct lib and lower tx limit

* bitstruct lefovers

* fix bug in VW test

* remove adjusting data size and assert on wrong len

* ...

* test new memcpy before merging

* Revert "test new memcpy before merging"

This reverts commit 399465a264835061adabdd785718c4b6fc18c267.

* macros for to/fromuint8_t array

* MISRA hates me!

* tests.c include macros instead

* move CANPacket to can_definitions.h

* vw_pq python test fix

* new memcpy test, REMOVE

* check without alignment

* revert macros for uint8 arrays

* Revert "revert macros for uint8 arrays"

This reverts commit 581a9db735a42d0d68200bd270d87a8fd34e43fe.

* check assert

* Revert "check assert"

This reverts commit 9e970d029a50597a1718b2bb0260196c050fd77f.

* one more variation

* Revert "one more variation"

This reverts commit f6c0528b7ac7e125750dc0d9445c7ce97f6954b5.

* what about read performance

* Revert "what about read performance"

This reverts commit d2610f90958a816fe7f1822157a84f85e97d9249.

* check struct alignment to word

* check for aligned memcpy again

* cleanup

* add CANPacket structure diagram

* update CANPacket and add USB packet struct

* bugfix + refactoring of EP1

* move dlc_to_len to header

* missed include

* typo...

* MISRA

* fk

* lower MAX_CAN_MSGS_PER_BULK_TRANSFER

* bump CAN_PACKET_VERSION to 2

* bump python lib CAN_PACKET_VERSION to 2

* rename parse_can_buffer to unpack_can_buffer

* CANPacket_t const fields

* Revert "CANPacket_t const fields"

This reverts commit cf91c035b7706a14e317550c5f0501ae3fce7c70.

* test.c relative path

* cleanup

* move macros to safety_declarations

* Refactor pack/unpack funcs and add unittest

* usb_protocol.h

* oops

* Update .github/workflows/test.yaml

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

* remove print from unittest

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-11-12 16:36:34 -08:00
Adeeb Shihadeh 84e47df99d
Mazda: add safety replay test route (#761)
* Mazda: add safety replay test route

* revert that

* comment

* bump openpilot
2021-10-31 22:05:14 -07:00
Adeeb Shihadeh 8c687ecfb4
Revert "Honda Bosch: Support extended LKAS_HUD IDs (#615)" (#708)
This reverts commit 46593af619.
2021-08-28 21:11:37 -07:00
Chris Souers 46593af619
Honda Bosch: Support extended LKAS_HUD IDs (#615)
* Add support for new Honda Bosch vehicles

- Support extended LKAS_HUD IDs on Honda Bosch

- Support extended ID checksum on incoming frames in safety hook (currently unused).

condense

Cleaner. Don't need to store the value in checksum at the return.

Co-Authored-By: Adeeb Shihadeh <adeebshihadeh@users.noreply.github.com>

* revert checksum change

* use full space

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@users.noreply.github.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-08-21 23:34:51 -07:00
robbederks d8385413c3
New tesla safety (#629)
* WIP: new tesla safety

* fix misra

* add unit test

* use | instead of +

* other angle sensor

* change brake message

* fix cancel safety violation

* fix bus for cancel message

* add support for autopilot passthrough and fix cancel message

* fix tests

* this check fails

* fix build

* fix build on c2

* cleanup

* add back AP status to the check

* bus 2

* this check is dumb

* try this?

* add route to do replay on

* cleanup

Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
2021-06-23 12:41:43 +02:00
Adeeb Shihadeh 3cf5b473c8
CI fixups (#657) 2021-06-09 18:36:07 -07:00
Adeeb Shihadeh 086be906d7
Add test routes for Hyundai legacy and Subaru legacy safety modes (#558)
* add subaru legacy route to safety replay

* hyundai legacy routet push
2020-06-15 18:15:49 -07:00
Adeeb d7f7b14118
Enable almost all Flake8 checks (#548)
* fix W391

* E262

* E703

* W293

* some E

* E231

* some more E

* E225

* more E

* E252

* no tabs

* more tabs

* E701

* uds.py

* almost all of them

* only e265 left

* not sure why this is triggering on commented out code

* ignore esptool
2020-06-01 01:49:26 -07:00
Adeeb Shihadeh 9102c16118 two spaces before inline comment 2020-05-31 14:07:01 -07:00
Adeeb Shihadeh 3a85f4c25c use whole route when running safety replay from CLI 2020-05-30 21:31:18 -07:00
Willem Melching b8267341a1
Add pre commit checks + CI (#545)
* Add pre commit checks

* untested but should work

* fix typo in dockerfile

* add sqlite

* add pylintrc to ignore usb1 members

* Typo in stage name

* Move to requirements
2020-05-29 11:52:03 -07:00
Adeeb Shihadeh 5210e51b82 remove unused files 2020-05-24 12:11:24 -07:00
Adeeb 55b79b4721
GitHub Actions (#535) 2020-05-17 19:53:23 -07:00
Adeeb Shihadeh a4390713e6 gitignore for route logs 2020-05-09 00:50:34 -07:00