Commit Graph

24 Commits (dc96d4bee7b898172a6a15de4799af0e2d35605e)

Author SHA1 Message Date
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
Willem Melching f4e2537b12
Split pandaState into peripheralState and pandaState (#22385)
* publish peripheralState from boardd

* refactor consumers

* rename thread

* peripheralState has panda type too

* add to process replay

* fix device build

* properly remove hardware unsupported alert

* latest peripheralState

* remove pandaState from thermal_monitor

* put that back

* add back harness check

* fix cloudlog

* needs pandaState

* Update selfdrive/thermald/tests/test_power_monitoring.py

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

* dont conflate

* Update selfdrive/thermald/tests/test_power_monitoring.py

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

* pigeon is peripheral

* cleanup

* less global

* comment

* move rtc to peripheral_control_thread

* better diff?

* whitespace

* get msg

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-10-04 11:30:11 +02:00
robbederks 4a24d389c4
Add harness connection as requirement for powerdown (#21087)
* add harness connection as requirement for powerdown

* fix unittests
2021-05-31 13:32:26 +02:00
Willem Melching 147ffb1441
Also shutdown after one hour after not going onroad (#20949) 2021-05-18 15:35:02 +02:00
robbederks 13a6e3c68f
add lower limit to prevent triggering on power loss (#20720)
Co-authored-by: Comma Device <device@comma.ai>
2021-04-21 13:15:44 +02:00
Willem Melching ae094042ad
add putBool/getBool wrappers to cython params class (#20611)
* add putBool/getBool wrappers to cython class

* use new API

* some more puts

* fix mockparams arguments

* add get_bool to MockParams

* typo
2021-04-07 15:36:37 +02:00
Willem Melching 2a5d8b6f74
Remove oneplus fan support (#20520) 2021-03-29 14:37:52 -07:00
Greg Hogan 7cc0999aeb fix pylint errors 2021-02-23 13:58:58 -08:00
robbederks 8ad1c793d1
Fix tici powerdown and add support for forcing (#20132)
* also shutdown on tici

* force powerdown

* bump panda

* abstract out shutdown and thermal config

* add comment on tici shutdown

Co-authored-by: Comma Device <device@comma.ai>
2021-02-23 17:04:10 +01:00
Adeeb Shihadeh 312b681a46
cereal cleanup part 2 (#20092)
* car stuff

* thermal

* Revert "car stuff"

This reverts commit 77fd1c65eb.

* panda state

* camera stuff

* start deg

* most is building

* builds

* planner + controls run

* fix up paramsd

* cleanup

* process replay passes

* fix webcam build

* camerad

* no more frame

* thermald

* ui

* paramsd

* camera replay

* fix long tests

* fix camerad tests

* maxSteeringAngle

* bump cereal

* more frame

* cereal master
2021-02-16 21:39:32 -08:00
Adeeb Shihadeh 000bd226aa
Cereal cleanup (#20003)
* start cleanup

* fan speed

* cleanup dm

* fix cereal

* hwType -> pandaType

* update refs

* update refs

* bump cereal

* freeSpacePercent

* cereal master
2021-02-03 19:57:30 -08:00
Adeeb Shihadeh 8674b023ba
HW abstraction layer (#19530)
* start hw refactor

* move that

* pins

* put that back
2020-12-16 21:30:23 -08:00
robbederks e64484aecd
Move thermald hardware calls into HW abstraction layer (#2630)
* abstracted away hardware calls

* oopsie

* remove bugs

* remove bugs #2

* fix unit test

* removed print

Co-authored-by: Comma Device <device@comma.ai>
2020-12-02 15:20:57 +01:00
Adeeb Shihadeh 47c21f10f5
grey panda is unsupported (#2458) 2020-11-03 19:56:25 -08:00
Willem Melching 73a2067be3
Get power usage from current sensor (#2192) 2020-09-18 12:25:55 +02:00
robbederks 7555379b2b
Car power integrator + power management refactor (#1994)
* wip, ready to test

* tweaks

* fix

* fix

* fix power monitoring

* fix param writing

* no forced charging on high voltage

* reset capacity on reboot

* don't shutdown unless started seen

* fix unused var warning

* fix linting errors

* time is always valid

* QCOM gate

* Local params

* decimate saving

* fix linting

* rename param

* Log car battery capacity

* fix put_nonblocking

* Added some unit tests

* Add test to docker test list

* fix precommit

* cleanup

* run tests in CI

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-08-17 11:56:27 +02:00
Adeeb Shihadeh 897ee6bd2b
Use a monotonic clock source for power monitoring (#1861) 2020-07-12 01:46:02 -07:00
Willem Melching 843a64c72f
Make pylint more strict (#1626)
* make pylint more strict

* cleanup in progress

* done cleaning up

* no opendbc
2020-06-02 16:29:32 -07:00
robbederks 15f57c4c22
Added value-error for negative integration (#1390) 2020-04-17 14:05:43 -07:00
Willem Melching 017b1f6770
Don't use battery temperature to determine fan type (#1331)
* Don't use battery temperature to determine fan type

* Add cloudlog

* Init is_uno
2020-04-07 19:18:14 -07:00
Willem Melching b16e11cde5
Boardd should always send health, even with no panda (#1322)
* dont go offroad when health times out

* always send health packet

* Handle disconnect in thermal

* Handle unplug in power monitoring

* Small cleanup

* Remove copied code

* Add mutex

* Can just use infinite timeout. It will still return if not connected
2020-04-06 16:01:42 -07:00
robbederks 905f6b1b77
Power monitoring fix (#1269)
* Release lock after exceptions

* No pulsed measurement on uno

* Fix last_measurement_time=None while integrating when going offroad

* Also clear next pulsed measurement time

* Move around locks

* Locks are good now?
2020-03-23 18:02:53 -07:00
Willem Melching 65ad31a7e4 Small thermald cleanup 2020-03-12 11:55:33 -07:00
robbederks 992be20d63
Offroad power monitoring (#1067)
* Untested implementation of offroad power monitoring

* Fixed some syntax errors

* Cast to int

* Fixed pylint

* Wrapped in class

* Put pulsed calc in own thread

* Longer timeout before starting pulse measurement

* Fudge factor + flake8

* Made integration thread-safe and catch charge disable exceptions

* Catch all calculation errors

* Fixed networkstrength removal
2020-03-10 22:18:48 -07:00