Commit Graph

1078 Commits

Author SHA1 Message Date
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
f9485c8d5d Ford: more clear steering safety check (#1383)
one line
2023-05-01 20:01:03 -07: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
Shane Smiskol
63db708491 driver torque limit: make driver torque message abstract (#1377)
* abs

* uncomment

* fixy
2023-04-28 17:36:35 -07:00
Shane Smiskol
99809f7071 angle safety tests: more clear helper function name
here too
2023-04-28 15:02:57 -07:00
Shane Smiskol
aac46a2ef2 angle safety: enforce disabled angle when not steering (#1372)
* enforce disabled angle when bit not set, below we enforce bit to be 0 when not controls allowed

* test

* other test

* combine tests

* comment
2023-04-27 21:41:38 -07:00
Shane Smiskol
240370cdd1 ford: allow 0 curvature when controls are allowed if not steering (#1370)
* test that we can send curvature=0 if enabled=False while control_allowed=True (let's say EPS faults, OP doesn't want to actuate)

* draft

* only check error if apply bit is 1

* subtest

* no subtest

* fix safety and tests

* tests say this works

* clean up

* subtests are sloww

* Revert "subtests are sloww"

This reverts commit 560c6745c8.

* fix test from merge

* add comment

* add comment

* add another comment

* spacing
2023-04-27 17:44:32 -07:00
Shane Smiskol
07680692d9 Ford: add subtests (#1371)
* subtest here

* and here

* bit faster
2023-04-27 17:27:18 -07:00
Shane Smiskol
c9c3cb38f6 Ford safety: curvature error limit (#1353)
* set ford vehicle speed

* parse yaw rate signals

* misra

* misra

* misra

* misra

* draft

* update module

* already checked

* and set it properly

* some stuff

* draft

* clean up (will fail tests because we don't send yaw rate yet)

* could do something like this

* this is better and less prone to bugs

* match simple op limiting, debugging

* set checksum for messages in tests

* clean up

* fix that

* one m/s fudge

* fix sign of yaw rate

* interpolate detects size

* forgot OP flips the curvature sign. it matches yaw on can

* all my debugging crap

* make replay work for ford

* fix panda blocking messages (array is fixed size so size-1 is 0 rate at high speed)

* uncomment safety test limits

* revert

* round for zero blocked msgs

* fix limits

* meas safety checks that down rate is >=, not <

* test pass

* lots of comments and draft what one meas torque check would look like

* fix that

* add curvature meas

* add debugging stuff

* Revert "add debugging stuff"

This reverts commit 449783fc62.

* messy but at least one test passes now

* draft

* add max_steer

* some safety clean up

* and that

* start with a test that works

* another test that works (sort of, we need more strict panda safety without false positives)

* no max curvature check (not safety related), allow any rate limits

* add new function

* also need to consider max val here, since OP will send up to that

* and now use the function

* lower to 10

* compilation fixes

* clean up (no rate limiting)

* remove that too

* curvature diff test

* more clean up

* debug

* ?

* better names

* more official

* use _curvature_meas_msg_array here

* bit faster

* no i don't

* revert that

* why not just use angle_meas?

* bb ll

* bb deb

* clean up debug vals

* more

* revert replay drive debugging changes

* Update board/safety.h

* rm line

* only need to round the final thing

* not needed, under 10 ms

* make a class variable

* fix a misra?

* another misra?

better

* ?

* 12.1

* need to explicitly convert

* add one to not false trigger the violation (float rounding)

* not really needed

* rm line

* cmt

* use clamp

* rename

* in struct

* comment

* use max_limit_check

* draft clean up

* Revert "draft clean up"

This reverts commit d1a0e8acd1.

* make a global

make a global

* this is fine
2023-04-27 00:40:29 -07:00
Adeeb Shihadeh
7aef934d4c Fix undefined behavior in GET_BYTES macro (#1367) 2023-04-26 22:59:58 -07:00
Shane Smiskol
f444f1554f Ford: check second speed for mismatches (#1358)
* Add second speed

* 2.5 m/s is 9 kph, 4 kph is the max in the field

* add quality signal

* qf signal name

* comment

* checksum matches except it goes to zero when turning the car off despite counter still active

* update comments

* now test it

* spacing

* Update board/safety/safety_ford.h

* zzzz

* not needed

* whoops

* test vehicle state mismatch

* add to safety_helpers

* probably misra

* we might want to check it in both speed signals in case one doesn't exist on a car

* Revert "we might want to check it in both speed signals in case one doesn't exist on a car"

This reverts commit 3338931409.

* fix formatting

* 2 m/s (7 kph)

* set controls_allowed directly like other safety models

remove vehicle_state_mismatch

* obv
2023-04-26 22:37:36 -07:00
Shane Smiskol
5c21b14049 Ford: check 2nd speed message (#1365)
* Add second speed

* 2.5 m/s is 9 kph, 4 kph is the max in the field

* add quality signal

* qf signal name

* comment

* checksum matches except it goes to zero when turning the car off despite counter still active

* update comments

* now test it

* spacing

* Update board/safety/safety_ford.h

* zzzz

* not needed

* whoops

* test vehicle state mismatch

* add to safety_helpers

* probably misra

* we might want to check it in both speed signals in case one doesn't exist on a car

* Revert "we might want to check it in both speed signals in case one doesn't exist on a car"

This reverts commit 3338931409.

* fix formatting

* 2 m/s (7 kph)

* revert mismatch stuff
2023-04-26 21:49:39 -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
Adeeb Shihadeh
08ed853bf9 log total stall count in fan tuning script 2023-04-21 13:47:13 -07:00
Adeeb Shihadeh
272b81e97b fan: fix stall detection (#1351)
* cleanup and fix

* dos must stall

* clean those up

* fix misra

* more test

* fix import

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-20 15:44:12 -07:00
Adeeb Shihadeh
0e2eb9c0f5 fan debugging script (#1354)
* fan debugging script

* merge those

* disable

* better print

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-20 13:00:40 -07:00
Adeeb Shihadeh
cf307348af CI: run HITL tests on tres (#1326)
* run on tres

* disable those for now

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-18 22:17:11 -07:00
Adeeb Shihadeh
0b03ef5468 HITL tests: skip internal tests on uno (#1350)
Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-04-18 16:15:27 -07:00
Robbe Derks
d3904a9f75 HITL fan test (#1330)
* hitl fan test

* enable cooldown on dos as well

* small cleanup

* get expected RPM from panda class

* fix

* overshoot test

* fix max RPM getting

* fix percentage

* revert cooldown fix

---------

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-04-18 14:47:22 -07:00
Robbe Derks
237ffedcb3 Dos fan fix (#1335)
* hitl fan test

* enable cooldown on dos as well

* small cleanup

* get expected RPM from panda class

* fix

* overshoot test

* fix max RPM getting

* fix percentage

* revert cooldown fix

* add cooldown for dos fan as well

* remove feedforward from the fan controller to eliminate overshoot

* update clip

* cleanup

* add that back

---------

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-04-18 14:15:06 -07:00
Justin Newberry
1f8b03666d Subaru: add ability to send infotainment status message (#1333)
* added infotainment status to panda

* dont fwd infotainment status

* revert placeholder and add test case

* Fix test case

* gen2 only

* fix test case

* Revert "fix test case"

This reverts commit 8cc7579620.

* Revert "gen2 only"

This reverts commit 6a511a9976.

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-04-17 18:47:51 -07:00
Adeeb Shihadeh
9cd01ac263 PandaDFU: retry SPI comms (#1348)
* retry

* set exc

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-16 14:43:58 -07:00
Jason Young
6ec078db5a VW MQB: Cleanup HCA control message (#1310)
* VW MQB: Cleanup HCA control message

* update opendbc ref

* revert this before merging

* MISRA

* revert Dockerfile to comma master

* reverted a little too much
2023-04-15 11:34:42 -07:00
Shane Smiskol
ada8b49cb5 Honda Bosch Radarless: allow alt brake (#1341)
* radarless can use this

* fix addr check

* update opendbc ref
2023-04-14 01:51:19 -07:00
Jason Young
fddca54fd6 VW: Allow inactive accel values at all times (#1247)
* allow inactive accel values at all times

* cleaner

* unnecessary, done by default

* better comments

* move test to common class

* fix

* flip

* comment

* append 0 and INACTIVE_ACCEL to test accels + check acc_07 sends if inactive only

* cleanup

* fix that

* copy testing convention of VW and Honda

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-04-13 17:28:33 -07:00
Adeeb Shihadeh
22b8e5df7f add extra fault assert in HITL tests for context 2023-04-12 16:28:45 -07:00
Igor Biletskyy
0832d65347 Fix CAN message corruption on H7 under high load (#1342)
* fix RX FIFO corruption

* Add checksum to CANFD test data

* cleaner and MISRA

* nah

* oops

* fix test
2023-04-12 11:07: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
Adeeb Shihadeh
6f852b44a9 SPI: log checksum errors in health (#1334)
* SPI: log checksum errors in health

* actually send it

* check in hitl teardown

* check that

* fix misra
2023-04-05 22:05:14 -07:00
Adeeb Shihadeh
eef3d026e3 CI: run HITL tests on dos (#1304)
* run on dos

* skip voltage on dos

* run these

* revert that

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-03 20:21:10 -07:00
Adeeb Shihadeh
b6c378ad02 CI: set PYTHONWARNINGS=error (#1323)
* CI: set PYTHONWARNINGS=error

* update resetter

* fix build warnings

* bump jungle

* fix one more

* fix linter

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-04-02 09:33:35 -07:00
Adeeb Shihadeh
6a8ed7f147 CI: setup dos (#1321)
* CI: setup dos

* just build and flash for now

* fix new device setup
2023-04-01 18:52:32 -07:00
Vivek Aithal
a1e1451d1c GM: Reduce steer down limit and increase driver allowance (#1281)
reduce steer down limit and increase driver allowance
2023-03-29 10:39:25 -07:00
Shane Smiskol
7392f24868 Honda tests: check endswith Base to skip test (#1305)
check endswith base
2023-03-28 00:05:35 -07:00
royjr
db6c50cd09 Honda Bosch Radarless longitudinal safety (#1008)
* civic22_long

use long flag

* maybe?

* Update safety_honda.h

* revert the 0x1c8 addition

* init radarless safety check

* correct accel parsing

* add test class (WIP)

* remove current_controls_allowed

* Fix ACC_HUD

* patch

* Add missing safety to test name

* Pass irrelevant test

* move comment

* remove unused comments

* add comment to TestHondaBoschRadarlessSafety

* Fix message overlap

The "exceptions for common msgs across different hondas" fix does not seem to be working. Created another exception for TestHondaBoschRadarless based on the HondaNidec exception above

* Fix base

* remove comment

* remove buttons from LONG TX

* make a base Radarless test class

* can't remove them, since safety doesn't check bosch

* test accel limits

* test accel limits

* we can do the clean up in another pr

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: sshane <shane@smiskol.com>
2023-03-27 23:10:25 -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
Shane Smiskol
f29125f6ad DriverTorqueSteeringSafetyTest: remove useless function (#1275)
Update common.py
2023-03-22 21:57:18 -07:00
Adeeb Shihadeh
7aaca348c2 HITL tests: nose -> pytest (#1301)
* HITL tests: nose -> pytest

* run all

* add back partial tests

* big speed up

* fix skipping

* enable all

* that's expected

* clean up after ourselves

* jungle is fixture

* fix

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-03-22 21:38:37 -07:00
Shane Smiskol
ba50c2ffee safety tests: fix for common longitudinal accel class (#1299)
* fix

* fix

* something that would catch this
2023-03-21 12:42:02 -07:00
Shane Smiskol
2136e2e45b safety tests: add common longitudinal accel class (#1298)
* add longitudinal safety test class

* rename to accel_cmd_msg

* line

* do hyundai

* set default min and max accel

* revert

* thanks pylint
2023-03-21 12:24:33 -07:00
Adeeb Shihadeh
f658ecdd75 ci: speedup safety tests 2023-03-18 20:35:59 -07:00
Shane Smiskol
e4cc97d882 Toyota: check SETME_X64 signal for LTA (#1296)
* check SETME_X64

* use itertools.product for better coverage

* fine
2023-03-16 22:56:25 -07:00
Shane Smiskol
c83d6894ef Toyota: base LTA safety (#1295)
* part 1 of clean up

* make it work and pass

* remove lta stuff

* remove commented lta tests

* more

* move test back to where it was

* rm line

* rename that

* fix that

* start to add LTA

* angle test

* fix tests and add base stock longitudinal class

* formatting

* clean that up

* convention

* add ALLOW_DEBUG
2023-03-16 22:32:56 -07:00
Shane Smiskol
7fdc66b957 Toyota: more modular safety tests (#1294)
* part 1 of clean up

* make it work and pass

* remove lta stuff

* remove commented lta tests

* more

* move test back to where it was

* rm line

* rename that

* fix that

* we always want to enforce LTA disallowed actually

* not sure if these are helpful

* endswith("Base")
2023-03-16 21:58:38 -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
Igor Biletskyy
75792fb255 Fix different ADC scales (#1288)
* different ADC scales

* add HITL

* we had it, remove
2023-03-14 14:49:39 -07:00
Vincent Wright
0afee2e0ff Raise max steer limits for Ram DT (#1284)
* Raise max steer limits for Ram DT

* Update test_chrysler.py

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-03-13 17:24:02 -07:00