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: 7254db3906
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: ab371f888a
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: 1801baba68
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: d09dffb7cd
2022-02-25 14:16:44 -08:00
martinl
2caf297f69 Remove unused MPC_COST_LONG class (#23843)
old-commit-hash: 160a8cfd58
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: 428d412c1f
2022-02-21 16:14:41 +01:00
ClockeNessMnstr
ee48659eee cleanup import chaining of T_IDXS (#23806)
old-commit-hash: f0b3593682
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: 85efde269d
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: 2c7845fce0
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: 14260c01c6
2022-02-17 16:47:42 +01:00
Adeeb Shihadeh
ddde46c503 keep the new alert consistent for process replay
old-commit-hash: f59adbeaaa
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: ff965c772b
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: 9535dc606d
2022-02-16 15:38:22 +01:00
Willem Melching
5a78f1d29c hide localizerMalfunction alert (#23730)
* hide localizerMalfunction alert

* update ref
old-commit-hash: 8effa2d878
2022-02-08 22:22:03 -08:00
Adeeb Shihadeh
c491f3fc2c for those who want to live in the moment
old-commit-hash: e6d8a84578
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: 1c31c9b7a3
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: ee71fd2fcc
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: cf9eee4272
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: 9de8f8cd8c
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: 6be70a063d
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: 3e9cb7fa12
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: 0681474840
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: f76328b426
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: 59894a6666
2022-01-17 13:57:53 -08:00
Dean Lee
384857f2b4 lateral_planner: use nympy.isnan().any() (#23500)
old-commit-hash: dbae5e7601
2022-01-12 15:56:41 +01:00
Dean Lee
54bdb321bd cleanup iterate keys in dictionaries (#23497)
old-commit-hash: a186bcc9f1
2022-01-12 12:42:50 +01:00
Dean Lee
58cafc8060 AlertManager: cleanup add_many (#23438)
old-commit-hash: 678732d0ce
2022-01-11 14:16:52 -08:00
Dean Lee
55233b753b use ndarray.tolist to convert numpy array to float (#23485)
old-commit-hash: 35ec6ac1cb
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: 233a6e4a62
2022-01-10 13:08:45 -08:00
Dean Lee
97c4cdc0cc LongControl: remove redundant check on active (#23481)
old-commit-hash: 4208fe018e
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: a653461dec
2022-01-10 16:36:51 +01:00
Dean Lee
75d00872e8 events: cleanup function any (#23479)
old-commit-hash: 8eec818ae6
2022-01-10 14:32:07 +01:00
Dean Lee
7276bf8197 controls: check contents in tuple instead of list (#23463)
old-commit-hash: b2beb5e6ba
2022-01-10 11:26:58 +01:00
Dean Lee
296925cd6a optimize alertmanager (#23433)
old-commit-hash: 09a835916b
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: a2e762e0b9
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: cf9792dc53
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: d3f064f5ca
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: 9cb0ebe37d
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: 9f88ba188a
2022-01-04 12:17:33 +01:00
Dean Lee
a55046c949 longcontrol/update: optimize capnp (#23382)
old-commit-hash: 5dc631fa1b
2022-01-04 11:32:54 +01:00
Dean Lee
3723b3a877 lane_planner.py/parse_model: follow capnp best practices (#23368)
old-commit-hash: f2520b6e80
2022-01-03 15:08:24 -08:00
Dean Lee
5fbbb129a6 lateral_planner.py/publish: follow capnp best practices (#23359)
old-commit-hash: 2ca0925da7
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: dc96d4bee7
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: 5387806400
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: 332f568a82
2021-12-24 11:18:39 -08:00
Adeeb Shihadeh
8f09da4407 bump cereal
old-commit-hash: 256c51e16a
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: c92199ab1a
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: f25121b736
2021-12-20 14:58:46 -08:00
George Hotz
6bac4f1c4a build for mac (#23048)
old-commit-hash: 16dd7ce1fe
2021-12-18 22:00:09 -08:00
HaraldSchafer
f64c2974b4 Road Roll Compensation Rebased (#23251)
* first commit

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