Commit Graph

31 Commits

Author SHA1 Message Date
Kacper Rączy
80bc61dc6c controlsd: use livePose (#33283)
* Pose calibrator

* Fix static analysis

* Fix static

* Fix test_latcontrol

* Fix test_latcontrol

* Update services in process replay

* Fix static

* Matmul not mul

* Add assertion

* Move pose calibration to data_sample

* Update ref commit

* Remove llk from cycle alerts

* Deprecated nogps event

* Switch power_draw to lp

* Bring back noGps alert

* Add handling code back

* get_bool

* Bring inputsok back
old-commit-hash: 9734015bbb
2024-08-13 21:11:16 -07:00
Shane Smiskol
3953eba4ac controlsd: no mutable carParams (#32381)
* no as builder

* fix car int test

* more
old-commit-hash: c95b58401a
2024-07-02 13:27:45 -07:00
Vivek Aithal
80195f1432 LatControlTorque: Add more inputs (#31252)
* add history and state to the ff inputs

* add history

* resolve comments

* remove history, simplify

* don't compute lateral accel, roll comp always
old-commit-hash: 056b330e8b
2024-02-01 04:12:48 -08:00
Harald Schäfer
f2106e0601 No curv rate for lateral control (#31042)
* No more Curvature rate for lat control

* Update cereal

* Update

* Fix lat control test
old-commit-hash: d36103791c
2024-01-17 16:00:50 -08:00
Adeeb Shihadeh
f408eb207a remove unused last_actuators arg from lateral controllers (#30595)
old-commit-hash: ce4bac8218
2023-12-03 15:54:18 -08:00
Adeeb Shihadeh
16ec56398c 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
old-commit-hash: a9626f95b6
2023-08-20 20:49:55 -07:00
Vivek Aithal
b6909a65e7 Bolt EUV: Non-linear torque function (#27696)
* add erf based ff

* silly bug; diff of nonlinear != nonlinear of diff

* add sigmoid based ff, ensure slope at 0 > 1

* reduce steer down limit and increase driver allowance

* rebase panda

* atry without friction, and with tanh nonlinear

* finalize the nonlinear function

* do not disable friction compensation in the ff

* bump panda

* bump panda

* update refs

* update refs

* resolve comments

* Add type hints

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 15b880c0ea
2023-03-29 15:10:39 -07:00
Adeeb Shihadeh
956918eb1d GM: revert custom Bolt torque tune (#27403)
* Revert "GM: cleanup torque feedforward function (#27347)"

This reverts commit cdd8f003e3571d4b33fc71c4bc23744cea02140c.

* Revert "Chevrolet Bolt: Non-linear torque tune (#27344)"

This reverts commit b6737ca5903ecaac3d6322b92112ccb67116b149.

* update refs
old-commit-hash: 2008332bd4
2023-02-21 15:27:48 -08:00
Vivek Aithal
5edcf1380e Chevrolet Bolt: Non-linear torque tune (#27344)
* add non linear tune

* update refs

* rerun tests
old-commit-hash: e49748d571
2023-02-14 16:20:28 -08:00
Jason Young
fda55793d0 controlsd: set latActive with max minimum steer speed (#26805)
* refactor minimum lateral speed handling

* rename for clarity

* simplify without joystick at standstill

* intermediate standstill variable, check notCar

* check joystick for now

* cmt

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: cb88b3ed65
2023-01-10 20:51:10 -08:00
Vivek Aithal
3029919422 [torqued] Fix high speed oscillations (#26338)
* modify low speed factor during high speeds and rescale friction

* update refs
old-commit-hash: e9eb5d99ff
2022-11-07 17:01:24 -08:00
HaraldSchafer
9c26b70a43 Partial revert, lax torque control (#26146)
* Closer to original

* Update ref
old-commit-hash: 1548db8962
2022-10-18 21:25:06 -07:00
HaraldSchafer
f9b65f9189 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
old-commit-hash: 2c9b150761
2022-10-11 14:53:43 -07:00
Vivek Aithal
51d25b2011 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>
old-commit-hash: 4fa62f1464
2022-09-19 15:19:26 -07:00
Vivek Aithal
3326487104 Torque Refactor (#25822)
* add torque gains refactor

* update refs

* avoid dict, use cereal struct

* bugfix

* no as_builder

* address final comments
old-commit-hash: 85ed5c4cb5
2022-09-17 00:07:54 -07:00
Adeeb Shihadeh
5263356958 remove CS.steeringRateLimited (#25251)
* remove CS.steeringRateLimited

* bump cereal

* update refs
old-commit-hash: d462a08056
2022-07-24 14:56:55 -07:00
HaraldSchafer
2d945b2fd5 Torque control: higher low speed gains and better steering angle deadzone logic (#24980)
* Try no friction and no deadzone

* Learn fromd ata

* update refs
old-commit-hash: b3226d505b
2022-06-27 15:25:47 -07:00
Adeeb Shihadeh
145f3c96ba cleanup torque tuning config (#24951)
old-commit-hash: 062a8bcdbd
2022-06-24 13:01:49 -07:00
HaraldSchafer
5e002bff96 Torque control: low speed boost (#24859)
* Make very low speed more aggressive

* Less extreme low speed boost

* Update ref
old-commit-hash: a6652a539d
2022-06-14 22:29:08 -07:00
HaraldSchafer
bc679f735d Misc torque control fixes (#24801)
* Fiction compensation should be based on error

* Update refs

* Add deadzone

* update ref
old-commit-hash: 843e59f6f0
2022-06-10 22:52:48 -07:00
ClockeNessMnstr
52a28d8938 update DH names + notes for MPC output curvatures (#24701)
* update names + notes for MPC outputs

"current_curvature" is not the correct description of what the MPC is outputting in it's curvature_ego state.
The MPC is integrating it's free variable, curvature_rate, such that curvature[0] is actually the desired_curvature before any delay.
inversely: the curvature_rate_desired is the desired rate of change to the setpoint and not the actual curvature rate. 

If we were to set the initial curvature = measured curvature in the MPC initiation these names would be correct. 
This was possibly how it was initially set up but the nomenclature here is now confusing.

* more notes

* match

* Clarify #1
old-commit-hash: b215d611b1
2022-06-07 09:41:03 -07:00
Shane Smiskol
1a2bf8412c Car documentation: set steering torque star using car interface (#24709)
* Set good torque using torque controller tuning

* should be equal to

* save lateral accel to car params

* use maxLateralAccel

* always

* same convention

* nan will always evaluate to false

* The great good torque purge

* adjust default friction

* Add data for more cars

* adjust name

* Welcome back, guys. Only adjust good torque if maxLatAccel is set

* Update refs (1.7 is 1.7000001...)
old-commit-hash: c6bc03311c
2022-06-03 17:41:20 -07:00
HaraldSchafer
f5a6a6dc77 Tssp prius torque control (#24669)
* use llk

* use steering sensor at low speed stil

* Try more simple

* rm prius tune

* updated ref
old-commit-hash: d708a134bd
2022-05-27 10:21:02 -07:00
HaraldSchafer
39886246c9 Rerevert torque control (#24649)
* Revert "Revert torque control (#24565)"

This reverts commit 93f434d047a92366c4ccefeece86fe101ed98d02.

* Move tune out of car specific stuff

* Update ref commit
old-commit-hash: d928972150
2022-05-24 17:52:33 -07:00
HaraldSchafer
51165e5df5 Latcontrol torque: integrator need not be reset (#24606)
slow integrators need not be reset
old-commit-hash: 2181bbca71
2022-05-20 13:50:47 -07:00
ClockeNessMnstr
a7dceb30ae LatControlTorque: clean up class variable (#24526)
* move to super

* no class variable

* there's CP

* whitespace

* drop CI from latcontrol super

* Revert "drop CI from latcontrol super"

This reverts commit 9218273060ade6431c4fc4c310b27e7e210158b9.

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: a693b3a26b
2022-05-13 16:52:20 -07:00
HaraldSchafer
3427eb411b Latcontrol torque: fix integrator induced ping pong (#24458)
* Latcontrol torque: fix integrator induced ping pong

* Reset on disengage since unwind resets anywayh

* Might be overkill

* rm whitespace

* update ref
old-commit-hash: 29afd53d88
2022-05-06 22:17:21 -07:00
ntegan1
af82274bac LatControlTorque: log desired/actual lateral accel (#24406)
* log torque lateral accel

* bump cereal

* update refs

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 9a44d4c4e0
2022-05-03 14:18:46 -07:00
Shane Smiskol
12d0a18a05 Clean up controllers (#24340)
* clean up lat controllers

* pass CP once

* sort
old-commit-hash: c9be2f02c3
2022-04-28 00:42:52 -07:00
Shane Smiskol
3e9694d3f3 LatControlTorque: fix deadzone and missing steer saturated warning (#24294)
* fix steer saturated alert and deadzone

* fix and formatting

* update refs

* update refs

* not needed

* remove
old-commit-hash: e834b4d9be
2022-04-27 01:18:05 -07:00
HaraldSchafer
2174005f05 Lateral torque-based control with roll on TSS2 corolla and TSSP rav4 (#24260)
* Initial commit

* Fix bugs

* Need more torque rate

* Cleanup cray cray control

* Write nicely

* Chiiil

* Not relevant for cray cray control

* Do some logging

* Seems like it has more torque than I thought

* Bit more feedforward

* Tune change

* Retune

* Retune

* Little more chill

* Add coroll

* Add corolla

* Give craycray a good name

* Update to proper logging

* D to the PI

* Should be in radians

* Add d

* Start oscillations

* Add D term

* Only change torque rate limits for new tune

* Add d logging

* Should be enough

* Wrong sign in D

* Downtune a little

* Needed to prevent faults

* Add lqr rav4 to tune

* Try derivative again

* Data based retune

* Data based retune

* add friction compensation

* Doesnt need too much P with friction comp

* remove lqr

* Remove kd

* Fix tests

* fix tests

* Too much error

* Get roll induced error under 1cm/deg

* Too much jitter

* Do roll comp

* Add ki

* Final update

* Update refs

* Cleanup latcontrol_torque a little more
old-commit-hash: fe0bcdaef6
2022-04-19 19:34:31 -07:00