Commit Graph

215 Commits

Author SHA1 Message Date
cl0cks4fe dd9d5d4528 Unittest to pytest (#32366)
* add pytest-asyncio

* switch common

* switch selfdrive

* switch system

* switch tools

* small fixes

* fix setUp and valgrind pytest

* switch to setup

* fix random

* switch mock

* switch test_lateral_limits

* revert test_ui

* fix poetry.lock

* add unittest to banned-api

* add inline ignores to remaining unittest imports

* revert test_models

* revert check_can_parser_performance

* one more skip

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2024-05-17 11:01:44 -07:00
Adeeb Shihadeh c0a96d2747 thermald: publish immediately after ignition (#31981)
* thermald: publish immediately after ignition

* fix
2024-03-22 15:57:36 -07:00
Adeeb Shihadeh f6665f8488 thermald: add deviceType to logs (#31819)
* thermald: add deviceType to logs

* fix
2024-03-10 14:29:50 -07:00
Cameron Clough 995250ae49 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
2024-02-24 16:41:23 -08:00
Adeeb Shihadeh 0b4d08fab8 remove deviceState.ambientTempC (#31533) 2024-02-21 13:57:49 -08:00
Shane Smiskol 4abda1b6bc thermald: remove instant low voltage check (#31522)
remove instant lv check for old bug
2024-02-20 21:02:38 -08:00
Adeeb Shihadeh 3e6ac26569 thermald: make CPU usage list a constant size (#31526) 2024-02-20 20:15:46 -08:00
Adeeb Shihadeh 279d2c3b23 SubMaster: improve service aliveness checks (#31391)
* bump cereal

* fix

* fixes

* single poll

* bump

* bump

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-02-12 10:11:37 -08:00
Adeeb Shihadeh daceb171bd bump cereal (#31392)
* bump cereal

* update those

* update refs

* bump cereal

* bump

* bump cereal

* bump

* fix

* bump

* typo:
2024-02-09 21:44:23 -08:00
Adeeb Shihadeh 7cd9568423 remove dashcam branch (#31081)
* remove dashcam branch

* fix

* more cleanup

* remove param

* one more
2024-01-19 14:05:03 -08:00
Adeeb Shihadeh 16cd20f4eb don't block startup on time (#31074)
* don't block startup on time

* cleanup

* unused
2024-01-19 11:51:58 -08:00
Adeeb Shihadeh 005a6e4f17 thermald: match metered param to packet 2024-01-17 17:45:22 -08:00
Adeeb Shihadeh 4c2bb9f380 updated: only fetch on metered connection when necessary (#31041)
* updated: only fetch on metered connection when necessary

* button always fetches
2024-01-17 16:30:08 -08:00
Adeeb Shihadeh 5f191321fd tici: check that peripherals are fully booted (#30942)
* tici: check that peripherals are fully booted

* default

* typo

* fix

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-01-08 15:09:38 -08:00
Dean Lee 3c4c4d1f7f common/params: support nonblocking write (#29808)
* Safe and efficient asynchronous writing parameters

* call putNonBlocking in locationd

* remove space

* ->AsyncWriter

* remove semicolon

* use member function

* asyc write multiple times

* add test case for AsyncWriter

* merge master

* add missing include

* public

* cleanup

* create once

* cleanup

* update that

* explicit waiting

* improve test case

* pass prefix to asywriter

* move to params

* assert(queue.empty())

* add comment

* add todo

* test_power_monitoring: remove patch

* rm laikad.py

* fix import

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-12-13 20:36:01 -08:00
Adeeb Shihadeh 35f819c823 swaglog.py goes in common/ (#30631)
* swaglog.py goes in common/

* all of these go in release

* we'll even include the pyx
2023-12-06 17:27:51 -08:00
Adeeb Shihadeh a1d36961cf new msgs default to invalid (#30587)
* new msgs default to invalid

* fix lm

* set more valid

* update rest

* update refs

* fix logMessage

* more valids

* cleanup

* fix llk test

* pigeond is also valid

* more valids
2023-12-03 10:50:17 -08:00
Shane Smiskol d47e8f53a5 bump pandaStates to 10Hz (#29889)
* bump pandaStates to 10Hz

* run thermald at 2 Hz

* use service list for freq

* even better

* fix import

* use DT_TRML

* revert service list

* bump cereal

* no inter

* not sure why 5hz before

* revert

* revert peripheral

* poll on peripheralState

after pandaStates

* Revert "poll on peripheralState"

This reverts commit 5eecb83e070dd51b550a47f3e0e7a1600b8da4e4.

* revert this

* bump

* cmt

* fix

* bump to master
2023-09-21 18:35:14 -07:00
Justin Newberry f69a45faba Tests: power_monitoring disable nonblocking writes (#29994)
* better error logging

* fix power monitoring test

* revert that

* properly patch it
2023-09-20 16:51:46 -07:00
Adeeb Shihadeh ec479322d3 Revert "params: safe and efficient async writing parameters (#25912)"
This reverts commit 0d797f4e8b.
2023-09-06 13:44:20 -07:00
Dean Lee 0d797f4e8b params: safe and efficient async writing parameters (#25912)
* Safe and efficient asynchronous writing parameters

* call putNonBlocking in locationd

* remove space

* ->AsyncWriter

* remove semicolon

* use member function

* asyc write multiple times

* add test case for AsyncWriter

* merge master

* add missing include

* public

* cleanup

* create once

* cleanup

* update that

* explicit waiting

* improve test case

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-09-06 08:50:28 -07:00
Adeeb Shihadeh 7b6afbc162 pytest: use a clean environment for all tests (#29788)
* pytest: use a clean environment for all tests

* rm that

* fix pj

* put build back

* fix params

* fix that

* handle no key

* that was removed

---------

Co-authored-by: Justin Newberry <justin@comma.ai>
2023-09-05 18:52:40 -07:00
Justin Newberry 4e69937d0d Precommit: ensure executable bit is set (#29784)
* precommit ensure executable

* exclude tinygrad

* bump submodules

* exclude tinygrad globally
2023-09-05 16:33:26 -07:00
Justin Newberry 1ee6ed4b16 Linter: remove pylint (#29611)
remove pylint
2023-08-24 16:30:54 -07:00
Shane Smiskol af8af3209d thermald: type annotate main thread (#29414)
* type

* stash

* Revert "stash"

This reverts commit f5e5e0d08c967d1a5d9c239e6335f8a47890b1a1.

* bug in mypy
2023-08-23 14:42:27 -07:00
Adeeb Shihadeh a9626f95b6 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
2023-08-20 20:49:55 -07:00
Adeeb Shihadeh d61f86d339 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
2023-08-20 18:50:58 -07:00
Justin Newberry 62c1e65924 Ruff: enable most of bugbear (#29320)
* added mutable default args

* most of the Bs

* add comment about lrucache
2023-08-11 15:33:49 -07:00
Justin Newberry 7fdd9fc37c CI: Pylint to ruff (#29294)
* pylint to riff

* pylint to riff

* pylint to riff

* revert more

* undo exclude removal

* exclude tinygrad

* set line length

* pylint exclusions to ruff

* same excludes as old linter

* fix tools QA

* remove unrequired check

* revert linting third_party

* ignore e402
2023-08-09 13:26:54 -07:00
Justin Newberry cf64b27168 Linter: Fix >160 line length test (#29287)
* test

* fix line length

* fix line length

* fix file size

* revert poetry

* cleanup for PR
2023-08-08 17:13:35 -07:00
Justin Newberry a91764954b Revert "CI: pylint to ruff (#29276)" (#29284)
This reverts commit cb31a53d8a.
2023-08-08 14:24:04 -07:00
Justin Newberry cb31a53d8a CI: pylint to ruff (#29276)
* pylint to riff

* pylint to riff

* pylint to riff

* revert more

* undo exclude removal

* exclude tinygrad
2023-08-08 13:41:30 -07:00
Adeeb Shihadeh 77babcc60f thermald: don't show inavlid time alert until panda is up (#29153) 2023-07-26 14:31:53 -07:00
Adeeb Shihadeh 787d3b1714 tici: restart ModemManager if probing fails (#29114)
* tici: restart ModemManager if probing fails

* add comment

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-07-23 20:36:13 -07:00
Adeeb Shihadeh 23db0aa757 update offroad danger temperature (#28662) 2023-06-23 17:23:48 -07:00
Adeeb Shihadeh 4464383833 thermald: show temp value in offroad alert (#28664)
* thermald: show temp value in offroad alert

* update

* better for multilang

* update translations

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-06-23 17:12:01 -07:00
Adeeb Shihadeh 692bfa55c9 thermald: adjust offroad danger temp (#28524) 2023-06-15 20:12:24 -07:00
Adeeb Shihadeh 77c9d65a71 thermald: remove offroad min time condition (#28567)
Co-authored-by: Comma Device <device@comma.ai>
2023-06-15 18:50:59 -07:00
Adeeb Shihadeh 411cf094f3 thermald: log duration of startup block (#28566) 2023-06-15 18:16:59 -07:00
Adeeb Shihadeh 3072643363 thermald: fix temperature filter init (#28565) 2023-06-15 17:34:01 -07:00
Adeeb Shihadeh cb4c7118a5 thermald: log filtered max temp (#28564) 2023-06-15 17:08:47 -07:00
Adeeb Shihadeh 7d6897fa38 thermald: save last offroad status packet on onroad transition (#28563)
* thermald: save last offroad status packet on onroad transition

* update param

* write every time

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-06-15 15:04:22 -07:00
Adeeb Shihadeh 9bb9657c9c thermald: must be in yellow band to go onroad (#28517) 2023-06-12 16:33:33 -07:00
Adeeb Shihadeh d96361970b thermald: common min date (#28457)
* thermald: common min date

* add to release files
2023-06-12 13:50:38 -07:00
Adeeb Shihadeh a77d226f33 thermald: lower threshold to exit red band 2023-06-09 20:15:13 -07:00
Adeeb Shihadeh 7e9acfd139 tici: allow fan to run to 100% (#28203) 2023-05-16 07:23:22 -07:00
Shane Smiskol b8fa7f58ea onroad transition: clear params and start safety setter thread (#28151)
* rename from ignition to onroad/offroad

* forgot one

* clear in manager

* don't clear in boardd anymore

fix

* params isn't used here

* add comment

* Revert "add comment"

This reverts commit 54fb6660501679e5a989c3f06c0a438bdb04dc7e.

* write params in manager

* first part is self explanatory

* remove these from thermald now

* start safety setter thread with IsOnroad

* drivesss

* more

* less

* come back

* makes sense here
2023-05-09 21:25:23 -07:00
MoreTorque 150a7d52da Delay Shutdown: delay shutdown for 5 minutes after ignition turned off. (#27860)
Added delay shutdown. Tests updated

Co-authored-by: moretore <wrha@CH-ADS.localdomain>
2023-04-20 14:57:09 -07:00
Adeeb Shihadeh 94eb215980 loggerd: move to system/ (#27534) 2023-03-08 11:20:49 -08:00
EdwardApollo 30165134e8 Increase Minimum Offroad Battery Voltage (#26661)
* Reduce Min Idle Battery Voltage and Idle Time

Updated minimum offroad battery voltage to reduce wear on car batteries and updated max offroad time to reflect the increased power consumption at idle based on EPHOT hardware power draw (this may have changed).

Most vehicles make use of lead acid batteries which during normal use shouldn't ever decrease below ~12V (sources give a range of 11.8-12V). Increasing this limit will prevent premature battery failure by preventing sulfation of the cells.

* Voltage cutoff to 11.8V, max offroad to 30h

Changed lower voltage limit to 11.8V, removed power usage comment entirely, reverted change to max offroad time to 30 hours

* Added Offroad Shutdown conditional

Added IsOffroad Shutdown conditional statement to prevent shutting down due to voltage floor.

* LPF Gain: Tau = 45s

Tau modified to 45s to result in a LPF gain of ~0.011. 

Assuming a dT of 0.5s: (0.5/45)/((0.5/45)+1)

* Revert IsOffroad check

Removed due to unnecessary redundancy.
2022-12-01 14:18:32 -08:00