Commit Graph

100 Commits

Author SHA1 Message Date
Jason Wen
87cb00203a Hyundai Longitudinal: Display personality in instrument cluster (#31798)
* Hyundai Longitudinal: Display personality in instrument cluster

* Support CAN-FD

* Apply suggestions from code review

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-03-11 21:45:52 -07:00
Justin Newberry
e341707b0f HKG: move to platform config (#31649)
* fuck me!

* that kinda makes things pretty nice

* move it down

* and move this comment

* Wip

* more flags :/

* add the debug shit

* add

* lets not break this yet

* MORE flags git add .git add .git add .git add .!

* B

* add mando

* update ref

* possibly better?

* we can use flags here

* formatting

* formatting

* move up

* canfd subclass

* this is more clear

* spacing

* static!

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-02-29 17:04:54 -08:00
Justin Newberry
d4c497d826 add CarControllerBase base class to all CarControllers (#31630)
just base class for now
2024-02-28 17:13:44 -08:00
Jason Wen
fafca0e44d Hyundai: Car Port for Kona EV 2nd Generation (HDA2, 2023 Korean Ver.) (#28725)
* Hyundai: Car Port for Kona EV 2nd Generation (2023 Korean Ver.)

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* gate with flag

* new blinker signals for 2nd Gen Kona

* add test route

* Update CARS.md

* bump opendbc

* match opendbc definition

* Attempt to block laneline information to suppress LFA

* Try 0x364

* Block 0x364|BYTE7

* Block all bus 2/6 messages

* Lowercase to match DBC

* Aight

* we don't use this

* Final test to block LFA

* No byte 7

* Fix

* Fix tx

* cleanup

* HDA2 support

* Update RELEASES.md

* bump opendbc

* from `liveTorqueParameters`

* add test route

* bump panda

* official spec

* Check for new LKAS addr instead

* Update comment

* sync with dbc

* Combine LFA suppress can sends

* bump opendbc

* Add new tx to unit test

* linter

* Consolidate

* rename and update torque params

* add note for blinker weirdness

* bump

* bump

* clean up block msg

* it uses LFA if long

* not used in multiple places

* bump panda

* correct name

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-30 00:02:19 -07:00
Jason Wen
67177b2ca3 Hyundai CAN-FD HDA2: specify signals to suppress LFA (#29658)
* Hyundai CAN-FD HDA2: specify signals to suppress LFA

* bump opendbc

* Fix

* Update comment

* fix

* closer to original

* preserve behavior

* Revert "preserve behavior"

This reverts commit 6549c085ab6bdd093f7668e7df79cd85350bc028.

* preserve behavior

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-28 22:58:43 -07:00
Jason Wen
5aed2e01e8 Hyundai: consolidate button messages creation (#29663)
* Hyundai: refactor button messages creation and consolidation

* one bool should be enough

* Use CLU11|0x4F1 to determine

* grammar pls

* action

* fix duplication

* move to bottom

* one area

* type

* Revert "one area"

This reverts commit c2b794f964b3df09a5ae9f35a3853e6cec69f93a.

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-28 15:23:02 -07:00
Adeeb Shihadeh
a9626f95b6 add openpilot prefix to imports (#29498)
* add openpilot prefix to imports

* more

* more

* fix docs

* fix linter

* bump submodules

* fix patched tests

* update dynamic imports

* debug

* Revert "debug"

This reverts commit db5e13b9911cc74438bee123bc3430da6c31b24b.

* fix pm test
2023-08-20 20:49:55 -07:00
Jason Wen
2bd4e71b24 Hyundai longitudinal (CAN): don't send FCA11 on non-FCA cars (#28479)
* Hyundai longitudinal (CAN): don't send FCA messages to non-FCA cars

* Update comments

* outside

* change to FCA11 only

* move down

* add todos

* Apply suggestions from code review

* add todo

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-18 23:38:36 -07:00
Shane Smiskol
2a38f38be1 common_fault_avoidance: take a bool (#29328) 2023-08-11 00:27:53 -07:00
Shane Smiskol
dba4492aa0 Clean up common steer fault avoidance code (#29200)
* fix spacing

* more spacing

* better names and comments

* this default doesn't make sense

* or this

* explicitly boolean since latActive is
2023-08-01 14:02:15 -07:00
Justin Newberry
a19f8dce92 Homogenize Steering Fault Avoidance (#29140)
* fix subaru fault

* try this!

* wip

* try this

* this more or less worked

* this is all under gen2

* that needs to be up there

* comment

* steer_angle

* test

* wip

* wip

* sync

* wip

* cleanup

* remove print

* use sets and fix unittests

* common fault avoidance

* common fault avoidance

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* revert subaru to get this part merged

* revert name change

* revert name change

* revert name change

* same as before

* add test case

* also verify zero tolerance

* keep the current behavior

* split into multiple tests for easier debugging

* added comments and remove tests

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Comma Device <device@comma.ai>
2023-08-01 10:27:06 -07:00
Shane Smiskol
475a4a23a2 Hyundai: explicitly copy signals to forward (#28020) (#28604)
* Revert "Revert "Hyundai: explicitly copy signals to forward (#28020)" (#28406)"

This reverts commit cabcde38ad.

* CRUISE_INACTIVE doesn't exist
2023-07-07 00:10:18 -07:00
Adeeb Shihadeh
cabcde38ad Revert "Hyundai: explicitly copy signals to forward (#28020)" (#28406)
This reverts commit f494abf0d2.
2023-06-05 09:49:11 -07:00
Shane Smiskol
f494abf0d2 Hyundai: explicitly copy signals to forward (#28020)
* define signals in brandcan.py

* seems so

* fix and reorder

* lkas11 for hyundai

* clu11

* honda: we only use this one signal for BRAKE_COMMAND

* Revert "honda: we only use this one signal for BRAKE_COMMAND"

This reverts commit f5f3aaed7e2fa1cdf35c3608b259fab11164644e.

* do cam and cruise info

* add todo

* do nissan

* s for signal

* do nissan

* mazda

* toyota

* gm

* ford

* ES_DISTANCE_SIGNALS is used twice

* for s

* volks

* tesla

* no copy

* oh there's mqbcan

* same with mqb lka message

* all s's

* these actually are different (pre vs. global)

* this is not in the DBC...

* fix

* check len

* rm import

* need to copy counter!

* fix other proc replay diff (TODO: the rest)

* missing cs/cnt
2023-05-26 00:00:18 -07:00
Adeeb Shihadeh
08e2149b0f Hyundai: factor out bus numbers (#27903)
* mv bus

* mv that

* if len

* fix tests

* use that

* same name
2023-04-14 11:23:22 -07:00
Shane Smiskol
581fd62d26 steer limits: rename common dist to meas function (#27453)
* rename function

* make a wrapper function (ford uses dynamic up/down limits

* make two functions consistent

* make torque function convert to int
2023-02-26 17:32:52 -08:00
Jason Wen
90ce7605c1 Hyundai: 2015-16 Genesis resume from standstill fix (#25579)
* Hyundai: 2015-16 Genesis resume from standstill fix

* Add comment

* Fix typo

* Merge both methods

* Add back the comment

* 20Hz not needed according to tester

* no new global state variable

* PCM's perspective: random counter -> random counter

* only send 5

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-02-15 17:33:04 -08:00
Shane Smiskol
65a9843ff9 Hyundai: detect LFA HDA message (#27323)
* detect lfa message

* comment

* ?

* fix

* Update ref_commit
2023-02-13 21:12:13 -08:00
Shane Smiskol
8f5057ff2d GM: enforce steering command message timing (#27250)
* draft

* bump opendbc

* still draft

* that's not right

* superset of the changes, 33hz

* cleanup

* this should work

* remove line

* pass it in again

* actually no need to check updated now

* now_nanos

* consistent name

* fix replay

* one line isn't that bad

switch

switch

* fix CarController tests

* Update ref_commit
2023-02-09 15:37:39 -08:00
Jason Wen
1816b499c4 HKG: Car Port for Kia K5 Hybrid 2020 (#26947)
* HKG: Car Port for Kia K5 Hybrid 2020

* Add test route (Experimental Mode)

* No abs

* remove extra trans

* move up

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-02-02 22:58:29 -08:00
Shane Smiskol
aab33b1c5f Lateral jerk unit test (#25759)
* stash

* more test

* less test

* clean test

* no angle

* add tolerance

* fix gm

fix gm

* test both

* lower some rates on hkg

* stash

* simpler

* bump panda

* Revert "bump panda"

This reverts commit f2137c221145cca723fe6ee3378ba947b7061965.

* only torque

* make kona pass

* duplicate __init__

* move

* half clean up

* half clean up

* more clean up

* more clean up

* fix static analysis

* calculate over 0.5 seconds

* limit to max steer

* type annotation

* calc once
2022-12-15 21:52:07 -08:00
Adeeb Shihadeh
151e0d8c39 controlsd: add blinkers to carControl (#26773)
* controlsd: add blinkers to carControl

* not actuators

* update refs
2022-12-12 14:03:09 -08:00
Adeeb Shihadeh
c9b8f6457e EV6 blinkers (#26618)
* right blink

* left blink

* rm debug

* just the support code

* revert panda

* behind flag
2022-12-11 14:19:53 -08:00
Shane Smiskol
f36a3664b0 CarController: log steer sent to the car (#26743)
* log value sent to the car

* rename

* bump

* Update ref_commit
2022-12-10 02:03:40 -08:00
Adeeb Shihadeh
122c314358 Hyundai: setup alt steering limits (#26685)
* Hyundai: setup alt steering limits

* value

* bump panda
2022-12-02 23:46:26 -08:00
hoomoose
9c5df76a6c Hyundai: longitudinal support for all CAN-FD EV and Hybrids (#26345)
* Update values.py

* Update interface.py

* Update interface.py

* Update carcontroller.py

* Update interface.py

* Update interface.py

* Update values.py

* Update values.py

* Update interface.py

* Update values.py

* Update interface.py

* Update carcontroller.py

* cleanup

* update docs

* bump panda

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-15 16:19:30 -08:00
Jason Wen
2d766fee14 HKG: Car Port for 2022 Kia Stinger (#26397)
* HKG: Car Port for 2022 Kia Stinger

* Substitute KIA STINGER GT2 2018 torque params

* bump panda

* Add test route

* Update CARS.md

* Not this checksum

* Update test route

* Update CARS.md

* Harness C -> Harness K

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-14 19:46:29 -08:00
Adeeb Shihadeh
b727f6cff4 EV6 long tuning (#26166)
* some matching and jerk limit

* update that

* one jerk limit

* little more

* more jerk

* bump opendbc

* update refs
2022-10-31 08:37:05 -07:00
hoomoose
3ee8572d58 HKG: resume from standstill for HDA1 CAN-FD (#26069)
* Cruise Button Press on bus 6 for HDA1 Canfd

* use bus helper

* Update hyundaicanfd.py

* Update hyundaicanfd.py

* Update hyundaicanfd.py

* Update hyundaicanfd.py

* Update selfdrive/car/hyundai/hyundaicanfd.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* Update selfdrive/car/hyundai/hyundaicanfd.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* bump panda

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-10-19 15:19:38 -07:00
Shane Smiskol
60fc7274eb Hyundai CAN-FD: remove 90° steering lockout (#26045)
* bump panda

* bump panda

* for CAN-FD too

* clean up

* bump

* adjust safety

* fix lat active

* bump panda to master

* same limits

* rm line

* bump panda to master
2022-10-17 21:15:57 -07:00
Adeeb Shihadeh
4ee0b8196f Hyundai: fix alt CAN-FD cancel (#26057) 2022-10-12 21:54:53 -07:00
Adeeb Shihadeh
3c0904a18f EV6 longitudinal (#26023)
* ev6 long

* update refs
2022-10-12 14:22:40 -07:00
Shane Smiskol
f74fefaffa Hyundai: remove 90° steering lockout (#24108)
* avoid 90 degree fault

* use 50 frames

* no panda mods

* clean up

* absolutely no faults. zero. zilch. nada

* fix initial value and comments

* try glitching at double rate instead of two in a row

* bump panda

* cut for two frames

* clean up

* bump panda

* clean up

* not today!

* bump panda to master

* prefix and simple lat_active

* prefix
2022-10-11 18:59:16 -07:00
Shane Smiskol
7418678132 Use longActive for car-specific override signals (#26030)
* add override field to cruiseControl

* need to check if long *can* be active

* bump cereal to master

* revert

* better

* fix

* update refs

* rename variable
2022-10-11 16:27:46 -07:00
Adeeb Shihadeh
2cba29eabe Hyundai: improve EV6 resume reliability (#25847)
* Hyundai: improve EV6 resume reliability

* this is pretty good

Co-authored-by: Comma Device <device@comma.ai>
2022-09-20 11:19:23 -07:00
HaraldSchafer
da6c7311a3 Improve Hyundai long control, and conform to longcontrol API boundaries (#25696)
* Variety of experimental improvements

* fix start accel

* typo

* No jerk, no go

* Set jerk limit lower

* Update ref
2022-09-07 19:09:37 -07:00
Shane Smiskol
6e062ea5d2 Optima 2019: set LKAS icon correctly (#25637)
* are we sure?

* add params

* should work

should work

* fix

* fix

* clean up

* comment

* comment

* Update selfdrive/car/hyundai/hyundaican.py
2022-09-01 16:19:21 -07:00
Jason Wen
bd5e28909f Hyundai: Car Port for Tucson Hybrid 2022 (#25276)
* Hyundai: Car Port for Tucson Hybrid 2022

* Update RELEASES.md

* Init gear_msg at the top

* FW versions from script

* Button send attempt

* start with some cleanup

* Send button fixed bits

* Define all bytes and only send PAUSE/RESUME

* Use CRUISE_INFO to cancel cruise and resume

* 8-bit counter

* Cleanup ish

* 8 bit counter

* Send at 20ms

* Disengage bits

* Revert bump submodules

* Allow tx on 0x1a0

* Fix byte counts

* Send LFA and HDA icons based on engageability

* Send cruise buttons only on HDA2 cars for now

* Add comments

* Add FLAG_HYUNDAI_CANFD_HDA2 flag

* Update interface.py

* Update carstate.py

* Update carstate.py

* Update carstate.py

* Bump submodules

* Bump panda

* Bump opendbc

* Allow tx with CRUISE_INACTIVE

* GEAR has 24 bytes only

* Generate car docs

* Fix CRUISE_INFO copy

* Remove unused class

* Add CAN-FD busses to unit test

* Bump opendbc

* Revert "Add CAN-FD busses to unit test"

This reverts commit 2f751640408a7f73a9100947cbd95ea13fbb8a48.

* Remove duplicate

* New tune based on data

* Panda safety cleanup

* Include bus 0 in rx checks

* Missed one

* bus 6 check

* Remove redundant check

* Add comments

* Bump opendbc

* Sync with DBC

* Hide LFA icon when disengaged

* Little endian

* fix comment

* more conditions in carcontroller

* update pedal signal

* update tuning

* cleanup carcontroller

* bump panda

* fix mismatch

* alt buttons

* little more cleanup

* update refs for EV6 new safety param

* bump panda

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-08-19 20:14:30 -07:00
Adeeb Shihadeh
5f35c669a6 Hyundai: rename HDA2 platform to CANFD (#25411)
* Hyundai: rename HDA2 platform to CANFD

* bump panda

* bump panda

* cleanup panda safety config
2022-08-11 22:49:49 -07:00
Jason Wen
1ab63cc8d8 Hyundai: support Kona Electric 2022 (camera SCC) (#23517)
* Rebase and merge upstream

* Bump panda

* bump panda

* todo comments, minor clean up

* Add test route

* send CLU11 on bus 2

* Update docs

* Use Chrysler cp ternary naming convention

* Add FW version

* Update with latest test route

* Use segment with engaging/disengaging and moving

* sort FW

* push ci route

* add comment

* bump panda

* bump panda

* clean up

* Limit torque

* bump panda

* bump panda

* bump panda

* Add missing FW

* Add CAN fingerprint (need to fix spotty queries)

* missing fingerprints

* bump panda

* use O

* It's 2022, how is SCC still not standard!

* space

* bump panda to master

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-08-03 00:59:03 -07:00
Adeeb Shihadeh
d462a08056 remove CS.steeringRateLimited (#25251)
* remove CS.steeringRateLimited

* bump cereal

* update refs
2022-07-24 14:56:55 -07:00
Adeeb Shihadeh
0ca62bf7df let can packer handle counter (#25240)
* let can packer handle counter

* diff is expected

* update refs

* clean that up

* bump opendbc

* fix sim
2022-07-21 20:54:53 -07:00
Adeeb Shihadeh
44c6ca7eb4 EV6: reject fake cruise engagements (#25143)
* EV6: reject fake cruise engagements

* bump panda

* raise to 8

* update refs

* bump panda

Co-authored-by: Comma Device <device@comma.ai>
2022-07-12 18:23:48 -07:00
Adeeb Shihadeh
f261b8a8c2 EV6: supress LFA (#25094)
* EV6: supress LFA

* bump panda
2022-07-08 22:09:37 -07:00
Adeeb Shihadeh
bd432eb76b move kona limit to car controller 2022-07-07 17:27:59 -07:00
Shane Smiskol
fd2de54172 Stock longitudinal: spam resume button when lead starts moving (#24873)
* always log leads, we hide them in ui

* only spam resume when future is > vEgoStarting

* do rest but vw

* vw

* remove comments

* rename to resume

* maintain original button msg rate

* mazda: ensure no resume if cancelling

* same for non-HDA2

* Always run planner if not opLong

* try 0.2

* 0.1 should be pretty safe

* add test for resuming

* fix test

* stricter test, speeds[-1] is 0.14 when starting here

* no walrus

* fixup mazda cc

* remove extra import
2022-07-07 00:24:03 -07:00
Shane Smiskol
d2c2154a32 Clean up CarControllers (#25008)
* do VW

* Do the rest

* unused

* ford cc formatting

* final clean ups

* also just return update output
2022-06-30 17:23:12 -07:00
Shane Smiskol
5c5bb0be11 Hyundai longitudinal: display lead on HUD (#24667)
* use leadVisible

* add comment
2022-05-27 18:12:18 -07:00
Adeeb Shihadeh
53a134f1c3 Kia EV6 (#24485)
* ev6 squash

* test route

* cleanup

* remove those

* resume spam

* setme

* more reliable button pressing

* new steer signals

* for now

* update docs
2022-05-23 19:16:17 -07:00
Shane Smiskol
c8f5b21744 Clean up CarInterface.apply and CarControllers (#24060)
* do tesla

* parentheses

* Do Chrysler

* Make sure Hyundai long never actuates when long inactive

.

* clean up Hyundai

* more clear

* formatting

* Stock sets these to zero

* fix params

* move jerk logic into CC

clean up
2022-04-05 23:38:45 -07:00