Commit Graph

634 Commits

Author SHA1 Message Date
Adeeb Shihadeh
80dac4cd94 cleanup CAN definitions (#1170) 2022-11-29 15:56:43 -08:00
Shane Smiskol
702e5281d8 remove unused scons argument (#1169)
* clean

* also here
2022-11-29 01:28:46 -08:00
Shane Smiskol
8accca13ad VW: explicitly test for inactive accel (#1167)
* explicitely test for inactive accel

* fix the safety

* and catch the mistake

* revert
2022-11-28 22:37:59 -08:00
Robbe Derks
360f8e63df reconnecting debug console 2022-11-24 16:09:39 +01:00
Jason Young
e4c4253964 VW MQB: Redundant brake pressed signals (#1137)
* VW MQB: Redundant brake pressed signals

* bump timer for safety tests in CI

* use nicer f-string syntax

* don't need that
2022-11-22 14:27:52 -08:00
Adeeb Shihadeh
e5e34b16f5 som debug script 2022-11-17 17:06:28 -08:00
Robbe Derks
5aa5f855e4 setup UART for SOM debugging (#1151)
* cleanup external debug serial

* wip: bring up uart7

* more wip

* this does something

* this works

* increase fifo size

* fix misra

* cleanup

* fix misra again

* add SOM debug enum

* reduce SOM buffer on F4

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-17 17:59:11 +01:00
hoomoose
5dc5cd8e20 Hyundai: longitudinal support for all CAN-FD EV + Hybrid (#1128)
* Update safety_hyundai_canfd.h

* Update safety_hyundai_canfd.h

* Update safety_hyundai_canfd.h

* cleanup

* add test

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-15 14:48:45 -08:00
Adeeb Shihadeh
c75c276301 add has_spi board property (#1153)
* always spi for h7

* disable for now
2022-11-13 19:57:20 -08:00
Shane Smiskol
c0632cd32b GM: enable on rising edge of resume (#1157)
* rising edge of resume

* fix test

* comment

* todo fix tests

* fix test

* we want to test the transition from btn prev to btn cur, not unpressed to x to y

* range
2022-11-13 19:10:45 -08:00
Shane Smiskol
0096d0c4fc GM: handle run-away set speed (#1156)
* Revert "GM: enable on rising edge of resume (#1155)"

This reverts commit 5aa33e1b2f.

* allow set/resume to any other button (except cancel)

* explicit test

* This is a test of both PRs combined

* Revert "This is a test of both PRs combined"

This reverts commit c7fdc3b00c12da64763c371f8cf017faa0273b1d.

* fix test
2022-11-12 01:55:41 -08:00
Shane Smiskol
ff48ecc34e Revert "GM: enable on rising edge of resume (#1155)"
This reverts commit 5aa33e1b2f.
2022-11-12 01:47:13 -08:00
Shane Smiskol
5aa33e1b2f GM: enable on rising edge of resume (#1155)
* rising edge of resume

* fix test

* comment
2022-11-12 00:01:15 -08:00
Shane Smiskol
d573111268 Hyundai: fix button enable controls mismatch (#1152)
* fix hyundai long button controls mismatch

* test

* comment
2022-11-11 14:43:35 -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
Robbe Derks
d574f4aebc STM32F4: SPI communications (#998)
* cleanup is_enumerated, rename comms and init spi

* big comms refactor, building now

* misra fixes

* more fixes

* misra try 3

* cleanup

* this belongs in a separate PR

* remove unneccesary file

* revert llspi changes

* llspi misra fix

* enable SPI on F4 and setup gpio

* duh

* wip: spi comms

* more spi wip

* dynamic sector erasing

* Revert "dynamic sector erasing"

This reverts commit fce1215a2ede45e5e2a0e97ca23a86c1d8bfa94a.

* more sectors to be erased

* debugging

* woah, this works

* cleanup on the panda side

* add sync and checksum checks, and fix recovery on errors

* this seems relatively stable

* add retrying

* this is stabler

* some endianness and endpoint fixes

* builds

* revert that

* add that back

* checksum start

* start splitting up driver

* spi behind flag

* cleanup test

* bump up timeout

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-09 18:46:20 -08:00
Shane Smiskol
281eb7731b GM Camera: use ECM brake pressed bit (#1138)
* GM camera: use ECM brake pressed bit

* back to ECMEngineStatus

* length 8

* common gmcamera class

* move to longitudinal base

* Revert "move to longitudinal base"

This reverts commit 67abe4c86b0e5e00432ab0ab80a8db6061f3cc3e.

* fix
2022-11-08 20:17:02 -08:00
Shane Smiskol
8f7befa9bb GM: clean up safety classes (#1143)
* add PCM_CRUISE flag to GM safety tests (like safety code)

* pcm_status_msg

* rm 2
2022-11-08 19:50:11 -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
Jason Wen
1ccdff90c5 HKG CAN-FD: support radar ACC cars (#1134)
* HKG: Car Port for Genesis GV70 2023

* Revert "HKG: Car Port for Genesis GV70 2023"

This reverts commit 01bfda6dff4d8d2de4fd9b485b3f352e3e038000.

* 0x1a0 rx check

* Wrong one oops

* Check 0x1a0 based on param

* no need

* getting a bit messy, clean up soon!

* clean up

* clean up

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-11-07 22:44:13 -08:00
Jason Wen
f3fc343262 Hyundai CAN-FD: support for ICE cars (#1031)
* Hyundai: Car Port for Santa Cruz 2022

New struct and params for CAN-FD ICE models

fixup! New struct and params for CAN-FD ICE models

* Longitudinal Control: ICE CAN-FD models

* fixup! Longitudinal Control: ICE CAN-FD models

* fixup! Longitudinal Control: ICE CAN-FD models

* fixup! Longitudinal Control: ICE CAN-FD models

* fixup! Longitudinal Control: ICE CAN-FD models

* Gate radar disable behind HDA2 only

* Remove unnecessary HDA2 checks

* Fix MISRA violation

* not needed, in HYUNDAI_CANFD_HDA2_LONG_TX_MSGS

* revert longitudinal changes

* fix addr check logic, clean up

* revert more long stuff

* fix addr check

* temp

* tests

* work?

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-11-04 16:43:33 -07:00
Shane Smiskol
34cfc43b40 Hyundai CAN-FD: more complete tests (#1133)
* more complete tests

* use parameterized_class

* make clear this only tests EV right now

* fix python linter

* rename reference

* clean up and fix python linter again
2022-11-04 15:34:16 -07:00
Adeeb Shihadeh
a42b104c35 SPI handle in python lib (#1131)
* SPI handle in python lib

* add spidev

* unify those

* clean up connect

* clean that up

Co-authored-by: Robbe Derks <robbe.derks@gmail.com>
2022-11-03 22:18:12 -07:00
Adeeb Shihadeh
b3e9292922 HITL test fixups (#1117)
* automated -> hitl

* simplify

* jenkinsfile cleanup

* cleanup

* fix new linter errors

* fix ws cleanup

* some retry

* more cleaning up after ourselves

* unpin scons

* bump opendbc

* fix quotes

* enable flaky

* debug print

Co-authored-by: Bruce Wayne <batman@comma.ai>
2022-11-03 17:24:28 -07:00
Adeeb Shihadeh
bfce4c72f0 Hyundai: update tests with new DBC names (#1129)
* Hyundai: update tests with new DBC names

* fixed
2022-11-03 14:36:09 -07: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 Shuler
cf4aa6bb30 GM: longitudinal support for camera-integrated cars (#1014)
* Allow brake TX on PT bus

* Initial Panda GM cam harness support
 * Complete rewrite / simplification
 * Add param for cam harness (default is OBD2)
   - Forward btw 0 and 2
   - Filter LKAS and optionally ACC from cam
 * Add param for stock ACC
   - Allows ACC on PT bus when set, not otherwise
   - Allows ACC from cam when set, not otherwise
 * Add temporary WIP EPS timing workaround in ifdef

* Remove keepalive; regen == braking

* Fix MISRA violations

* EPS timing opt-in by param

* Minor clean up

* remove timing code for readability

fix and formatting

* we only need to send one message if cam harness and stock long

* Simplify params

* Removed dup brake msg

* revised params, split 3-ways

* add test

* clean up a bit, no need to send ACC yet

like this

* split out button enable and pcm enable into seperate tests

* some formatting

some formatting

* GM CAM uses PCM cruise for controls_allowed

* fix gas safety tests

* misra

* fix static analysis

comment

* fix brake pressed

* Add OP VOACC override stock cam

* Add VOACC safetyparam to init.py

* openpilot long safety

* do this in another PR

* add back

* add safety tests

* rename

* struct for safety

* not used

* temporary fault fix

* adjust max gas

* allow PSCMStatus in long mode

* stash

* fix max gas

* fix and clean up tests

* clean up longitudinal tests into a common class

* fix pylint

* subclass

* clean that up

* rm

* blocking

* comment

* comment

* lower case

* brake bus

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-11-01 00:58:18 -07:00
Shane Smiskol
494c5a403a GM Cam: pass on useless tests (#1122)
* pass

* Caps
2022-10-27 21:23:36 -07:00
Shane Smiskol
187fdee385 safety: remove pre-enable state (#1121)
* current_controls_allowed is now unused

* reduce diff

* remove from honda

* these test nothing

* fix
2022-10-27 17:51:20 -07:00
Shane Smiskol
2db69bc941 Revert "GM: different brake thresholds by platform (#1104)" (#1116)
This reverts commit 5962bcd08a.
2022-10-21 18:11:31 -07:00
Shane Smiskol
d51dd496cb GM: more longitudinal safety (#1115)
* seems cleaner

* abort struct

* fix

* add variable in test_gm (TODO: add tests)

* fix test for new safety

* cmt

* && -> ||
2022-10-21 00:20:01 -07:00
Adeeb Shihadeh
fcb1a5a8e2 Hyundai CAN-FD: common brake pressed signal (#1113)
* Hyundai CAN-FD: common brake pressed signal

* change bit

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-10-20 19:52:06 -07:00
Shane Smiskol
54f9390ff5 GM: allow TX PSCMStatus message (#1111)
* forwarding

* add to tx msgs

* don't block

* Revert "don't block"

This reverts commit b1ca52f86d59500c6232df6afac97a51daf7bd51.

* fix forwarding tests

* comment

* add comment
2022-10-19 23:25:22 -07:00
Adeeb Shihadeh
723e60cb43 Hyundai CAN-FD: fix SCC bus for HDA1 2022-10-19 22:58:52 -07:00
Adeeb Shihadeh
24ccc34c46 Hyundai CAN-FD: use cruise signals from SCC ECU (#1112)
* Hyundai CAN-FD: use cruise signals from SCC ECU

* cleanup
2022-10-19 22:26:22 -07:00
hoomoose
dd751862c3 Hyundai: support button resume on CAN-FD HDA1 (#1102)
* Update safety_hyundai_canfd.h

* run tx checks

* fix tests

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-10-19 15:17:23 -07:00
Shane Smiskol
b95a65df58 GM: match ECM standstill check (#1105)
* match ECM check

* fix

* needs to be <= 10 to avoid a fault, fix for safety tests

* fix
2022-10-18 11:22:04 -07:00
Shane Smiskol
842cf65818 Hyundai CAN-FD: support 90deg angle limit bypass (#1098)
* h90d CAN-FD

* torque

* one liner

* adjust safety

* Revert "adjust safety"

This reverts commit e3539edc313551bca4f04a6779c12f6035010dfc.
2022-10-17 20:27:30 -07:00
Adeeb Shihadeh
bce6f48a9d CI speedup (#1108)
* use docker buildkit

* enable push

* try this caching

* no regressions

* don't copy into the image

* move that

* getting there

* debug

* little smaller

* debug

* configure safe dir

* no sudo

* cleanup

* another timeout
2022-10-16 16:37:58 -07:00
Jason Wen
62868c36a8 Hyundai: CAN-FD Hybrid gas pressed signal (#1106)
* Hyundai: Gate 0x105 behind hybrid CAN-FD only

* update tests

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-10-15 12:26:01 -07:00
Shane Smiskol
5962bcd08a GM: different brake thresholds by platform (#1104)
* Different brake pressed thresholds

* Update board/safety/safety_gm.h
2022-10-14 16:51:53 -07:00
Shane Smiskol
c39528d299 Hyundai tests: fix counter in FCA message (#1092)
* tests: fix counter in FCA message

* Update tests/safety/test_hyundai.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-10-12 21:48:04 -07:00
Adeeb Shihadeh
de380961fc Hyundai: support non-HDA2 EV gas signals (#1100)
* Hyundai: support non-HDA2 EV gas signals

* update tests
2022-10-12 21:00:24 -07:00
Adeeb Shihadeh
622ce923e9 Hyundai: share flags with CAN-FD platform (#1099)
* Hyundai: share flags with CAN-FD platform

* update flags there
2022-10-12 20:29:15 -07:00
Greg Hogan
2f3e2825e5 CAN-FD non-ISO support (#1082)
CAN FD non-ISO support
2022-10-12 15:28:20 -07:00
Adeeb Shihadeh
ffb3109e28 Hyundai: HDA2 longitudinal control support (#1096)
* ev6 long

* update steering
2022-10-11 20:50:23 -07:00
Shane Smiskol
d68b1b0a98 Hyundai: support 90deg angle limit bypass (#1091)
* h90d safety

* quicker rate

* update comment

* support multi frames?

* stash

* stash

* might work?

* stash

* clean up

* revert that

* add test

* fixup tests

* clean up

* remove test

* try to combine tests

* Revert "try to combine tests"

This reverts commit f147955b94119eca0abd1b605844ab5002fb0305.

* seems simpler

* more explicit

* shouldn't be needed

* comment

* fix that test
2022-10-11 17:57:03 -07:00
Adeeb Shihadeh
aa0be4d3dc Hyundai: move shared definitions to a separate file (#1097)
* Hyundai: move shared definitions to a separate header file

* same with tests

* cleanup
2022-10-11 17:38:34 -07:00
Shane Smiskol
0a819ad465 Torque request bit: support multiple invalid frames (#1094)
* h90d safety

* quicker rate

* update comment

* support multi frames?

* stash

* stash

* might work?

* stash

* clean up

* revert that

* add test

* fixup tests

* clean up

* remove test

* try to combine tests

* Revert "try to combine tests"

This reverts commit f147955b94119eca0abd1b605844ab5002fb0305.

* seems simpler

* more explicit

* shouldn't be needed

* no hyundai stuff

* no line

* consecutively

* comment

* comment

* comment

* revert

* comment

* check earlier

check earlier

* ensure we don't set a negative value

* add todo comments

* for loop
2022-10-11 13:20:24 -07:00