Commit Graph

56 Commits

Author SHA1 Message Date
Shane Smiskol
f597d63bf6 PlatformConfig: clean up and print all flags (#32369)
* script to print flags

* don't need

* SAL

* back

* fix
2024-05-07 15:00:02 -07:00
Shane Smiskol
3d0f9fb18f Platforms: less redundant string repr (#32233)
smol
2024-04-16 23:37:46 -07:00
Adeeb Shihadeh
23e8ad7397 cleanup pedal crc 2024-03-20 10:35:33 -07:00
thenhnn
489528dcae PlatformConfig: automatically get platform_str from the enum name (#31868)
* get platform_str from the enum name

* fix tests

* add migration table

* remove impossible todo

* Add link to PR in MIGRATION table

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

* Remove useless brand name comments and rename RAM_1500 to RAM_1500_5TH_GEN

* rename RAM_HD to RAM_HD_5TH_GEN

* rename references to RAM_HD and RAM_1500

* change "mock" to "MOCK" and rename torque data of Nissan Leaf 2018 IC

* remove MOCK from fingerprints.py

* change hard-coded car model in test_can_fingerprint.py/test_timing

* migration

* update ref

* space

* prius

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: justin newberry <justin@comma.ai>
Co-authored-by: Justin Newberry <jnewberry0502@gmail.com>
2024-03-19 11:16:02 -07:00
Adeeb Shihadeh
fa12a67228 remove pedal (#31903)
* remove pedal

* bump panda

* fix

* update refs
2024-03-17 22:42:49 -07:00
Justin Newberry
0b92f4e9ee more car info -> car docs (#31885) 2024-03-17 16:53:57 -07:00
Justin Newberry
655e5f7c3e rename CarInfo to CarDocs (#31879)
car info to car docs
2024-03-15 11:45:44 -07:00
Shane Smiskol
bdae188c6f docs: don't support multi-type car info (#31875)
don't support multi-type car info
2024-03-15 00:11:41 -07:00
Shane Smiskol
99610c8819 Revert "common PlatformFlags base class + test for < 32 bits" (#31793)
Revert "common PlatformFlags base class + test for < 32 bits (#31779)"

This reverts commit 8ba5d660f3.
2024-03-08 00:15:21 -08:00
Justin Newberry
8ba5d660f3 common PlatformFlags base class + test for < 32 bits (#31779)
* add 32 bit check

* space

* this is not required

* jk yes we do
2024-03-07 14:01:28 -08:00
Justin Newberry
25ccb2426c cars: remove CAR_INFO map (#31739)
* no carinfo map

* smaller diff

* not on mock
2024-03-06 11:22:12 -08:00
Justin Newberry
b0eae8c1b7 platformconfig and carspecs are now required, carspecs no longer kwarg (#31667)
* required

* mock can be a platform!

* default is mock

* fix that

* and that one
2024-03-01 11:31:51 -08:00
Justin Newberry
2e0db7f8d8 Hyundai: move car specs to platformconfig (#31661)
* specs

* override

* fixes 1

* fix 3

* fixes 4

* fixes

* fixes

* fixc

* fix number 723124

* that too

* fixes

* aa
2024-03-01 10:31:43 -08:00
Shane Smiskol
52ee070fe0 Toyota: use platform config (#31607)
* part 1. Toyota platform config

* more

* everything works now

* no more DBC

* janky but that saves a lot of car lines

* need to init inside values or else it won't be reliable

* no return

* fixes

* minor update

* common flags, no dbc grouping

* some clean up

* some clean up

* rename

* copied wrong :(

* another

* copied specs for easiest ones first

* second easiest

* fix erroneous commas

* more clean up

* do the rest

* bug

* the refactor is so error prone

* huh?!

* static

* fix stiffness factor

* detect unsupported DSU

* Revert "detect unsupported DSU"

This reverts commit 9b72de6c8ef282ce20f6472970874a960761884b.

* fix DBC diff

* test carparams

* test sets

* scratch

* catches this

* Revert "scratch"

This reverts commit de08daa9fb8cc0368c5847b669e87b1b2e577616.

* Revert "test sets"

This reverts commit 62402f9b021cdf16a27fd9fb0883d81169711cbd.

* Revert "test carparams"

This reverts commit b02971659c2a8268d0ac8fdff02231dc36b5a197.

* Update ref_commit
2024-03-01 02:14:33 -08: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
ac16c5518a add CAR.print_debug (#31652)
print debug
2024-02-29 15:01:47 -08:00
Justin Newberry
5734d7c2bf Honda: move to platformconfig (#31637)
* first

* Fixes

* not

* not

* Fixes

* fix

* cleanup + use sets for now

* update ref

* update ref
2024-02-29 11:29:40 -08:00
Justin Newberry
f775faf26d carspecs: add more units (#31646)
more units
2024-02-29 10:42:11 -08:00
Shane Smiskol
85150c0289 Platform config small cleanup (#31638)
no field, label mass, correct spacing
2024-02-28 23:54:41 -08:00
Justin Newberry
3a6c3315ab Subaru: move to flags within PlatformConfig (#31584)
* flags

* update ref

* use the flags directly

* use post_init (don't freeze)

* we can maintain frozen with custom class

* not preglobal

* move to common

* cleanup
2024-02-28 20:12:14 -08:00
Justin Newberry
d3f0f76a7e Nissan: move to platform config (#31599)
* do nissan

* cleanup + fix
2024-02-27 10:16:06 -08:00
Justin Newberry
9ecff49118 platformconfig: freeze all dataclasses (#31605)
* frozen

* frozen
2024-02-26 21:16:05 -08:00
Eric Brown
5012e15aa6 GM: move to platform config (#31553)
* subaru platform config

* forester wrong dbc

* spacing

* subaru car specs

* someday!

* more red diff

* Move GM to platform config

* Implement CarSpecs

* Simplify centerToFront

* Accidentally had subaru DBC

* Fix typo in DBC name

* done above

* two spaces

* that is moved up

* fix hardcoded fingerprints

* whitespace

* values

* better?

* fix

* bump

* fix

* fix

---------

Co-authored-by: Justin Newberry <justin@comma.ai>
2024-02-25 17:53:26 -08:00
Jason Young
da540eac13 VW: Move car specs to PlatformConfig (#31567)
* subaru platform config

* forester wrong dbc

* spacing

* subaru car specs

* someday!

* more red diff

* all brands can be done like this

* but this should be done first and thats subaru specific

* that seems very low but we shouldn't change it here

* as long as it subclasses str its fine

* well that sucked

* cleanup and follow refactor

* diff reduction

* oops

* fix

* force fingerprint

* Revert "force fingerprint"

This reverts commit 600fbcd7d559703601a06c8876a640de417e5b6c.

* space

* Fix specs

* this one too

---------

Co-authored-by: Justin Newberry <justin@comma.ai>
2024-02-25 17:38:17 -08:00
Cameron Clough
995250ae49 use pyupgrade to update to new typing syntax (#31580)
* add pyupgrade hook

* run pyupgrade (pre-commit run -a)

* ruff --fix

* Revert "add pyupgrade hook"

This reverts commit 56ec18bb6b8602a0b612f3803d96cdad14b52066.

* revert changes to third_party/

* manual type fixes

* explicit Optional wrapping capnp objects
2024-02-24 16:41:23 -08:00
Justin Newberry
1161d33c18 Subaru: move carspecs to PlatformConfig (#31550)
* subaru platform config

* forester wrong dbc

* spacing

* subaru car specs

* someday!

* more red diff

* all brands can be done like this

* but this should be done first and thats subaru specific

* that seems very low but we shouldn't change it here

* as long as it subclasses str its fine

* fix
2024-02-23 13:23:40 -08:00
Justin Newberry
73a497ded8 cleanup PlatformConfig (#31551)
cleanup
2024-02-22 17:49:27 -08:00
Justin Newberry
1ee8c9aa33 cars: introduce "platformconfig" to be a configuration for all relevant car information (#31542)
* this is decent

* make sure the docs don't change for now

* hackery

* these can live here
2024-02-22 15:58:37 -08:00
Adeeb Shihadeh
9719b22761 Update Python packages and pre-commit hooks (#29739)
* Update Python packages and pre-commit hooks

* fix linter

---------

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
2023-08-31 15:00:13 -07:00
Shane Smiskol
24f5a6170d car interfaces: handle buttons changing state without going unpressed (#26463)
* rename function first and foremost

* the function

* comment

* move usages over

* probably fine

* comments

* btn

* single line

* not comments

* fix keyword

* is it not clear?

* noEntry while holding cancel

* bumpo

* remove

* better?

* better?

* try this

* try this

* loop

* better

* more clear

* Revert "more clear"

This reverts commit 37e0277e4bfe6f1c553dbbcece6f532a280be62e.

* no optional

* fine

* add comment

* clean up honda

* one line

* can also do this

* but unclear

This reverts commit 1984a72cc8680b23c202695b8aeeb1aa28f7160c.

* bumppanda
2023-08-25 16:47:10 -07:00
Shane Smiskol
ed6e72ae1f car/__init__: missing ending newline 2023-08-25 00:43:29 -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
Shane Smiskol
8dcd108972 Rename CivicParams (#29459)
* CivicParams -> ReferenceCarParams

* remove usage in interface

* better name

* revert
2023-08-17 21:02:09 -07:00
Justin Newberry
7ec52da33a Subaru: calculate steering angle rate (#29409)
* calculate rate

* added adeeb's comment

* move to selfdrive/car

* that makes way more sense

* much simpler

* fix rate

* preglobal doesn't have a counter

* update ref

* merge

* update ref after merging
2023-08-15 15:28:46 -07:00
Jason Young
90c4bbe8e4 car interfaces: cleanup tire stiffness calculation (#28263)
* cleanup tire stiffness calculation

* bump cereal

* think these todos still apply

* gm: same default

* revert comments

* bump

* update refs

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-15 14:17:08 -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
f99ac84b5c CanBusBase: fix offset calculation (#28938) 2023-07-14 11:06:22 +01:00
Cameron Clough
28bf743693 selfdrive/car: reusable CanBus helper (#28489) 2023-06-10 22:50:19 -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
Shane Smiskol
d5688ae49f Angle control: fix limiting bug (#27428)
* fix steer up bug

* Update ref_commit
2023-02-23 16:18:32 -08:00
Shane Smiskol
41667d020a Car controls: common angle limiting function (#26732)
* common angle limiting function

* save a line
2022-12-08 16:26:41 -08:00
Jason Young
135270f65c Allow car port to define enable buttons (#25793)
* Allow car port to define enable buttons

* simplify

* oops
2022-10-12 16:27:23 -07:00
Shane Smiskol
ef26abcf65 ui: support ego speed hysteresis (#25702)
* toyota: match set speed from dash

* Use unit bit

* Use RSA2

* flip this

* Universal unit signal, set vEgoCluster

* remove this and bump opendbc

* detect if car interface sets cluster fields

* revert

* needs to be cp

* UI_SPEED is actually always in kph?

* forgot to actually convert it

* same in onroad

* try conv factor only for imperial

* Seems like UI_SPEED is not the UI speed at all

* the dash might floor it

* same openpilot behavior

* bump

* ego speed factor is dynamic across speeds, handle Lexus exceptions with
diff msg

* remove test, bump opendbc

* secret formula

* secret formula v2

* 1.03 is sufficient

* try short press

* bump opendbc

* surely this can be cleaned up

surely this can be cleaned up

* use filter

* redo factors

* try UI_SPEED again with a factor

try UI_SPEED again with a factor

* dash applies hysteresis to speed. this matches pretty well, but not exactly

* make hysteresis generic

* clean up

* revert this

* try this

* read from fake params

* should be mostly good for imperial now

* revert

* revert

* remove toyota stuff

* common function for everyone

* rm line

* fix

* an example with Toyota

* use CS.out

* one mph

* 1 kph

* cmt

* remove cmt

* abs it

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2022-09-13 23:34:51 -07:00
Adeeb Shihadeh
baef4c1fb2 expand fingerprint dict size for multipanda setups 2022-08-17 15:30:20 -07:00
Shane Smiskol
40deea7d7b Honda: fix enabling before PCM (#24715)
* Don't enable for pcmCruise Honda

* make it a no entry as well

* do in another PR
2022-06-02 22:06:01 -07:00
Shane Smiskol
eed6803ccc Button-enable cars: common functions for button events (#24678)
* function for creating button events

* fix

* one line

* alphabetical

alphabetical

* only needed once

* common function for enable events

* add to list

* extend

* fixes

* add type hints

* flip around
2022-06-01 12:03:34 -07:00
Dylan Herman
d2eef1955c add mypy check for return-any (#24379)
* add mypy check for return-any

* remove unused import

* typing

* remove unnecessary variable typing

* cleanup

* cleanup

* bump submodules

* small fixes

* only a problem on mac

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2022-05-12 14:59:00 +02:00
Adeeb Shihadeh
b07ddad6ed comma pedal: rename create_gas_command -> create_gas_interceptor_command 2021-11-20 20:13:58 -08:00