Commit Graph

1839 Commits

Author SHA1 Message Date
Jason Wen
e6c2b0ff01 Remove duplicate word in comment (#974)
Remove duplicate word
2022-06-21 21:53:49 -07:00
Shane Smiskol
e1b2f1253c bump openpilot (#971) 2022-06-16 22:43:36 -07:00
Shane Smiskol
515df2bb72 Chrysler: use universal gas and brake signals (#970)
* RamInit

* just gas and brake changes

* unsigned

* fix tests

* bump openpilot version (TEMP)

* misra

* system

Co-authored-by: Jonathan <jraycec@gmail.com>
2022-06-16 21:49:22 -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 691e045f8724e57f135ad8d1683e83acbc16b91f.

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

* 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
Shane Smiskol
42772b49e3 Honda Bosch: consider correct bus for buttons (#963)
* fix bosch controls mismatch when using op longitudinal

* misra
2022-06-08 21:11:55 -07:00
Jason Young
475a9a3124 fix CANPackerPanda counter state init (#956) 2022-06-02 11:18:46 -07:00
Shane Smiskol
d967a6b504 safety tests: use base class for common driver steering torque tests (#950)
* rename to torque_cmd_msg

* Move most of the driver torque tests into common.DriverTorqueSteeringSafetyTest

* fix static analysis so far

* HDA2 just works

* TODO: Subaru

* Subaru

* Move Mazda steering constants into class

* rm line

* split into classes

* move test_against_torque_driver into common driver torque tests

* rename to match all other tests

* fix linter

* revert changes
2022-05-25 22:51:33 -07:00
Shane Smiskol
583d3a0c7b Mazda: fix steering safety and add tests (#952)
* fix steering safety and add tests for mazda

* fix steering safety and add tests for mazda
2022-05-25 22:19:18 -07:00
Shane Smiskol
6117c381f2 safety tests: create classes for common torque steering tests (#951)
* Create base class for common steering tests (motor/driver)

* fix class name
2022-05-25 19:24:55 -07:00
Shane Smiskol
dff5e6ed31 Hyundai: check CF_Lkas_ActToi bit (#947)
* Hyundai: check steer request bit

* add tests (should make common with Toyota in the future)

* fix comment
2022-05-25 11:36:59 -07:00
Shane Smiskol
6d19b46ef5 GM: revert back to brake threshold (#949)
Revert "GM: change from brake threshold to Brake_Pressed bit (#846)"

This reverts commit 3bd3ae885a.
2022-05-20 19:41:26 -07:00
Adeeb Shihadeh
62f709afd4 fix missing CAN-FD safety modes 2022-05-19 16:55:53 -07:00
Willem Melching
36c62afa0c Kia EV6 (#905)
* block lkas

* taco time

* local changes

* start

* tx checks

* counter + vehicle moving

* support big can fd

* check crc

* add torque to rx checks

* tests

* little more

* little more

* get some misra coverage

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-05-19 15:59:58 -07:00
Adeeb Shihadeh
b6a672de5a bump openpilot (#946)
* bump openpilot

* need that too :(
2022-05-19 14:30:08 -07:00
Adeeb Shihadeh
4a5fc24b75 safety: move controls_allowed and relay malfunction reset (#944)
* safety: reset controls allowed and relay malfunction before safety mode init

* add back for all output
2022-05-19 14:03:43 -07:00
Shane Smiskol
36ccbd56fa Toyota: check STEER_REQUEST bit (#940)
* check steer_req

* think this is clearer on first glance

* add test

* also test recovery

* Update tests/safety/test_toyota.py

* Update tests/safety/test_toyota.py

* move
2022-05-16 12:20:31 -07:00
Robbe Derks
893a81aa82 Tesla: allow forwarding of stock AEB (#937)
* allow forwarding of stock AEB

* misra fix
2022-05-16 13:12:14 +02:00
Adeeb Shihadeh
69215887dc safety: prep for CAN FD (#943) 2022-05-15 23:46:04 -07:00
eFini
297cdb27ef Toyota: forward ACC messages if stock longitudinal (#934)
* do not block 0x343 if toyota_stock_longitudinal set to true

* Update board/safety/safety_toyota.h

* Update board/safety/safety_toyota.h

* Update tests/safety/test_toyota.py

* Update tests/safety/test_toyota.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-05-14 01:08:32 -07:00
Willem Melching
d5bd81e5b5 fixes for mypy check for return-any 2022-05-12 14:22:58 +02:00
Shane Smiskol
1d2127876d Hyundai: use GET_BIT and fix safety on incorrect bit (#933)
* use GET_BIT where possible

* fix test to catch this
2022-05-11 22:36:53 -07:00
Ross Fisher
e8adf57a0c Note about panda jungle udev rules (#935)
* Note about panda jungle udev rules

* Update README.md

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-05-11 21:42:21 -07:00
Adeeb Shihadeh
c31cbade34 CI: fix build after 20.04 image update (#932) 2022-05-02 15:02:34 -07:00
Shane Smiskol
eb662e4e50 Make safety param uint16_t (#931)
* change safety param to uint16_t

* accidental paste
2022-05-02 13:36:19 -07:00
Shane Smiskol
326cc2a8db Toyota: stock longitudinal safety (#927)
* safety for non-longitudinal

* flip around param for easily replaying old logs on new panda

* fix misra: a function parameter should not be modified

* safety

* the toyota tests all share common messages

* fixup tests

* update comment

* same as tesla test

* check if subset

* update comments

update comments
2022-04-28 22:29:29 -07:00
Shane Smiskol
cf8fb0b883 safety param: assume uint16_t (#929) 2022-04-28 17:40:50 -07:00
Adeeb Shihadeh
d031d6e283 Toyota: add safety param flag for alt brake message (#925)
* Toyota: add safety param flag for alt brake message

* fix misra

* Update board/safety/safety_toyota.h
2022-04-27 11:31:24 -07:00
Shane Smiskol
bb2aea1ac6 Hyundai: enforce recent button press to allow controls with PCM (#923)
* add safety for hyundai stock long button-only enable

* add full logic, use 4 frames of button samples

* comment above and in openpilot is enough explanation

* make misra happy

* add tests

* add comments and better variable names

* only check button values on rising edge of PCM ACC enable

* common function

* Revert "common function"

This reverts commit 81e642ca987b76d8353003f7f622a1bec5003713.

* simplify: keep track of last interaction instead

* revert changes to sample_t

* make unsigned

* clip to max and use uint8

* start at 4

* consistent

* apply suggestions

* Update board/safety/safety_hyundai.h

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

* unify function

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-04-26 11:45:09 -07:00
Shane Smiskol
ee9ef693a1 Revert "Hyundai: enforce recent button press to allow controls with PCM (#917)"
This reverts commit 9a91323c04.
2022-04-26 02:07:53 -07:00
Shane Smiskol
9a91323c04 Hyundai: enforce recent button press to allow controls with PCM (#917)
* add safety for hyundai stock long button-only enable

* add full logic, use 4 frames of button samples

* comment above and in openpilot is enough explanation

* make misra happy

* add tests

* add comments and better variable names

* only check button values on rising edge of PCM ACC enable

* common function

* Revert "common function"

This reverts commit 81e642ca987b76d8353003f7f622a1bec5003713.

* simplify: keep track of last interaction instead

* revert changes to sample_t

* make unsigned

* clip to max and use uint8

* start at 4

* consistent

* apply suggestions

* Update board/safety/safety_hyundai.h

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

* unify function

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-04-25 18:57:02 -07:00
Comma Device
5eefc3ad62 allow skipping DFU entrance for recover 2022-04-25 17:11:27 -07:00
Shane Smiskol
ee2a4b6b58 sample_t: fixup comments (#921) 2022-04-21 20:11:13 -07:00
Shane Smiskol
7dd9493eb1 safety_param: change to unsigned (#910)
* make safety_param unsigned

* final one

* uint32_t

* change flags as well

* Revert "change flags as well"

This reverts commit ed8897dd86b0dbfc80e6b8633f36d80c9bc91052.

* unsigned

* update health packet version

update health packet version

* update struct H->I

* bump health version

* actually used
2022-04-20 23:25:03 -07:00
Shane Smiskol
a1d97f9a0b Toyota: fix interceptor pressed mismatch (#919)
* change to openpilot threshold

* add interceptor comments

* fix test threshold
2022-04-20 22:20:24 -07:00
Shane Smiskol
c925407461 Honda: fix interceptor pressed mismatch (#915)
* update panda interceptor gains

* update test threshold

* update threshold

* don't divide second track by 2 (?)

* fix test

* we don't divide by 2 anymore

* better wording

* remove value

* bump PR

* no 1e-5
2022-04-12 10:59:05 -07:00
Robbe Derks
cc0fdffee6 Calculate interrupt load and add to health packet (#913)
* calculate interrupt load

* forgot to change this

* being cautious about overflows

* utils

* fix bootstub

* cleanup

* also exclude pedal

* fix misra

Co-authored-by: Comma Device <device@comma.ai>
2022-04-11 11:59:47 +02:00
Shane Smiskol
f088af5664 GM: allow active regen bit when gas is pressed (#914)
* allow apply bit when gas is pressed

* remove unused apply

* allow apply bit in pre-enabled state

* use GET_BIT

* surely misra won't be mad

* compare to a value

* forgot to make this unsigned too
2022-04-07 20:29:00 -07:00
Robbe Derks
ad4f69cd18 Dos: PWM based camera signals (#912)
* switch over to PWM based camera signals

* update comment

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
2022-04-06 17:19:42 -07:00
Adeeb Shihadeh
ba5cbd5ee1 body: set controls allowed (#906) 2022-04-04 18:55:19 -07:00
Shane Smiskol
81246fdac1 move alternative experience class to python module (#909)
* move alternative experience class to common python module

* same formatting
2022-04-04 18:49:56 -07:00
dependabot[bot]
7214657278 Bump numpy from 1.17.2 to 1.21.0 (#908)
Bumps [numpy](https://github.com/numpy/numpy) from 1.17.2 to 1.21.0.
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/HOWTO_RELEASE.rst.txt)
- [Commits](https://github.com/numpy/numpy/compare/v1.17.2...v1.21.0)

---
updated-dependencies:
- dependency-name: numpy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 18:39:52 -07:00
Adeeb Shihadeh
ddf1eb68ba socketcan: fix for new kernels (#907) 2022-04-04 18:03:12 -07:00
Greg Hogan
ab693a22d5 UDS DTC number and status helpers 2022-04-04 17:55:11 -07:00
Shane Smiskol
6a4daee044 safety: disallow longitudinal actuation while gas is pressed (#884)
* test implemented for Toyota

* fix Toyota interceptor

* use hasattr

* do Honda (still need Nidec ACC_HUD safety)

* add longitudinal_allowed to ACC_HUD (Nidec w/ no pedal

* rx not needed

* add base test for longitudinal

* update name

* stash

* do GM

* use gas_pressed_prev

* do tesla safety

* add full tests

* add get_longitudinal_allowed for simpler tests

* remove unnecessary tests and revert honda/hyundai

* fix honda after revert

* make sure releasing gas allows longitudinal again

* clean up

* clean up

* Just check longitudinal allowed

* don't need to reset detection

* use prev and add brake detection

* only on gas

* make sure we don't change current_controls_allowed braking behavior

* clean up tests

* use current_controls_allowed for honda & GM

* this is pretty much tested in common

* fix up tests and move common tests

* revert

* better place

* add for body
2022-04-01 19:54:40 -07:00
Shane Smiskol
f20682b640 use all cores (#898) 2022-04-01 19:15:04 -07:00
Shane Smiskol
94bfed6d28 safety tests: rename interceptor message functions (#900) 2022-04-01 19:14:41 -07:00
Adeeb Shihadeh
560bcc4063 body: add RX checks (#903)
* body: add RX checks

* add that
2022-03-31 15:58:54 -07:00
Igor Biletskyy
93863197dd add safety mode for body (#901)
* safety mode for body

* move to 27

* dmm...

* misra..

* add faw to safety list

* missing safety modes in python lib

* dmm

* change address to 250

* add 0x1 addr for can flasehr

* whitespace
2022-03-31 12:02:19 -07:00
Shane Smiskol
79145f9e5f safety tests: rename gas/brake message functions (#893)
* _brake_msg and _gas_msg were confusing

* use class inheritance to define test specific safety variables

* Revert "use class inheritance to define test specific safety variables"

This reverts commit 734efd96f3f66c2cff62674a6510c1c4b08f22cd.

* common function to set up each test

fix honda

* Revert "common function to set up each test"

This reverts commit fe4e71b3c64c6dd9717ea4f188abef7114cbfce8.

* rename related function

* formatting

* consistent name

* revert this change
2022-03-28 13:13:27 -07:00