Commit Graph

452 Commits

Author SHA1 Message Date
Shane Smiskol 83e26d674f LongControl: fix control state oscillation (#23333)
* check if plan is to accelerate or not

* remove comment

* needed to see it

needed to see it

* test logic with Toyota TSS2

* hackily log conditions

* Revert "hackily log conditions"

This reverts commit 7a6b5691e2b982c7a1e3911d980fb7530647affd.

Revert "test logic with Toyota TSS2"

This reverts commit e583d6e3caaa5f5b896165cd7949dfc1caabfd9a.

order

* revert

* fix
old-commit-hash: 7254db3906eedf06da9e6e6947233848599a7862
2022-03-03 03:27:24 -08:00
Jonathan Frey 0d5d9a43d3 Longitudinal MPC set qp tolerance to 1e-3 (#23899)
* initialize solverExecutionTime longitudinal_planner

* test_onroad: improve timing evaluation

* longitudinal MPC: set qp_tol to 1e-3

* update ref

Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
old-commit-hash: ab371f888a8ee0d309130bd56aba04ab84820921
2022-03-02 21:38:40 -08:00
Jonathan Frey aa549592f7 remove trivial terminal constraint and associated CasADi generated functions (#23898)
* remove trivial terminal constraint and associated CasADi generated functions

* Update refs

Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
old-commit-hash: 1801baba68c752ee424338cf56bd36ba3ccf1565
2022-03-02 20:53:21 -08:00
Jonathan Frey baab5d7a7b Cython acados and minor (#23835)
* acados_ocp_solver_pyx.pyx: implement get_stats for timings and ints

* long_mpc: use acados timers

* acados_ocp_solver_pyx.pyx: fix dynamics_get

* acados_ocp_solver_pyx.pyx: get statistics

* use acados_ocp_solver_pyx.pyx from commaai/cython2 branch

* acados_ocp_solver_pyx.pyx: implement store_iterate

* acados_ocp_solver_pyx.pyx: implement get_residuals

* acados_ocp_solver_pyx.pyx: fix set() for empty fields

* acados_ocp_solver_pyx.pyx: load_iterate

* cython acados: add print_statistics

* test_following_distance: fix typo

* test_longitudinal: unique names for test maneuvers

* longitudinal MPC: comments for evaluation

* longitudinal MPC: add comments to eval acados residuals

* long_mpc: use qp_solver_cond_N = 1

* long MPC: comments, simplify set_cur_state

* update acados version in build script

* longitudinal mpc: weigh a_change in 1 place only

* update ref

* Update ref

Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
old-commit-hash: d09dffb7cd99aefb7e3c251265f2cfd9ae9e72f8
2022-02-25 14:16:44 -08:00
martinl 2caf297f69 Remove unused MPC_COST_LONG class (#23843)
old-commit-hash: 160a8cfd58588a5451bd6c06c3d78e22465cff87
2022-02-23 17:26:05 -08:00
Willem Melching dc16307917 longitudinal planner: disable change cost when stopped. not engaged or gas pressed (#23639)
* disable change cost completely on standstill and gas press

* cleanup

* set accel to zero

* clean up logic around standstill

* update ref
old-commit-hash: 428d412c1f5480c527b296ed85185de34f5082c2
2022-02-21 16:14:41 +01:00
ClockeNessMnstr ee48659eee cleanup import chaining of T_IDXS (#23806)
old-commit-hash: f0b3593682c1e83c11c38a463063077e53cac5ad
2022-02-20 17:03:01 -08:00
Willem Melching ad5ccabce3 bigmodel (#23684)
* Added wide cam vipc client and bigmodel transform logic

* Added wide_frame to ModelState, should still work normally

* Refactored image input into addImage method, should still work normally

* Updated thneed/compile.cc

* Bigmodel, untested: 44f83118-b375-4d4c-ae12-2017124f0cf4/200

* Have to initialize extra buffer in SNPEModel

* Default paramater value in the wrong place I think

* Move USE_EXTRA to SConscript

* New model: 6c34d59a-acc3-4877-84bd-904c10745ba6/250

* move use extra check to runtime, not on C2

* this is always true

* more C2 checks

* log if frames are out of sync

* more logging on no frame

* store in pointer

* print sof

* add sync logic

* log based on sof difference as well

* keep both models

* less assumptions

* define above thneed

* typo

* simplify

* no need for second client is main is already wide

* more comments update

* no optional reference

* more logging to debug lags

* add to release files

* both defines

* New model: 6831a77f-2574-4bfb-8077-79b0972a2771/950

* Path offset no longer relevant

* Remove duplicate execute

* Moved bigmodel back to big_supercombo.dlc

* add wide vipc stream

* Tici must be tici

* Needs state too

* add wide cam support to model replay

* handle syncing better

* ugh, c2

* print that

* handle ecam lag

* skip first one

* so close

* update refs

Co-authored-by: mitchellgoffpc <mitchellgoffpc@gmail.com>
Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 85efde269da2680a77c75c248aafc8c29435ca98
2022-02-19 16:06:31 -08:00
Shane Smiskol 1f5570a96d Longitudinal control: interpolate longitudinal plan (#23787)
* interpolate longitudinal actuator delay

rename

* formatting

* interpolate v_target most importantly!

* fix interpolation and rename

* nicer setup

* left in from testing

* update refs
old-commit-hash: 2c7845fce0be2bfa72a5d2429daa35fb735c154c
2022-02-18 00:45:00 -08:00
Willem Melching 849bbc8a2f process replay: fix branch name alert (#23783)
* env is modified after start

* update ref
old-commit-hash: 14260c01c6a91554a63377acfce504758af4d096
2022-02-17 16:47:42 +01:00
Adeeb Shihadeh ddde46c503 keep the new alert consistent for process replay
old-commit-hash: f59adbeaaa4ac8634cba663fa39679f4af0c9325
2022-02-16 23:47:02 -08:00
Adeeb Shihadeh 693b66c1e0 add branch name to startup master alert (#23782)
* add branch name to startup master alert

* still orange

* update refs
old-commit-hash: ff965c772bd1bc85dec717d090cee4466033ce73
2022-02-16 20:27:07 -08:00
ClockeNessMnstr c12656f397 Longitudinal: add Kf to carParams (#23752)
* sane_kf

* long_kf + cereal

* update ref

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 9535dc606dddfe6f0807e0b7b2e21867304e507a
2022-02-16 15:38:22 +01:00
Willem Melching 5a78f1d29c hide localizerMalfunction alert (#23730)
* hide localizerMalfunction alert

* update ref
old-commit-hash: 8effa2d8786b408222c504bed241426b9c8f6f0b
2022-02-08 22:22:03 -08:00
Adeeb Shihadeh c491f3fc2c for those who want to live in the moment
old-commit-hash: e6d8a845782e1b902b2966edb3c39c882e735b97
2022-01-31 14:30:40 -08:00
Jafar Al-Gharaibeh 055b8b06e6 Mazda: alert when LKAS is disabled (#23288)
* Mazda: alert when LKAS is disabled

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* update refs

* revert that

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 1c31c9b7a3b0ee72b9dca443067deab793e19187
2022-01-30 21:04:07 -08:00
Willem Melching 9f202e63f5 clip steer saturation counter to steerLimitTimer (#23638)
* clip steer saturation counter to steerLimitTimer

* update ref
old-commit-hash: ee71fd2fccdca9c311d7912f1fbaae6d50aac27a
2022-01-27 12:31:36 +01:00
Willem Melching 6101a6caca INDI: replace internal rate limit by actuatorsOutput (#23243)
* INDI: replace internal rate limit by actuatorsOutput

* update ref
old-commit-hash: cf9eee4272f4ea3c810c9caf4bbd220f04eb4af2
2022-01-26 17:45:05 +01:00
Shane Smiskol beeb0442ce base LatControl class (#21967)
* base LatControl class, move sat check out of pid.py

clean up

clean up

* fix

* global variable for min control speed

* nicer name

* unify latcontrol class init arguments

* add to release files

* saturated if close to limit

* move angle mode saturation checks into class

* check_saturation function takes in current saturated status

undo

* apply latcontrol_angle's active checking to all controllers

* clean up

* move those back

* make abstract baseclass

* add test for saturation

* keep clip

* update ref

* fix static analysis

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 9de8f8cd8c384596868edf3307da51819b28bb4b
2022-01-26 17:10:41 +01:00
Shane Smiskol a790a658f8 LateralPlanner: Move lane change logic to another class (#23476)
* should work

* Revert "should work"

This reverts commit dabc2ea17a072a6c835e4bd1c75a2c1e2d10623d.

* move lane change logic to DesireHelper class

* clean up desires

clean up desires

* comments

* Revert "clean up desires"

This reverts commit 7301c921e305fcbd4746b19040631d935d50dfd9.

* Update selfdrive/controls/lib/desire_helper.py

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

* add to files_common

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 6be70a063dfc96b9e9f097f439bdc2e0be54d6d9
2022-01-25 13:40:03 +01:00
Adeeb Shihadeh 70f1418256 remove community features toggle (#23214)
* remove community features toggle

* bump cereal

* little more

* update refs
old-commit-hash: 3e9cb7fa12b5f686fdcf6122ef5979d01c41f0a3
2022-01-24 14:49:47 -08:00
Jonathan Frey 6f4c93238f work on acados lateral MPC (#23558)
* lat_mpc: make v_ego, rotation_radius parameters instead of states

* lat_mpc: remove rotation_radius argument, since it is part of the parameters

* lat_mpc: use qp_solver_cond_N = 1

slightly faster and in line with case study in Fig. 2/ 3 in Frison2016 - https://cdn.syscop.de/publications/Frison2016.pdf
An Efficient Implementation of Partial Condensing for Nonlinear Model Predictive Control

* adapt test_lateral_mpc to formulation with parameters

* lat_mpc: set parameters in reset() and copy values

* acados_ocp_solver_pyx: make options_set useable

* update ref

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 06814748409bd8538edca1b2bcef66f15e1c3ab6
2022-01-18 09:49:48 -08:00
Willem Melching dce057d29f Log MPC solver time (#23566)
* add solve time to plan output

* add to process replay ignore list

* print in CI
old-commit-hash: f76328b426979583e6a4b8c89f0bbfac6c631896
2022-01-18 14:51:03 +01:00
Adeeb Shihadeh c2a23fa24c clear no entry alerts if engaged (#23559)
* clear no entry alerts if engaged

* fix test
old-commit-hash: 59894a66669f72dd65acf8f7556c43007d1af68e
2022-01-17 13:57:53 -08:00
Dean Lee 384857f2b4 lateral_planner: use nympy.isnan().any() (#23500)
old-commit-hash: dbae5e760101da63a983162e132f327421b3220a
2022-01-12 15:56:41 +01:00
Dean Lee 54bdb321bd cleanup iterate keys in dictionaries (#23497)
old-commit-hash: a186bcc9f16c08f405dda92b8ac9e8a80895cdc7
2022-01-12 12:42:50 +01:00
Dean Lee 58cafc8060 AlertManager: cleanup add_many (#23438)
old-commit-hash: 678732d0ce93446f0468893c6faf6e1d1e20ee6e
2022-01-11 14:16:52 -08:00
Dean Lee 55233b753b use ndarray.tolist to convert numpy array to float (#23485)
old-commit-hash: 35ec6ac1cb98f7d671edcb928a2b97d749a1edde
2022-01-11 14:34:47 +01:00
Shane Smiskol 56b3c7f790 LanePlanner: offsets cleanup (#23459)
* update comments

* model y axis was flipped so flip the offsets as well

* fix
old-commit-hash: 233a6e4a625a8ef145904522e4663177bcd3d65d
2022-01-10 13:08:45 -08:00
Dean Lee 97c4cdc0cc LongControl: remove redundant check on active (#23481)
old-commit-hash: 4208fe018e898d9f3cde1b2ac8feb29d9bb11ce6
2022-01-10 18:46:02 +01:00
Dean Lee 98de810849 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>
old-commit-hash: a653461dec18b1313148905172ba54bac9f5fdfd
2022-01-10 16:36:51 +01:00
Dean Lee 75d00872e8 events: cleanup function any (#23479)
old-commit-hash: 8eec818ae625fd2311bd3d5f9976d034674cb13e
2022-01-10 14:32:07 +01:00
Dean Lee 7276bf8197 controls: check contents in tuple instead of list (#23463)
old-commit-hash: b2beb5e6ba6eda6354e93649a5b5829c9c4537bc
2022-01-10 11:26:58 +01:00
Dean Lee 296925cd6a optimize alertmanager (#23433)
old-commit-hash: 09a835916b0c10175c5658a92cf5ca23a337cb19
2022-01-06 22:15:32 -08:00
Dean Lee 521e3d843b longcontrol: check if speeds is empty (#23410)
* check if speeds is empty

* move into existing check

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: a2e762e0b96c7ff271dcfd41c0ca7c12018444f0
2022-01-05 14:23:08 +01:00
Shane Smiskol d05c173fe6 Longcontrol: remove starting state (#23328)
* remove starting state

* new ref

* ready for merge

* try this

* cereal now on master

Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
old-commit-hash: cf9792dc536db343447cfa64edecc72565c4eefd
2022-01-04 15:40:39 -08:00
HaraldSchafer c90287391a Controlsd: fix bug in curv rate limit (#23250)
* Controlsd: fix bug in curv rate limit

* update ref
old-commit-hash: d3f064f5ca2563ab139687550eb5d3139b6b8fea
2022-01-04 13:21:56 -08:00
Shane Smiskol b500034b8d LongitudinalMpc: Remove class accel_limit_arr (#23295)
* remove class accel_limit_arr

remove class accel_limit_arr

* make it static

* only set static parameters once

* just use existing function

style

* Update selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py

* Update selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 9cb0ebe37d234b292e5f2a482924a6f23ab77ba9
2022-01-04 16:00:29 +01:00
Shane Smiskol efd1ff1452 Longitudinal planner: make v_desired a FirstOrderFilter (#23341)
* make v_desired a FirstOrderFilter

* forgot one

* one more ref

* Add a new object for the filter

* fix

* fix tests

* update ref

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 9f88ba188a19cd90e8fee48353668dda7b47b2ba
2022-01-04 12:17:33 +01:00
Dean Lee a55046c949 longcontrol/update: optimize capnp (#23382)
old-commit-hash: 5dc631fa1bf471264fceab67edfe4c3962ac9831
2022-01-04 11:32:54 +01:00
Dean Lee 3723b3a877 lane_planner.py/parse_model: follow capnp best practices (#23368)
old-commit-hash: f2520b6e80125a108108b7acef1a10ab55b51284
2022-01-03 15:08:24 -08:00
Dean Lee 5fbbb129a6 lateral_planner.py/publish: follow capnp best practices (#23359)
old-commit-hash: 2ca0925da7fd94a5f12a4ebe14a394a09703a212
2022-01-02 11:55:24 -08:00
George Hotz 86a39e838b Add More Types for mypy (#23268)
* mypy passes

* a few more

* a few in manager

* more types, will lint

* more

* simple types

* events type

* Update selfdrive/thermald/thermald.py

* Apply suggestions from code review

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: dc96d4bee7b898172a6a15de4799af0e2d35605e
2021-12-28 18:07:00 +01:00
Shane Smiskol d5bf8e0e65 LongitudinalMpc: minor clean up (#23296)
* correct order

* formatting

* Revert "formatting"

This reverts commit 481c390f400179f5d0d8f9b5a3066cb68e484d0c.

* use np.zeros

* typos and formatting

* typo

* typo
old-commit-hash: 5387806400ff9258e158e0400683a2c9a5e6c043
2021-12-28 12:05:52 +01:00
Ewout ter Hoeven f206ebd054 Pyupgrade 3.6: Update syntax with Python 3.6+ features (#23305)
Updated Python code with Python 3.6+ features:
- utf-8 encoding is now the default (PEP 3120)
- Replace list comprehensions by Generator Expressions (PEP 289)
- Replace yield loop by yield from (PEP 380)
- Remove the (object) subclass when defining a class
- Replace the IOError alias by OSError (PEP 3151)
- Define sets with curly braces {} instead of set()
- Remove "r" parameter from open function, which is default

Co-Authored-By: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-Authored-By: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>

Co-authored-by: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-authored-by: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>
old-commit-hash: 332f568a8241fba9459cb70c76840b9670e6993a
2021-12-24 11:18:39 -08:00
Adeeb Shihadeh 8f09da4407 bump cereal
old-commit-hash: 256c51e16afdf4a8fa7089cc9c318c07b15504a7
2021-12-20 23:04:27 -08:00
Adeeb Shihadeh 55d6972d08 Revert "Mazda: alert when LKAS is disabled (#23273)"
This reverts commit e67713edb1f62957974f20a0f7eceb2fc9efb1f4.

old-commit-hash: c92199ab1a94d2ea565e68e513bf4f9e3e81d489
2021-12-20 23:02:02 -08:00
Jafar Al-Gharaibeh 9b7dd754c4 Mazda: alert when LKAS is disabled (#23273)
* Mazda: alert when LKAS is disabled

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Update selfdrive/controls/lib/events.py

* Update selfdrive/car/mazda/interface.py

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: f25121b7364a2babef5022e852cf97570bee6da2
2021-12-20 14:58:46 -08:00
George Hotz 6bac4f1c4a build for mac (#23048)
old-commit-hash: 16dd7ce1fe2a2b0537fefd5ad131d1494d0d09ad
2021-12-18 22:00:09 -08:00
HaraldSchafer f64c2974b4 Road Roll Compensation Rebased (#23251)
* first commit

* update refs
old-commit-hash: cf466222f623df5fac325b86b71dc4e181b40d55
2021-12-16 17:34:12 -08:00