Commit Graph

492 Commits

Author SHA1 Message Date
Willem Melching
ee71fd2fcc clip steer saturation counter to steerLimitTimer (#23638)
* clip steer saturation counter to steerLimitTimer

* update ref
2022-01-27 12:31:36 +01:00
Willem Melching
cf9eee4272 INDI: replace internal rate limit by actuatorsOutput (#23243)
* INDI: replace internal rate limit by actuatorsOutput

* update ref
2022-01-26 17:45:05 +01:00
Shane Smiskol
9de8f8cd8c 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>
2022-01-26 17:10:41 +01:00
Shane Smiskol
6be70a063d 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>
2022-01-25 13:40:03 +01:00
Shane Smiskol
31d147dca2 controlsd: verify unsafe mode consistency (#23563)
* add unsafe mode check to controlsd

bump submodules

forgot to add to health_t struct

bump

ahh forgot to set it!

bump

bump

clean up

clean up

bump

* fix ordering

* move to end

* unsigned

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2022-01-25 12:09:13 +01:00
Adeeb Shihadeh
e50efd7671 controlsd: remove redundant condition 2022-01-24 21:28:30 -08:00
Adeeb Shihadeh
3e9cb7fa12 remove community features toggle (#23214)
* remove community features toggle

* bump cereal

* little more

* update refs
2022-01-24 14:49:47 -08:00
Willem Melching
d3d10e014a Ensure controlsd can engage again in process replay (#23556)
* hacks to make process replay engage again

* dont change that

* enable engagement check again

* chmod +x

* first working regen

* proper logMonoTime

* fix video framerate consistency

* mpc is valid again

* proper alive checks

* revert loggerd change

* ensure engaged in regen, fix managerState, peripheralState

* ubloxRaw is unused

* add submaster config for gm

* regen all services we can run without HW

* fix loggerd

* loggerd: matroska without the extension

* update ref
2022-01-21 13:13:34 +01:00
Jonathan Frey
0681474840 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>
2022-01-18 09:49:48 -08:00
Willem Melching
f76328b426 Log MPC solver time (#23566)
* add solve time to plan output

* add to process replay ignore list

* print in CI
2022-01-18 14:51:03 +01:00
Adeeb Shihadeh
59894a6666 clear no entry alerts if engaged (#23559)
* clear no entry alerts if engaged

* fix test
2022-01-17 13:57:53 -08:00
Dean Lee
5cd103c3d4 controlsd: remove extra space (#23553) 2022-01-17 13:51:44 +01:00
Adeeb Shihadeh
c6b892fe58 shutdownd is non essential 2022-01-14 11:59:04 -08:00
Dean Lee
fd042a5924 controlsd: cleanup parsing android log (#23421)
* cleanup parse android log

* global CSID_MAP

* use generator express

* cleanup

* no walrus

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-01-13 19:43:22 -08:00
Dean Lee
48b6dfa15d controlsd: check self.enabled out of the any() (#23507) 2022-01-13 11:53:04 +01:00
Dean Lee
dbae5e7601 lateral_planner: use nympy.isnan().any() (#23500) 2022-01-12 15:56:41 +01:00
Dean Lee
a186bcc9f1 cleanup iterate keys in dictionaries (#23497) 2022-01-12 12:42:50 +01:00
Dean Lee
678732d0ce AlertManager: cleanup add_many (#23438) 2022-01-11 14:16:52 -08:00
Dean Lee
35ec6ac1cb use ndarray.tolist to convert numpy array to float (#23485) 2022-01-11 14:34:47 +01:00
Shane Smiskol
233a6e4a62 LanePlanner: offsets cleanup (#23459)
* update comments

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

* fix
2022-01-10 13:08:45 -08:00
Robbe Derks
1a54d7f6ae Ignore statsd for running process check (#23483) 2022-01-10 19:54:41 +01:00
Dean Lee
4208fe018e LongControl: remove redundant check on active (#23481) 2022-01-10 18:46:02 +01: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
Dean Lee
8eec818ae6 events: cleanup function any (#23479) 2022-01-10 14:32:07 +01:00
Dean Lee
67af095692 controlsd: check all_valid only if not initialized (#23437)
* check all valid in if statement

* apply review
2022-01-10 12:13:58 +01:00
Dean Lee
2d08f8b318 controlsd: save lat_plan.dPathPoints to local variable (#23462) 2022-01-10 11:27:31 +01:00
Dean Lee
b2beb5e6ba controls: check contents in tuple instead of list (#23463) 2022-01-10 11:26:58 +01:00
Dean Lee
09a835916b optimize alertmanager (#23433) 2022-01-06 22:15:32 -08:00
Dean Lee
e0338fd77b controlsd/state_transition: remove redundant check in elif (#23428) 2022-01-06 15:54:19 +01:00
Dean Lee
a2e762e0b9 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>
2022-01-05 14:23:08 +01:00
Shane Smiskol
cf9792dc53 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>
2022-01-04 15:40:39 -08:00
Dean Lee
0357cf2af0 controlsd: remove duplicate event relayMalfunction (#23392) 2022-01-04 14:07:36 -08:00
HaraldSchafer
d3f064f5ca Controlsd: fix bug in curv rate limit (#23250)
* Controlsd: fix bug in curv rate limit

* update ref
2022-01-04 13:21:56 -08:00
Shane Smiskol
9cb0ebe37d 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>
2022-01-04 16:00:29 +01:00
Shane Smiskol
9f88ba188a 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>
2022-01-04 12:17:33 +01:00
Dean Lee
960e0cf6a7 controlsd/publish_logs: follow capnp best practices (#23372)
* follow follow capnp best practices

* cleanup
2022-01-04 12:04:03 +01:00
Dean Lee
5dc631fa1b longcontrol/update: optimize capnp (#23382) 2022-01-04 11:32:54 +01:00
Dean Lee
7b612d47b6 radard/update: optimize capnp (#23380) 2022-01-03 17:26:32 -08:00
Dean Lee
f2520b6e80 lane_planner.py/parse_model: follow capnp best practices (#23368) 2022-01-03 15:08:24 -08:00
Adeeb Shihadeh
1e41f4723b CAN receive error is a comm issue (#23362) 2022-01-03 14:13:45 -08:00
Dean Lee
2ca0925da7 lateral_planner.py/publish: follow capnp best practices (#23359) 2022-01-02 11:55:24 -08:00
George Hotz
dc96d4bee7 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>
2021-12-28 18:07:00 +01:00
Shane Smiskol
5387806400 LongitudinalMpc: minor clean up (#23296)
* correct order

* formatting

* Revert "formatting"

This reverts commit 481c390f400179f5d0d8f9b5a3066cb68e484d0c.

* use np.zeros

* typos and formatting

* typo

* typo
2021-12-28 12:05:52 +01:00
Ewout ter Hoeven
332f568a82 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>
2021-12-24 11:18:39 -08:00
Adeeb Shihadeh
256c51e16a bump cereal 2021-12-20 23:04:27 -08:00
Adeeb Shihadeh
c92199ab1a Revert "Mazda: alert when LKAS is disabled (#23273)"
This reverts commit f25121b736.
2021-12-20 23:02:02 -08:00
Jafar Al-Gharaibeh
f25121b736 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>
2021-12-20 14:58:46 -08:00
George Hotz
16dd7ce1fe build for mac (#23048) 2021-12-18 22:00:09 -08:00
HaraldSchafer
cf466222f6 Road Roll Compensation Rebased (#23251)
* first commit

* update refs
2021-12-16 17:34:12 -08:00
Ewout ter Hoeven
55390d273f Convert format strings strings to f-strings (#23241)
* Convert all text strings to f-strings

Reformats all the text from the old "%-formatted" and .format(...) format to the newer f-string format, as defined in PEP 498. This requires Python 3.6+.

Flynt 0.69 was used to reformat the strings. 120 f-strings were created in 51 files.

F-strings are in general more readable, concise and performant. See also: https://www.python.org/dev/peps/pep-0498/#rationale

* revert pyextra changes

* revert ublox.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-12-16 14:58:17 +01:00