Commit Graph

482 Commits

Author SHA1 Message Date
Bruce Wayne
75b7fd0a7d Revert "Use calibrator to stabilize wide transform (#26201)"
This reverts commit 42ef62e391.
2022-10-21 21:44:47 -07:00
HaraldSchafer
42ef62e391 Use calibrator to stabilize wide transform (#26201)
* Use calibrator to stabilize wide transform

* Need array

* Needs init

* Bump to master

* Needs to be arr

* publish mshg

* Check size

* Update ref
2022-10-21 20:30:48 -07:00
HaraldSchafer
4f84b29985 Use same minimum speed for lateral planning and controls (#26177)
* Use same speed for lag adjustmenet

* One is a nicer number

* Update ref
2022-10-20 14:34:36 -07:00
Adeeb Shihadeh
eaedfb9a66 Hyundai CAN-FD: use cruise signals from SCC ECU (#26171)
* Hyundai CAN-FD: use cruise signals from SCC ECU

* bump panda

* bumppanda

* update refs
2022-10-19 23:31:24 -07:00
Shane Smiskol
f6416e7769 Hyundai HDA2 detection: use ADAS ECU (#26130)
* use adas ecu

* new route

* update refs

* new route

* update refs

* new test routes

* bump
2022-10-19 14:21:03 -07:00
HaraldSchafer
1548db8962 Partial revert, lax torque control (#26146)
* Closer to original

* Update ref
2022-10-18 21:25:06 -07:00
ZwX1616
d522492ba0 DM: add use of e2e preds (#26078)
* try ml

* de56

* j914ef75a

* jd1124586

* jd1124586

* d112

* oops

* set

* update ref

* use offset

* bump DM power usage

* new ref
2022-10-17 19:40:06 -07:00
Shane Smiskol
c0840e0c33 Fix refs 2022-10-14 16:50:07 -07:00
Shane Smiskol
5d00e5cc71 GM: remove brake scaling (#26080)
* Don't add a weird factor to ret.brake

* update refs
2022-10-14 15:53:24 -07:00
Adeeb Shihadeh
c782380fc1 Hyundai: share panda flags with CAN-FD platform (#26058)
* Hyundai: share panda flags with CAN-FD platform

* move that

* only set bit

* bump panda

* panda master

* regen + update refs for new param
2022-10-12 21:54:08 -07:00
HaraldSchafer
b332441803 locationd: Fix GPS sensor times with fixed offsets (#25920)
* Rewind to qcom time

* Fix test

* Typo

* init unix_time fix

* add gps sensor_time_offsets

* remove all clocks code and add todo

* :emove clocks in unit test

* update refs

* update refs

Co-authored-by: nuwandavek <vivekaithal44@gmail.com>
2022-10-12 17:47:30 -07:00
Adeeb Shihadeh
3c0904a18f EV6 longitudinal (#26023)
* ev6 long

* update refs
2022-10-12 14:22:40 -07:00
Shane Smiskol
0f94d81b7a GM camera ACC: reduce LKAS faults on startup (#26039)
* GM camera ACC: no faults on start up 2.0

And by 2.0 I mean we don't need to wait for blocked msg support to be merged first to merge this without regressing accidental single blocked msg count handling.

* Send the camera counter + 1

* Keep updating the first counter until we get a message on the bus

* Only update right before sending so sent_lka_steering_cmd is updated first

* Update ref_commit
2022-10-11 22:33:37 -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
HaraldSchafer
2c9b150761 Low speed lateral like before (#26022)
* Add explicit cost on steering wheel movement

* Laxer low speed control

* Laxer low speed control

* Lower min speed now there is a cost

* 3m/s

* Similar to old master

* Add cost

* Crazy high

* Update ref

* comment
2022-10-11 14:53:43 -07:00
HaraldSchafer
fb07437819 Increase low speed jerk cost (#26008)
* Increase low speed jerk cost

* Update planner weight

* Update ref_commit

* Update lateral_planner.py

* cleanup and refactor

* Update ref_commit
2022-10-07 19:15:04 -07:00
Shane Smiskol
6ce511cc60 GM: use ECM brake-pressed threshold (#25970)
* This brake position value disengages stock ACC, use it to avoid controls mismatch. 2016-2017 Volt will hit this threshold and disengage, must install new design of brake pedal retaining clip, TSB 16-NA-147.

* 80 hz

* comment

* bump panda

* update refs

* bump panda

* bump panda

* bump panda

* bump panda to master

Co-authored-by: qadmus <42746943+qadmus@users.noreply.github.com>
2022-10-07 16:12:58 -07:00
HaraldSchafer
1ecf6f351c Divide by 0 bug fix lateral planner (#25995)
* Divide by speed correctly

* Update

* Update lateral_planner.py

* Update ref_commit
2022-10-07 00:16:18 -07:00
HaraldSchafer
cb0b7375b7 Rocket Launcher Model (#25963)
* 1456d261-d232-4654-8885-4d9fde883894/440 6b7d7cec-ead8-40f3-86cc-86d52c9b03fe/300

* compute only 9 tokens: 1456d261-d232-4654-8885-4d9fde883894/440 6b7d7cec-ead8-40f3-86cc-86d52c9b03fe/300

* tinygrad: cleanup gather

* 1456d261-d232-4654-8885-4d9fde883894/440 6b7d7cec-ead8-40f3-86cc-86d52c9b03fe/700

* empty commit for tests

* bump tinygrad

* dont use tinygrad matmul for now

* bump tinygrad

* 1456d261-d232-4654-8885-4d9fde883894/440 e63ab895-2222-4abd-a9a5-af86bb70e260/700

* float16 1456d261-d232-4654-8885-4d9fde883894/440 e63ab895-2222-4abd-a9a5-af86bb70e260/700

* increase steer rate cost

* Revert "increase steer rate cost"

This reverts commit 74ce9ab9be7ef17ecfec931f96851b12f37f2336.

* fork tinygrad

* empty commit for tests

* basics

* Kinda works

* new lat

* new tuning

* Move LATMPCN so scons compiles

* Update long weights

* Add tinygrad optim

* Update model ref

* update weights

* Update ref

* Try

* Error message for field ignore

* update model regf

* ref commit

* Fix onnx test

Co-authored-by: Yassine Yousfi <yyousfi1@binghamton.edu>
2022-10-05 21:43:38 -07:00
Vivek Aithal
ca746b0a18 Extend torqued (#25961)
* extend live torque to all hyundai and toyota cars

* update refs
2022-10-04 13:34:31 -07:00
Shane Smiskol
84adb8d925 GM: raise max brake (#25810)
* -4 didn't make any sense?

* comments

* comments

* update to 400

* bump panda

* remove unused iso limit vars

* update comments

* bump panda

* Update selfdrive/car/gm/values.py

* Update ref_commit
2022-10-04 00:39:19 -07:00
Shane Smiskol
4bd146ee7a Longitudinal planner: clip a_desired to cruise limits (#25928)
* Clip a_desired to cruise limits

* Update selfdrive/controls/lib/longitudinal_planner.py

* fix

* update refs

* explicit
2022-09-30 15:43:04 -07:00
Adeeb Shihadeh
80c40048cb sensord: test fixups (#25935)
* sensord: test fixups

* fix linter

* check freq

* fp seems reliable

* clean that up

* update refs

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Bruce Wayne <batman@z840-provisioning.internal>
2022-09-30 12:25:11 -07:00
Kurt Nistelberger
29d3ed2ce6 Sensor events splitup (#25714)
* PoC of reading sensors via interrupts instead of polling

* add Gyro and draft for magn

* add more functionality to gpio.cc

* change LSM gyro to interrupt

* resolve rebase conflict

* update BMX accel interrupt impl

* add interrupt collector thread to fetch in parallel

* change get_event interface to return true on successful read

* update BMX gyro interrupt impl

* update gpio.h/.cc according to comments

* address comments, rename Edgetype enum

* Edgetype to EdgeType

* update sensor interrupt interface

* add error handling, and read fd on trigger

* avoid sending empty messages

* fix build

* use gpiochip

* less diff

* gpiochip on both edges, but skip falling edge if rising edge is detected

* init last_ts with 0

* update sensord testcases

* update sensord testsweet

* test for pipeline

* readd with_process

* add null check

* move tests update to seperate PR

* sensord: improve test coverage (#25683)

* update sensord-interrupt testsweet

* address review comments

* inc stddev threshold

* fix format string

* add version 0 check again

* relax strictness after c3 with bmx tests

* relax strictness after tests

Co-authored-by: Kurt Nistelberger <kurt.nistelberger@gmail.com>

* address PR comments

* fix typo

* remove 4ms limit, and skip first 0.5sec of data

* revert disable_interuppt change to destructor

* fix and remove timing skip

* make gpiochip generic

* sensord port

* change from sensorEvents to separated events

* fix gyro usage

* add splitted sensor tests

* modify debug script sensor_data_to_hist.py

* refactor get_event interface to remove sensorEvent message type

* update locationd to non sensorEvent usage

* tmp commit

* fix replay

* fix accelerometer type

* fix sensor to hist debug script

* update sensord tests to split events

* remove rebase artifacts

* port test_sensord.py

* small clean up

* change cereal to sensorEvents-splitup branch

* upate sensorEvents in regen

* fix route generation for splitted sensor events

* regen cleanUp from sensorEvents change

* .

* remove light and temp from locationd

* add generic init delay per sensor

* .

* update routes

* move bmx gyro/accel to its own channel

* adopt sensor tests to bmx channel

* remove rebase artifacts

* fix sensord test

* handle bmx not present

* add bmx sockets to regen

* .

* .

* code cleanUp

* .

* address PR comments

* address PR comments

* address PR comments

* lsm clean up

* readd sensorEvents

* rever regen.py

* .

* update replay refs

* move channels

* fix artifact

* bump cereal

* update refs

* fix timing issue

Co-authored-by: Bruce Wayne <batman@workstation-eu-intern2.eu.local>
Co-authored-by: gast04 <kurt.nistelberger@gmail.com>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-09-29 14:31:54 -07:00
Adeeb Shihadeh
03977a8783 Revert "update replay refs"
This reverts commit 683096e309.
2022-09-28 21:42:58 -07:00
Kurt Nistelberger
683096e309 update replay refs 2022-09-28 21:38:31 -07:00
HaraldSchafer
1007df874f Minor ACC fixes (#25911)
* Change cruise accel limits

* Long tuning script looks good

* Cap cruise slowdown aggression in e2e mode

* Revert atau change

* Cleanup

* Update ref

* fix ref
2022-09-28 13:27:07 -07:00
Kurt Nistelberger
96ed5aa581 Sensor events regen (#25903) 2022-09-27 20:33:45 -07:00
Adeeb Shihadeh
4693a9d358 update refs 2022-09-22 10:40:23 -07:00
Vivek Aithal
4fa62f1464 Live torque (#25456)
* wip torqued

* add basic logic

* setup in manager

* check sanity and publish msg

* add first order filter to outputs

* wire up controlsd, and update gains

* rename intercept to offset

* add cloudlog, live values are not updated

* fix bugs, do not reset points for now

* fix crashes

* rename to main

* fix bugs, works offline

* fix float in cereal bug

* add latacc filter

* randomly choose points, approx for iid

* add variable decay

* local param to capnp instead of dict

* verify works in replay

* use torqued output in controlsd

* use in controlsd; use points from past routes

* controlsd bugfix

* filter before updating gains, needs to be replaced

* save all points to ensure smooth transition across routes, revert friction factor to 1.5

* add filters to prevent noisy low-speed data points; improve fit sanity

* add engaged buffer

* revert lat_acc thresh

* use paramsd realtime process config

* make latacc-to-torque generic, and overrideable

* move freq to 4Hz, avoid storing in np.array, don't publish points in the message

* float instead of np

* remove constant while storing pts

* rename slope, offset to lat_accet_factor, offset

* resolve issues

* use camelcase in all capnp params

* use camelcase everywhere

* reduce latacc threshold or sanity, add car_sane todo, save points properly

* add and check tag

* write param to disk at end of route

* remove args

* rebase op, cereal

* save on exit

* restore default handler

* cpu usage check

* add to process replay

* handle reset better, reduce unnecessary computation

* always publish raw values - useful for debug

* regen routes

* update refs

* checks on cache restore

* check tuning vals too

* clean that up

* reduce cpu usage

* reduce cpu usage by 75%

* cleanup

* optimize further

* handle reset condition better, don't put points in init, use only in corolla

* bump cereal after rebasing

* update refs

* Update common/params.cc

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

* remove unnecessary checks

* Update RELEASES.md

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-09-19 15:19:26 -07:00
Vivek Aithal
85ed5c4cb5 Torque Refactor (#25822)
* add torque gains refactor

* update refs

* avoid dict, use cereal struct

* bugfix

* no as_builder

* address final comments
2022-09-17 00:07:54 -07:00
Willem Melching
f73b041d43 Hyundai: match ego speed on dash (#25235)
* hyundai: match speed on dash

* still needs conversion to m/s

* always use CF_Clu_VehicleSpeed2

* clean up, like honda

* experiment

* to the source

* works pretty well on optima (matches exactly on Sonata)

* could be 0.5

* clean up test

* revert test_moedls

revert test_moedls

* woops

* woops.

* .

* fix hyst

* only CF_Clu_VehicleSpeed

* omgomgomg

* add all this mess because it always takes a while

* set vEgoCluster

* fix all rounding errors

* stash

* clean up

* clean up

* fix metric conversion

* only calculate when updated

* try to filter (didn't look great from plots)

* Revert "try to filter (didn't look great from plots)"

This reverts commit 7e9876c237341d07163985b0718fd9c553372e72.

* clean up

* update refs

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-09-16 17:33:38 -07:00
Shane Smiskol
b7dc1968cd GM minSteerSpeed: add some tolerance for Volt (#25809)
* add some tolerance for volts

* add comment

* update refs
2022-09-15 21:21:10 -07:00
Vivek Aithal
b133a4c9a8 regenerate replay segments for torqued (#25805)
* update segments in test_processes

* bump cereal

* update refs
2022-09-15 20:15:57 -07:00
Adeeb Shihadeh
a9f88503fe update refs 2022-09-15 13:55:36 -07:00
Shane Smiskol
d57e07eec0 HKG: lower torque rate limits for CAN-FD cars (#25770)
* Change ramp limits to 2/2 for CANFD cars

* Only the high torque CANFD cars

* comment

* Update selfdrive/car/hyundai/values.py

* Better to do 2/3 and for all cars

* bump to master

* update refs
2022-09-15 11:28:49 -07:00
Willem Melching
e699b0994c Honda: match current speed on dash (#25232)
* Honda Bosch: match speed on dash

* present on all cars

* all honda

* more explicit switching

* hyst

* hyst

* clean up

* Update ref_commit

* no bitwise

no bitwise

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-09-14 15:40:36 -07:00
Shane Smiskol
992707c172 controls: enter overriding state for steering override (#25617)
* lateral overriding is overriding

* Update test

* remove

* also could do something like this and only have one OVERRIDE ET

* Revert "also could do something like this and only have one OVERRIDE ET"

This reverts commit 5c381641c08961676a56a9718fbdaa84989ac249.

* full names

* bump cereal

* test every event type

* update refs
2022-09-13 23:20:45 -07:00
Shane Smiskol
973ea7440c Car docs: CAN-FD cars do not yet have op long (#25707)
* CAN-FD cars do not yet have op long

* update refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-09-08 11:41:29 -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
Adeeb Shihadeh
655a64b603 single longitudinal toggle for e2e and disable radar (#25688)
* single longitudinal toggle for e2e and disable radar

* write disable radar param

* rename

* better param name

* clean that up

* update refs

* update translations

* not live for experimental

* write it out

* vanish
2022-09-07 17:12:49 -07:00
HaraldSchafer
210a6163ac Let planner decide stopping state (#25643)
* Let planner decide stopping

* Refactor stop/start state machine

* Stay stoppe condition

* 1sec from target

* Add starting state

* Add starting state logic

* Undo some changes

* Update ref
2022-09-06 21:30:10 -07:00
Shane Smiskol
80533d6c03 Toyota: match dash set speed (#25649)
* 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

* match only set speed

* clean up

* clean up

clean up

* Update ref_commit

* update refs

Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-09-05 13:57:07 -07:00
HaraldSchafer
2eff6d0ebd Remove lane planning code (#25651)
* Remove all lane planning logic

* Revert "Update ref"

This reverts commit 8dcb08ebccbb5641443459ac40601a95cf605682.

* bump cereal

* Update ref
2022-09-04 13:07:51 -07:00
HaraldSchafer
593dfd0aed Faster a_ego filter (#25646)
* Faster a_ego filter

* :x
Update ref

* typo

* update ref
2022-09-02 16:19:06 -07:00
Shane Smiskol
3b602e2844 GM: update minimum steer speed (#25618)
* EUV is 10 kph

* Update ref_commit

* temp

* Revert "temp"

This reverts commit 90ce28b06ba623e7bd1252798af3c285b465e0ec.
2022-09-02 13:41:58 -07:00
Shane Smiskol
452d5e42ec Car docs: add auto-resume column (#25572)
* Move auto resume in sng to car interface

* Update docs

* shorter name, star

* order

* resumes?

* add hidden detail sentence

* good to know this works, but revert

* VW auto resume

* bump cereal to master

* Update ref_commit

* match cereal

* try this

* ?

?

* like this
2022-08-30 17:54:40 -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
Shane Smiskol
e5bb55ccd6 Toyota: remove STEERING_LKA frequency check (#25490)
* remove STEERING_LKA frequency check

* bump to master

* Update ref_commit
2022-08-18 22:23:39 -07:00
Shane Smiskol
5ed587ebef controls: block resume if cruise not previously engaged (#25402)
* see if this works at all

* can revert this

* think adding a no entry conditionally is nicer

* then we can revert this

* 0 makes more sense

* Revert "0 makes more sense"

This reverts commit efc89e8a2389ef58fbc0cec0a2872d24db524867.

* gm CC uses > 70

* bump cereal

* comment

* test on Honda

* whoops

* works

* add exception with todo

* moved button enable events to controlsd

* get rid of that

get rid of that

* different values for now

* car interfaces add enable event, controlsd can block it

* Regen and update refs

* delete if not set

* One place

one place

* regen routes are uninitialized first few frames

* Trim start of segment so it's like original segment

* stash

* regen

* not working

* clean up

* more cleanup

* revert

* bump ceral

* actually check resume button

* whoops

* pcmCruise cars don't use setSpeed, so we're good

* engage correctly in sim

* Update ref_commit

* Update refs
2022-08-17 18:03:33 -07:00