Commit Graph

58 Commits

Author SHA1 Message Date
Adeeb Shihadeh
10db1edc7f merge common.util and common.utils (#36951)
* common: merge common.util and common.utils

* cleanup

* cleanup
2026-01-19 15:50:00 -08:00
Maxime Desroches
47ed90c6cf Reapply "Mypy: Got passing on macos (#34591)" (#35126) (#35153)
* Mypy: Got passing on macos (#34591)

* Mypy: Got mypy passing on macos

* common/realtime.py refactor

* Mypy: mypy passing on darwin

* Refactor: Removed else: pass statement

* Refactor: Removed unnecessary check

* added xattr to pyproject

* loggerd: switched to xatter module

* loggerd: removed unused module in xattr_cache.py

* UV: update uv.lock

* Update system/athena/athenad.py



* athenad: fixed blank lines

* loggerd: refactor of xattr_cache

* cleanup

---------



* fix getxattr no attribute on macOS

* try fixing missing ENOATTR on Linux

---------

Co-authored-by: Andrei Radulescu <andi.radulescu@gmail.com>
Co-authored-by: BrainLess <116778989+BrainLessPea@users.noreply.github.com>
2025-05-07 19:11:37 -07:00
Maxime Desroches
aa1b790708 revert agnos 12 2025-05-06 21:38:50 -07:00
Andrei Radulescu
bbf37ae5c7 Reapply "Mypy: Got passing on macos (#34591)" (#35126)
* Mypy: Got passing on macos (#34591)

* Mypy: Got mypy passing on macos

* common/realtime.py refactor

* Mypy: mypy passing on darwin

* Refactor: Removed else: pass statement

* Refactor: Removed unnecessary check

* added xattr to pyproject

* loggerd: switched to xatter module

* loggerd: removed unused module in xattr_cache.py

* UV: update uv.lock

* Update system/athena/athenad.py

Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>

* athenad: fixed blank lines

* loggerd: refactor of xattr_cache

* cleanup

---------

Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>

* fix getxattr no attribute on macOS

* try fixing missing ENOATTR on Linux

---------

Co-authored-by: BrainLess <116778989+BrainLessPea@users.noreply.github.com>
Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
2025-05-06 21:09:59 -07:00
Dean Lee
61bec65f32 common: add MovingAverage class for real-time windowed average calculation (#34569)
* add MovingAverage class for real-time windowed average calculation

* move to util.py
2025-02-21 14:47:21 -08:00
Adeeb Shihadeh
27b5a727e3 Revert "Mypy: Got passing on macos (#34591)"
This reverts commit b09b48130e.
2025-02-16 08:50:46 -08:00
BrainLess
b09b48130e Mypy: Got passing on macos (#34591)
* Mypy: Got mypy passing on macos

* common/realtime.py refactor

* Mypy: mypy passing on darwin

* Refactor: Removed else: pass statement

* Refactor: Removed unnecessary check

* added xattr to pyproject

* loggerd: switched to xatter module

* loggerd: removed unused module in xattr_cache.py

* UV: update uv.lock

* Update system/athena/athenad.py

Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>

* athenad: fixed blank lines

* loggerd: refactor of xattr_cache

* cleanup

---------

Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
2025-02-16 00:05:52 -08:00
Adeeb Shihadeh
d98a554b17 tici: set core affinity for all realtime processes (#34574) 2025-02-11 21:20:31 -08:00
Adeeb Shihadeh
8f73bcffe4 micd: fix fake lagging warnings (#34158)
* micd: fix fake lagging warnings

* fix it properly

* simple
2024-12-05 13:35:44 -08:00
Adeeb Shihadeh
fc469e5f80 Revert "Remove setproctitle (#32716)" (#33195)
* Revert "Remove `setproctitle` (#32716)"

This reverts commit 9020d1931f4cd72f8162e4402278bdf76e3746f2.

* uv lock

* old name
old-commit-hash: 29b58d4f2f
2024-08-05 16:42:22 -07:00
Adeeb Shihadeh
9cfdd6200d Remove setproctitle (#32716)
* Custom setproctitle (#32667)

* add custom setproctitle

* add test

* Update poetry.lock

* fix lint

* support only Linux

* test only Linux

* final lint

* Update test_setproctitle.py

* Update setproctitle.py

* convert to threadnames

* delete proctitles

* Check str len and use PR_GET_NAME

* fix poetry.lock

* lint fix

* Update common/threadname.py

---------

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

* revert that for now

* use last 15

* fix

* use name

* update those

* and modeld

* rm

---------

Co-authored-by: schlimeszn <138847413+schlimeszn@users.noreply.github.com>
Co-authored-by: reddyn12 <nikhilr.ssm@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 83ac80c6c8
2024-06-11 21:57:32 -07:00
Adeeb Shihadeh
e920e57530 Revert "Custom setproctitle (#32667)"
This reverts commit 1f45e163559baa2a6127d5a5e8deb7067e32f813.

old-commit-hash: 5b51f03967
2024-06-10 19:55:41 -07:00
schlimeszn
afea57ae2a Custom setproctitle (#32667)
* add custom setproctitle

* add test

* Update poetry.lock

* fix lint

* support only Linux

* test only Linux

* final lint

* Update test_setproctitle.py

* Update setproctitle.py

* convert to threadnames

* delete proctitles

* Check str len and use PR_GET_NAME

* fix poetry.lock

* lint fix

* Update common/threadname.py

---------

Co-authored-by: reddyn12 <nikhilr.ssm@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 3365ed5eff
2024-06-10 18:59:01 -07:00
Adeeb Shihadeh
30c41788dc thermald is hardwared (#32637)
* thermald is deviced

* hardwared

* rename
old-commit-hash: 51fdf23304
2024-06-05 15:58:00 -07:00
Adeeb Shihadeh
2c6829ed67 boardd is pandad (#32628)
* boardd is pandad

* rename tests
old-commit-hash: 34e329649d
2024-06-04 19:16:55 -07:00
Cameron Clough
9bd90112d0 use pyupgrade to update to new typing syntax (#31580)
* add pyupgrade hook

* run pyupgrade (pre-commit run -a)

* ruff --fix

* Revert "add pyupgrade hook"

This reverts commit 56ec18bb6b8602a0b612f3803d96cdad14b52066.

* revert changes to third_party/

* manual type fixes

* explicit Optional wrapping capnp objects
old-commit-hash: 995250ae49
2024-02-24 16:41:23 -08:00
stevenworks
4ca48060bc Typo fixes / Grammar corrections (#30860)
* CONTRIBUTING.md: Misspelling

* BOUNTIES.md: Misspelling

* SAFETY.md: Grammar

* realtime.py: Comment consistency

* revert for now

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 0f72467558
2024-01-01 14:39:01 -08:00
Justin Newberry
c4f322ce2d Linter: remove pylint (#29611)
remove pylint
old-commit-hash: 1ee6ed4b16
2023-08-24 16:30:54 -07: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
Adeeb Shihadeh
51634f52dc replace custom clock helpers with time module (#29499)
* replace custom clock stuff wtih time module

* fix double

* fix release

* bump cereal

* update type

* fix one more
old-commit-hash: d61f86d339
2023-08-20 18:50:58 -07:00
Cameron Clough
23a4e66b17 configure mypy outside of pre-commit environment (#25892)
* add mypy config matching precommit

* use local mypy, add files to config

* excludes too

* fix config

* pylint is sad now... did it get updated?

* fix typing hints

* ignore

* this should be a regexp

* mypy doesn't like Deque despite inheriting MutableSequence

* more excludes

* Revert "pylint is sad now... did it get updated?"

This reverts commit 250c632f18ecb3d33ffb931e15425f9314a0964b.
old-commit-hash: 4e310b807f
2022-09-27 20:43:05 -07:00
Adeeb Shihadeh
9a45a3b99b Move selfdrive/hardware/ to system/ (#24725)
* move hardware to system/

* fix mypy
old-commit-hash: 1139fe507b
2022-06-11 16:38:24 -07:00
Willem Melching
753045c73d less TICI when not needed (#24698)
* less TICI when not needed

* fix process replay

* move reading voltages into hw abstraction layer

* Update selfdrive/hardware/tici/hardware.h

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

* Update selfdrive/hardware/hw.h

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

* Update selfdrive/hardware/base.h

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

* rename init function

* Update selfdrive/athena/athenad.py

Co-authored-by: Robbe Derks <robbe.derks@gmail.com>

* Update selfdrive/boardd/boardd.cc

* Apply suggestions from code review

* Update selfdrive/thermald/thermald.py

* update ref

* fix alert width if all cameras are bad

* add ecam to test_loggerd

* bump cereal

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Robbe Derks <robbe.derks@gmail.com>
old-commit-hash: f49a9c9fd2
2022-06-02 15:20:51 +02:00
Dylan Herman
2dfba97175 add mypy check for return-any (#24379)
* add mypy check for return-any

* remove unused import

* typing

* remove unnecessary variable typing

* cleanup

* cleanup

* bump submodules

* small fixes

* only a problem on mac

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: d2eef1955c
2022-05-12 14:59:00 +02:00
grekiki
7cd23af9b1 Mypy fixes for --check-untyped-defs (#24372)
more type fixes
old-commit-hash: 17e33978cd
2022-05-12 14:08:11 +02:00
Adeeb Shihadeh
fdf13d565b controlsd: add lagging alert (#24360)
* controlsd: add lagging alert

* move those

* just this for now

* no camera malfunction
old-commit-hash: 3abbe827de
2022-04-28 19:51:42 -07:00
Adeeb Shihadeh
9b9d332a54 paramsd: fix variable cpu usage (#24281)
* paramsd: fix variable cpu usage

* fix that

* increase that a bit
old-commit-hash: f7c2b8b46e
2022-04-20 14:08:52 -07:00
Gijs Koning
de6904efc7 Improve lagging message description (#24208)
* Improve lag prints process name

* Cleanup

* small change

* Add bridge process name

* Use getproctitle

* Remaining
old-commit-hash: 0254a3fe11
2022-04-15 08:11:53 -07: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
Ewout ter Hoeven
a962365292 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>
old-commit-hash: 55390d273f
2021-12-16 14:58:17 +01:00
Josh Smith
2cae3a3799 Add type hints, small cleanups (#21080)
* improve tools.lib.kbhit and tools.sim.lib.keyboard_ctrl

* unpack more efficiently

* minor improvements

* agnos.py match spec better

* manual_ctrl test missing queue arg

* fix incorrect type annotation

* queues are generic

* varname reuse resulting in incorrect type inference

* bytes().hex() rather than bytes.hex(bytes())

* a bit of type hinting stuff
old-commit-hash: 77321dbac4
2021-06-03 12:21:04 +02:00
Adeeb Shihadeh
b950cab874 HW abstraction layer (#19530)
* start hw refactor

* move that

* pins

* put that back
old-commit-hash: 8674b023ba
2020-12-16 21:30:23 -08:00
Adeeb Shihadeh
762eda95cd Set GPU priorities + improved modeld priorities (#2691)
* give gpu threads rt priority

* modeld gets highest prio on core 2

* fix frame stream

* lower prio of cal thread

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: c57ee16e86
2020-12-15 19:22:03 -08:00
George Hotz
c22f0fc034 Make the DSP work everywhere (#2621)
* Use DSP again

* 20 Hz

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: bdb1b766d0
2020-11-30 11:21:06 +01:00
grekiki
0b902a02c1 Scons builder for cython extensions (#2485)
* complie boardd without python

* not good, but don't want to lose the file, because it works

* clean a bit

* update dbc

* should build on CI

* not good, but don't want to lose the file, because it works

* clean a bit

* should build on CI

* remove unneeded path

* reorder paths

* reduce diff

* and now it works?!

* ... should work in CI

* add kj, 30% chance to fix macos

* pydebug

* new way to find path

* fix :)

* tested

* sanity check

* repl. MacOS flags

* hope it works

* need more logs

* need more logs2

* test if it works

* should work on CI

* correct python file

* should not work

* cleanup

* real cleanup

* more removals

* 50% of file

* transformations

* fixed a hardcoded variable

* more logs

* simpl.

* kalman

* all donw if it passes tests

* cleanup

* reduce code by 20 lines if this works

* fix bugs

* cleanup

* SharedLibrary

* cleanup

* ...

* remove unused

* CI fix maybe?

* add more valid path

* more logs

* ...:

* fix webcam CI

* remove WError flag

* deprecated is not an error

* more Wno things

* reduce diff, add Wno to env

* don't import nonexistent stuff

* SharedLibrary v2

* less custom env

* renaming, remove SharedLibs

* pack libs in envCython

* experiment

* better docker caching

* whitespace

* more docker caching

* improvement

* improvements

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 9529764549
2020-11-11 21:14:51 +01:00
Adeeb Shihadeh
ff14d71845 Run all driving processes on cores 2-3 (#2257)
old-commit-hash: 059cf6b43e
2020-10-02 17:18:18 -07:00
Adeeb Shihadeh
86bb0caf66 Realtime shield (#2194)
* cpu 3 shield

* set priority before affinity

* add to release files

* only run on android
old-commit-hash: b341fdc644
2020-09-17 15:49:14 -07:00
Adeeb Shihadeh
bdf52941c8 Improve realtime performance on NEOS (#2166)
* fix setting core affinity

* dmonitoringd doesn't need rt priority

* android only gets two cores

* model and planner get core 2

* log missed cycle count

* neos update

* prod image

* revert NEOS changes

* still need this
old-commit-hash: ef21b83937
2020-09-16 15:33:12 -07:00
Willem Melching
e5f5cdaccf tici: fix set_realtime_priority (#2124)
* cleanup and pin modeld to core 5

* Unused import
old-commit-hash: 5c058140ed
2020-09-02 17:52:41 +02:00
Willem Melching
16fe1bb2ad Hardware abstraction class (#2080)
* hardware abstraction class

* De Morgan

* Rename pc hardware class

* Fix sound card in controlsd

* Pc get sim info

* fix hardware in test

* two more

* No more random imei on android

* no randomness on android

* Need to return something that looks like imei for registration to work

* Return proper network strength

* Unused import

* Bug fixes + gpsd is only android
old-commit-hash: c7152d5419
2020-08-26 14:57:17 +02:00
Jason Young
ebed52527b Reduce scheduler latency for realtime processes (#1638)
* WIP: reduce boardd and other lags

* Copypasta fault

* Silence spurious startup warning

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 68531b071c
2020-06-05 17:09:41 -04:00
George Hotz
b1f13418e1 common folder
old-commit-hash: e8d888c45b
2020-01-17 10:28:44 -08:00
George Hotz
81dd5a50cf root commit
old-commit-hash: 6c33a5c1f3
2020-01-17 10:02:52 -08:00
Vehicle Researcher
99b637c7ce openpilot v0.7 release
old-commit-hash: c025b96e8a
2019-12-13 13:03:08 -08:00
Vehicle Researcher
89d1d84c70 openpilot v0.6.5 release
old-commit-hash: cf80f7a28b
2019-10-09 18:43:53 +00:00
Vehicle Researcher
3835061760 openpilot v0.6.2 release
old-commit-hash: e90c41c576
2019-07-30 02:27:48 +00:00
Vehicle Researcher
9abcfabc5f openpilot v0.6 release
old-commit-hash: 8a9ed94f5f
2019-06-28 21:11:30 +00:00
Vehicle Researcher
e47a2e6e30 openpilot v0.5.13 release
old-commit-hash: dd34ccfe28
2019-06-06 04:38:45 +00:00
Vehicle Researcher
e41a943dd0 openpilot v0.5 release
old-commit-hash: de33bc4645
2018-07-12 18:52:06 -07:00
Vehicle Researcher
4e867831f7 openpilot v0.4.2 release
old-commit-hash: 28c0797d30
2018-02-06 12:43:45 -08:00