Commit Graph

37 Commits (master)

Author SHA1 Message Date
Adeeb Shihadeh 2219cb4478
cars: cleanup CS usage (#23957) 2022-03-18 15:39:22 -07:00
Shane Smiskol facf6c109d
Toyota: clean up CarInterface apply function (#23714)
* clean up CarController with intermediate variables only accessed once or twice

* format

* fixes and move frame to CarController
2022-03-16 20:06:17 -07:00
Shane Smiskol 629399a449
carControl: add long and lat active fields (#23859)
* proof of concept

* actuators packet describes which actuators are active

* bump cereal

* fixes

* not needed for this PR

* Do Toyota

* add back controlsState.active

* bump cereal

* rest of cars

* in actuators

* add active back

* which

* use controlsState.active for now

* will make an issue

* Update selfdrive/controls/controlsd.py

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

* move local lat_active checks into CC.latActive

* remove redundant checks

* move comment

move comment

* fix joystick mode

* get enabled from carcontrol

* do standstill check in controlsd

* make sure we consider the gas press case for GM

* use CC.actuators

* fix

* capitalization

* Bump cereal

Bump cereal

* make intermediate actuators

* similar convention to before

* clean that up

* update refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-03-13 20:58:44 -07:00
Adeeb Shihadeh 72e00a0768
No actuation while in pre-enabled state (#23658)
* No actuation while in pre-enabled state

* update refs
2022-01-28 16:03:44 -08:00
Cameron Clough a6e8d31602
Toyota: fix typo (#23548) 2022-01-16 09:35:53 -08:00
Dean Lee a653461dec
check in tuple instead of list (#23477)
* check in tuple instead of list

* Update selfdrive/car/toyota/carcontroller.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>

* Update selfdrive/car/mazda/interface.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2022-01-10 16:36:51 +01:00
cydia2020 a6aa094461
Toyota: only send gas interceptor message when openpilot controls longitudinal (#23357)
* Toyota: gate enableGasInterceptor behind openpilotLongitudinalControl

* fix carcontroller typo

* Revert "Toyota: gate enableGasInterceptor behind openpilotLongitudinalControl"

This reverts commit a974e8f8cf.

* put condition in carcontroller

* gate building can messages

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2022-01-04 16:02:53 +01:00
Willem Melching 4f1eb4278a
Log actuators after applying rate limits in CarController (#23230)
* return actuators from carcontroller

* log it

* pass to latcontrol

* chrysler

* gm

* honda

* more brands

* rest of the brands

* gm cleanup

* hyundai cleanup

* update ref

* rename field

* fix subaru

* add types

* more subaru fixes #23240

* consistent whitespace

* bump cereal
2021-12-16 13:08:20 +01:00
Kevin Robert Keegan 245b4d910c
Toyota: Display Blue Barriers When Engaged, Matches OEM Design (#23150) 2021-12-14 16:42:31 -08:00
cydia2020 b8c42d01eb
Toyota: remove unused ACCEL_HYST_GAP (#23121)
* fix typo in comments

* remove hyst gap from values.py
2021-12-03 22:56:11 -08:00
HaraldSchafer eda6993043
Toyota pedal rewrite (#23067)
* pedal redo

* add offset to compensate for creep and windbrake

* offset in standard units

* wrong size

* better creep values

* update ref
2021-11-30 10:50:06 -08:00
Erich Moraga d630ec9092
Add Lexus RC support (#22941)
* Add f/w firmware for Lexus RC under LEXUS_IS

`@ph33rl355#0529`  2020 Lexus RC F Track Edition  DongleID/route 32696cea52831b02|2021-11-16--23-12-02

Doesn't seem to need a full port, per user feedback...
https://discord.com/channels/469524606043160576/524327905937850394/910400788319326229

* Update CARS.md

* Separated Lexus RC from IS... still using IS DBC

* match lexus IS for now

* Update wheelbase to match published specs

I'm hesitant to touch `mass`, even though I know it's different from the IS.

* Add TOYOTA.LEXUS_RC test route

Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-11-22 14:22:28 -08:00
Adeeb Shihadeh b07ddad6ed comma pedal: rename create_gas_command -> create_gas_interceptor_command 2021-11-20 20:13:58 -08:00
Adeeb Shihadeh 70c1f19304
pedal: only send command while actuators active (#22942) 2021-11-16 22:38:23 -08:00
Adeeb Shihadeh 3b8fa4b7fd
controls: only send cruise cancel while cruise is enabled (#22359)
* controls: only send cruise cancel while cruise is enabled

* cleanup

* might actually do something

* update refs

* update refs again

* update refs
2021-09-28 12:30:50 -07:00
Willem Melching ec71aa0458
toyota: clean up accel command (#22145)
* toyota: clean up accel command

* revert comment

* fix HYST_GAP
2021-09-06 16:12:58 -07:00
HaraldSchafer 1ac89f14aa
Change car controller interface from gas/brake to acceleration (#21911)
* retune civic

* seems smooth

* back to normal

* new ref

* fix conflict

* runs

* rm

* accel scale is 4

* toyota should be good

* more cleanup

* fixup

* better naming

* update ref

* deprecated

* sending brake when not enable causes a fault

* rm gas and brake

* unused

* update ref

* acura logic is no more

* wrong before

* revert tuning cleanup

* adress comments

* update ref

* already on master

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-08-30 09:32:52 -07:00
sshane 16e4f432bf
Toyota: handle models with permanent low speed lockout (#21512)
* ignore permanent low speed lockout

* should always check in case not seen

* use cp_cam

* not bus 0

* change signal name according to ref dbc

* bump

* we don't rely on this

* bump

* Revert "Toyota: debug logging for low speed lockout (#21526)"

This reverts commit 7f2ad50fed.

* add back

* always add

* pass acc_type through

* Update selfdrive/car/toyota/carstate.py

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

* Update selfdrive/car/toyota/carstate.py

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

* only update acc_type if not enableDsu

* only add when using

* only for openpilot long cars

* only seen TSS2

* add todo

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-07-09 22:55:47 -07:00
Adeeb Shihadeh c72d163e14
deprecate CP.enableCamera (#21509)
* deprecate CP.enableCamera

* more removal

* one more

* update refs
2021-07-07 14:59:18 -07:00
CrispinFlowerday 7458e143e3
Subaru: show LDW on dash for correct lane (#20934)
* Emit correct alerts for LDW Left & Right on Subarus

This change switches the ldw event to use VisualAlert.ldw and
alters all cars to use the prior behaviour for that alert, except
global subarus - they emit the correct warning to the dash

* Remove whitespace, and add comment about not overwriting stock alerts

Co-authored-by: Crispin Flowerday <crispin@theflowerdays.com>
2021-06-07 15:06:28 -07:00
ShaneSmiskol ebc294296a
Toyota: Only use gas interceptor under 19 mph (#21101)
* pedal improvements

* pedal tuning under 19 mph, stock tuning above

* Correctly set tuning, and a temporary reference script

* looking good

* use minEnableSpeed

* minEnableSpeed will always be -1 if pedal since it's used for lockout

* add hysteresis around 19 mph for enabling pedal use

* parameterize minAccSpeed (enable speed is -1 when stop and go to allow engage, acc is min limit for acc commands)

* fix Prius later, 5 mph gap around switch speed

* define min_acc_speed in interface and CC

* use pedal gains up to 22 mph, and correctly use hysteresis above the switch speed

* only check this if pedal

* consolidate comment

* Change BP to switch tuning at 19 mph, define global constant

* Start at interceptor status

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

* update releases

* typo

* transition tuning from 19 to +3 mph

* change cmd names and update tuning comment

* Update RELEASES.md

* calculate new pedal gains

* little more clear

* even clearer

* same comment convention and hardcode new pedal tune

* bump cereal

* weird, got added in with the rebase

* three possible long tunings: pedal, improved non-pedal, and default non-pedal

* update refs

* future note: don't add submodules when rebasing!

* update refs

* update refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-06-03 15:11:10 -07:00
Adeeb Shihadeh a99a55ce2b
Send LTA msg on TSS2+ Toyotas (#19731)
* send blank lta msg on tss2+

* bump panda
2021-04-06 17:13:33 -07:00
Adeeb Shihadeh 312b681a46
cereal cleanup part 2 (#20092)
* car stuff

* thermal

* Revert "car stuff"

This reverts commit 77fd1c65eb.

* panda state

* camera stuff

* start deg

* most is building

* builds

* planner + controls run

* fix up paramsd

* cleanup

* process replay passes

* fix webcam build

* camerad

* no more frame

* thermald

* ui

* paramsd

* camera replay

* fix long tests

* fix camerad tests

* maxSteeringAngle

* bump cereal

* more frame

* cereal master
2021-02-16 21:39:32 -08:00
Willem Melching e4cf43c6fc
Move all CarControllerParams into values.py (#19663)
* toyota

* use scale from values.py

* nissan

* subaru

* honda

* gm

* toyota combine into CarControllerParams

* nissan refactor

* chrysler refactor

* mazda refactor

* hyundai refactor

* subaru refactor
2021-01-06 11:20:44 +01:00
Igor d93f07f5e6
Fix TSS2 creep issue, no need to send standstill request (#2716)
* Fix TSS2 creep issue, no need to send standstill request

* Forgot to add import

* Changed set to look in from TSS2_CAR to NO_STOP_TIMER_CAR
2020-12-16 17:40:52 -08:00
Shane Smiskol 89a6008841
don't wait for 4 seconds before it starts steering again after steering fault (#19520) 2020-12-16 12:24:42 -08:00
Adeeb Shihadeh 27754a277c enable E261 in flake8: two spaces before inline comment 2020-05-31 14:07:29 -07:00
Adeeb d9bf9f0a40
Enable more flake8 checks (#1602)
* enable some more flake8 checks

* some more quick ones

* bump opendbc

* e401

* e711 e712

* e115 e116

* e222

* e301

* remove that

* e129

* e701 e702

* e125 e131

* e227

* e306

* e262

* W503

* e713

* e704

* e731

* bump opendbc

* fix some e722
2020-05-30 20:14:58 -07:00
Willem Melching 49dd37b81b
Add code to steer using TSS2 LTA message (#1507)
* try again with toyota LTA

* Fix dbc and send at 50Hz

* Add commented code

* Remove unused import

* Remove that
2020-05-13 19:09:51 -07:00
Shane Smiskol e7ae7b9850
remove redundant ret.steerControlType line, fix indentation in toyota/carcontroller.py (#1442) 2020-04-30 14:11:31 -07:00
Adeeb 8d791d78dd
Abstract pcmEnable and pcmDisable events (#1350)
* don't need individual prev state vars since whole CS is copied

* don't need a whole function since toyota alerts were simplified

* better here

* abstract pcmEnable/pcmDisable events

* the flippening came to NEOS

* delete

* unused

* Revert "the flippening came to NEOS"

This reverts commit 91cfb73b29.
2020-04-10 16:12:58 -07:00
rbiasini a984da1f9c
removing ipas steering control option from toyota (#1193)
* removing ipas steering control from toyota
2020-03-04 10:42:36 -08:00
Adeeb 13f60eae91
Abstract CarInterface init (#1131)
* abstract CarInterface init

* unused

* subaru

* gm cleanup

* vw

* typo

* carcontroller

* more cleanup

* fix vw
2020-02-19 20:37:07 -08:00
rbiasini 0c67143c92
Carstate returns capnp struct (#1115)
* Before abstraction, adding speed init from VW as well

* strting to abstract carstate class

* fix bug and update lock?

* revert pipfile change

* another bug

* fix linter

* bug fix

* remove a bunch of diplicated kf code

* better to not have class vars. will abstract __init__ anyway later

* abstract common instance vars in carstate init and a generic gear parser static method

* abstract gear parser for chrysler

* abstract gm gear parser too

* remove unnecessary random vars

* Chrysler: carstate returns capnp struct directly

* revert ref commit

* test ref

* WIP

* more WIP

* ops, missed this conflict

* ford as well

* not sure why this got deleted

* no need to copy

* remove copy

* remove copy import

* remove unnecessary intermediate variable

* remove obsolete comments

* GM: have carstate returning capnp struct directly

* Honda carstate also outputing capnp struct

* hyundai too now returns capnp from carstate

* ops, not meant this

* Subaru carstate also returning capnp

* Toyota: capnp struct as output of carstate

* fix bool

* minor simplififcation in Honda

* no need to negate

* VW carstate returning capnp struct (#1118)

* VW carstate also returning capnp struct

* fixed typo

* Remove unused blinker button (#1119)

* remove unused blinker button

* ops, this wasn't meant

* remove blinker button for VW as well

* update ref

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-02-18 15:28:15 -08:00
Arne Schwarck 85f7064ca6
TARGET_IDS not used since 0.5 (#1071)
The function to send these values has been removed long ago and no other function is using them.
So it is time to remove them.
2020-02-10 11:19:20 -08:00
Adeeb dafdb79db2 Clean up ECU redundancy in selfdrive/car/* (#963)
* clean up ecu redundancy in selfdrive/car

* clean up gear parsing
2020-01-18 23:35:10 -08:00
George Hotz 71ead9adea selfdrive/car 2020-01-17 10:58:43 -08:00