Commit Graph

186 Commits (spacecruft)

Author SHA1 Message Date
Willem Melching c0d92516cc
store params in ~/.comma on PC (#2369) 2020-10-20 13:18:21 +02:00
Willem Melching 339d1967cb
--std=c++17 (#2330)
* switch to c++17

* more 17

* 1z

* use std::clamp

* Fix types in clamp

* bump submodules

* bump laika

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-10-17 13:33:12 -07:00
Adeeb Shihadeh 96b637737b
fix build warnings (#2355)
* fix build warnings

* cython fixes

* cleanup transformations build

* little more
2020-10-17 12:40:01 -07:00
Adeeb Shihadeh 0fe70c6ef4 revert apk launch thread 2020-10-15 16:40:56 -07:00
Willem Melching 3fe3ec7949 tici: reboot 2020-10-15 20:52:27 +02:00
Willem Melching 3dd9448981
Params path only in one place (#2344)
* fix params paths

* Qcom & qcom2

* This env variable is not used anywhere

* params path in only one place

* fix other PARAMS_PATH references

* absolute path is probably better
2020-10-15 13:15:22 +02:00
Adeeb Shihadeh de833ecb06 set default path for put_nonblocking helper 2020-10-14 13:57:10 -07:00
Adeeb Shihadeh 707a670f42
fix params on PC and when reading path from env (#2340)
* fix params when reading path from env

* fix pc
2020-10-14 13:45:24 -07:00
Willem Melching 2e182e5c57
Params refactor, simplified (#2300)
* always c++

* Create C++ params class

* get works

* tests hang now

* passes tests

* cleanup string formatting

* handle interrupt in blocking read

* fix memory leak

* remove unused constructor

* Use delete_db_value directly

* Rename put -> write_db_value

* filename cleanup

* no semicolons in cython

* Update common/SConscript

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

* add std::string version of delete_db_value

* This is handled

* cleanup encoding

* Add clear method to clear all

* add persistent params

* fix android build

* Should be called clear_all

* only import params when needed

* set params path on manager import

* recusrively create directories

* Fix function order

* cleanup mkdirp

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
2020-10-13 16:23:23 +02:00
grekiki 8a952cec33
Speedup android permissions (#2331)
* get android permissions before setiing them

* cleanup

* add newline

* make code nicer

* simplify code

* str()

* utf-8 and nicer exception handling
2020-10-13 15:35:18 +02:00
George Hotz f65f7051c4 improve profiler 2020-10-09 18:39:54 -07:00
Adeeb Shihadeh 671183184b
UI cleanup + startup time improvement (#2295) 2020-10-08 19:29:56 -07:00
Willem Melching 8e0bb6a7ce
Fix MacOS CI (#2145)
* compile flag for cython

* fix more setups

* bump cereal

* reenable mac build

* don't let that fail the build

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-10-04 15:03:20 -07:00
Adeeb Shihadeh 059cf6b43e
Run all driving processes on cores 2-3 (#2257) 2020-10-02 17:18:18 -07:00
HaraldSchafer d2539e01d3
Update README.md 2020-09-25 06:33:36 -07:00
Dean Lee 4fba3408c4
Params: use a multiple-reader / single-writer flock to improve concurrency (#2207)
* improve concurrency: multiple readers, single writer locks

* remove lock in read_db_value
2020-09-24 11:51:36 +02:00
Adeeb Shihadeh b341fdc644
Realtime shield (#2194)
* cpu 3 shield

* set priority before affinity

* add to release files

* only run on android
2020-09-17 15:49:14 -07:00
Willem Melching c90cb1b529
Tici hardware abstraction layer (#2183)
* rename android hardware

* add tici class

* elif

* read correct serial number

* Update release files

* Get IMEI

* Refactor AT command

* move get_cmdline into base class

* Remove unused import

* Small cleanup
2020-09-17 13:36:42 +02:00
Adeeb Shihadeh ef21b83937
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
2020-09-16 15:33:12 -07:00
Adeeb Shihadeh b857f65de8 handle exception in android service call 2020-09-11 13:45:41 -07:00
Shane Smiskol fb6f6268d3
TextWindow Enhancements (#2114)
* cause error

* revert for now

* decrease font by 10 pts

* remove unnecessary () for class ;)

* move exit button closer to right corner

* 70% transparency for black background

* cause error

* well that's not right

* try showing more lines

* actually show last three lines

* forgot to join

* debug what we can leave out

* show last four files

* revert

* show 3 lines and one extra for last erroring line

* increase by 5 points

* move text left a bit

* fix

* fix

* two more lines

* add double indentation for formatting

* remove indentation of file lines

* fix

* fix

* try this

* try this

* make lines shorter

* clean up error code in manager

* try one more

* reduce lines altered in PR

* four is good

* this actually isn't required anymore

* can move more left

* and increase size

* slightly less

* slightly less

* try a different error

* try last three with negative

* revert to 75

* fix

* clean up

* remove path hiding

* revert offsets

* revert
2020-09-03 17:54:49 -07:00
Adeeb Shihadeh 6fad82e710 clean up old params 2020-09-03 16:37:48 -07:00
Adeeb Shihadeh 848301b091
UI vision refactor (#2115)
* refactor vision

* don't show slow frame message when in preview mode

* change draws to uint32_t

* set vision_seen=false after destroy

* remove vision_connect_thread

* refactor ui_update

* seelp 30ms when vision is not connected

* remove should_swap

* call ui_update_sizes before ui_draw

* rebase

* start bigger UI refactor

* don't need the touch fd

* fix qt build

* more cleanup

* more responsive

* more refactor

* fix for pc

* poll for frames

* lower CPU usage

* cleanup

* no more zmq

* undo that

* cleanup speed limit

* fix sidebar severity for athena status

* not aarch64

Co-authored-by: deanlee <deanlee3@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-09-03 16:32:55 -07:00
Willem Melching 5c058140ed
tici: fix set_realtime_priority (#2124)
* cleanup and pin modeld to core 5

* Unused import
2020-09-02 17:52:41 +02:00
Willem Melching c8e0cd3ddd hardware.py: PC is wifi so uploader works 2020-08-26 20:12:56 +02:00
Willem Melching c7152d5419
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
2020-08-26 14:57:17 +02:00
Willem Melching 6bb2630eba
Pandad: turn on panda power (#2073)
* pandad turn on panda power

* Add gpio.py

* needs bytes

Co-authored-by: Comma Device <device@comma.ai>
2020-08-24 16:56:29 +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 8e63f06540
Alert when updated consistently fails (#2013)
* alert when update fails more than 10 times

* bring over offroad alert refactor from other branch

* and we have tests

* use it in snapshot

* bump apk

* don't show exceptions on release branches

* only write when changed

* why does delete use so much cpu

* clean that up

* little more
2020-08-11 16:23:57 -07:00
Harald Schafer e704da0c28 makes more sense 2020-08-04 15:30:20 -07:00
Harald Schafer 0a01d88139 dont init sound 2020-07-31 13:11:59 -07:00
Harald Schafer e03f9d7c73 needed in pipeline 2020-07-28 15:12:16 -07:00
Willem Melching 95b0c69c12
update pipfile.lock (#1896)
* update pipfile

* matrix is deprecated

* Numpy almost equal

* sympy 1.6
2020-07-21 21:15:09 +02:00
Willem Melching c70700758d
Speedup URLFile (#1888)
* add parallel download support to URLFile

* make python 3.8 happy

* Fix chunk size

* Automatic number of threads

* No daemon threads in unlogger

* Cache length

* dont touch old filereader

* Remove debug info

* remove debug script

* Ignore type
2020-07-20 17:10:08 +02:00
Adeeb Shihadeh 5db81f60ca
Fix most remaining LGTM alerts (#1893)
* fixups from LGTM

* short globals

* fix spinner and textwindow

* total ordering

* no spinner/text window when import from manager

* not android
2020-07-19 16:12:22 -07:00
Adeeb Shihadeh 2ad9c50e36 add test for params permissions 2020-07-18 18:30:29 -07:00
Adeeb Shihadeh 8db641efec fix params permissions after #1890 2020-07-18 18:10:46 -07:00
Mufeed VH a34b9f5cb5
Fix insecure temporary file creation (#1890)
* Fix insecure temporary file creation

* minor error fix

tmp_path.name (NamedTemporaryFile().name) is required to return the filename string.
2020-07-17 23:49:57 -07:00
Adeeb Shihadeh 35a5b057c1 minor cleanups from LGTM 2020-07-17 23:34:38 -07:00
Adeeb Shihadeh 165e14d103
Rebuild cython extensions when dependency version changes (#1886)
* rebuild cython extensions when python/cython/distutils version changes

* submodules and boardd

* kalman and transformations
2020-07-16 13:59:32 -07:00
George Hotz 4619401bfc add calmodel 2020-07-06 11:56:31 -07:00
Adeeb Shihadeh f1afb3e3ae
Sound test (#1820)
* WIP sound test

* it does something

* refactor

* phone only

* update release files

* test sound card init

* add to CI

* check writes

* increase time

* unused

* only build cereal

* small tolerance

Co-authored-by: Comma Device <device@comma.ai>
2020-07-05 17:56:24 -07:00
Adeeb Shihadeh b23d7950e3 remove manager_helpers.py after CPU usage test refactor 2020-07-04 00:10:58 -07:00
Greg Hogan 1206409b2e remove duplicate logging context 2020-07-03 16:18:29 -07:00
Adeeb Shihadeh 6db7fa8c03
Refactor CPU usage test (#1802)
* pull CPU usage test out of manager

* remove that

* add to release files

* cleanup

* executable

* this should work

* check if car started procs are running

* debug

* add min cpu usage

* remove debug prints

* adjust min cpu threshold

Co-authored-by: Comma Device <device@comma.ai>
2020-07-03 15:40:13 -07:00
George Hotz cb495bb8c9
Add an SSH param to disable updates (#1807)
* disable updates with optional param

* dont create the alert

* Revert "dont create the alert"

This reverts commit 7179a6c8b4b4656e0b203b5a590b33d3388aa9c9.

* keep alert, but allow engagement

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-07-01 14:26:35 -07:00
Adeeb Shihadeh d08864572f support code for NEOS update alert 2020-06-25 13:05:12 -07:00
Adeeb Shihadeh b89d10c086 fail CPU usage test if can't get usage for a process 2020-06-23 16:11:41 -07:00
Adeeb Shihadeh 33f905b1ed fix CPU usage test for thermald and dmonitoringd 2020-06-23 15:51:43 -07:00
Adeeb Shihadeh 59e77423c4 remove unsused file 2020-06-23 11:40:40 -07:00
Adeeb Shihadeh d204d87b95 enable flake8 F error codes 2020-06-22 14:00:32 -07:00
Willem Melching 29262db5d6 add getter for LocalCoord transformation matrices 2020-06-10 11:35:45 -07:00
Willem Melching c18e7da3c2
Write orientation & transform in C++ (#1637)
* locationd at 20hz

* update ref

* bump cereal

* dont modify global state

* add scons files

* ecef2geodetic and geodetic2ecef

* Finish local coords class

* Add header file

* Add orientation.cc

* cleanup

* Add functions to header file

* Add cython wrapper

* y u no work?

* This passes the tests

* test rot2quat and quat2rot

* Teste euler2rot and rot2euler

* rot_matrix

* test ecef_euler_from_ned and ned_euler_from_ecef

* add benchmark

* Add test

* Consistent newlines

* no more radians supported in geodetic

* test localcoord single

* test localcoord single

* all tests pass

* Unused import

* Add alternate namings

* Add source for formulas

* no explicit tests needed

* remove benchmark

* Add release files

* Typo

* Remove print statement

* no access to raw transform matrix

* temporarily add tolerance

* handcode quat2euler

* update ref
2020-06-09 16:44:26 -07:00
Greg Hogan 3b180240d5 mkdirs_exists_ok more specific URL detection 2020-06-09 08:56:16 -07:00
Greg Hogan 7bf9b04570 ensure mkdirs_exists_ok is not called for URLs 2020-06-08 19:29:33 -07:00
HaraldSchafer 5106117525
More rigorous definition of calibration 2020-06-05 21:52:58 -07:00
Jason Young 68531b071c
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>
2020-06-05 17:09:41 -04:00
Adeeb ab83e48ec4
Add pre-commit hooks (#1629) 2020-06-03 12:54:49 -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
Willem Melching b042ac034e
Turn Jenkins CPU test back on (#1617)
* run cpu test again

* Update cpu values

* Locationd can be more too

* Give some updater allowance

* Just remove updated
2020-06-01 18:57:04 -07:00
Harald Schafer 56e155d41c better name 2020-06-01 12:09:09 -07:00
Adeeb Shihadeh 6466ec982a enable flake8 E502: backslash is redundant between brackets 2020-05-31 17:41:18 -07:00
Adeeb Shihadeh ebed2d1dcc enable flake8 E251: unexpected spaces around keyword / parameter equals 2020-05-31 17:34:47 -07:00
Adeeb Shihadeh f3dcf861c7 enable flake8 E303: too many blank lines 2020-05-31 17:21:11 -07:00
Adeeb Shihadeh 27754a277c enable E261 in flake8: two spaces before inline comment 2020-05-31 14:07:29 -07:00
Willem Melching a0adc44821 Enable new params learner for improved vehicle model estimation 2020-05-31 13:36:27 -07:00
Willem Melching 0e7d509415 fake text window has no close 2020-05-31 12:50:43 -07:00
Adeeb Shihadeh efd5dffb1e enable flake8 E231: missing whitespace after comma 2020-05-31 12:49:11 -07:00
Adeeb 6051061ff8
Flake8 E22X (#1607)
* e221

* e225

* bump opendbc
2020-05-31 00:48:47 -07:00
Adeeb d9bf9f0a40
Enable more flake8 checks (#1602)
* enable some more flake8 checks

* some more quick ones

* bump opendbc

* e401

* e711 e712

* e115 e116

* e222

* e301

* remove that

* e129

* e701 e702

* e125 e131

* e227

* e306

* e262

* W503

* e713

* e704

* e731

* bump opendbc

* fix some e722
2020-05-30 20:14:58 -07:00
Adeeb Shihadeh 6230f366c5 Revert "minor LGTM fixes"
This reverts commit f10c2eff7d.
2020-05-29 11:10:48 -07:00
Adeeb Shihadeh f10c2eff7d minor LGTM fixes 2020-05-29 00:44:27 -07:00
Willem Melching ba2ac1207a
Running pre-commit in CI (#1590)
* Running pre-commit in CI

* fix dockerfile syntax

* dont run on submodule repo folders

* Fix some import errors in ci

* more stuff

* That should be the last one
2020-05-28 15:40:48 -07:00
Willem Melching 3d08dcc3b2
Run mypy commit hook (#1591)
* run mypy commit hook

* fix mypy errors
2020-05-28 15:05:04 -07:00
Willem Melching 29aaa44740
flake8 in pre-commit(#1583) 2020-05-27 20:33:05 -07:00
Willem Melching bd06434243
pre-commit pylint (#1580)
* "The commit-hook project sounds interesting though. I would definitely merge something that runs flake8 and pylint on the modified files!"
-  pd0wm, https://github.com/commaai/openpilot/pull/1575#issuecomment-634974344

* add pylint to pre-commit and make everything pass

* Remove uncommented stuff

Co-authored-by: J <user@4800.lan>
2020-05-27 20:00:14 -07:00
HaraldSchafer 7c8d6cbdef
pure init (#1569) 2020-05-26 20:49:14 -07:00
Willem Melching 5870b48210 Locationd actually runs in jenkins now. Give more cpu allowance 2020-05-20 14:23:57 -07:00
Harald Schafer e864d1af2f update 2020-05-18 14:37:47 -07:00
HaraldSchafer 81686547cc
Locationd cleanup (#1517)
* way cleaner take 2

* cleanup

* be more relaxed

* just let it be

* don't drive backwards or upside down

* do this more

* vNED sometyimes invalid

* use reasonble stds

* stability in nonlinear zone

* previous metrics were without publishing
2020-05-17 20:59:53 -07:00
Willem Melching d08c2d084f Lower modeld cpu threshold thanks to thneed 2020-05-15 15:48:48 -07:00
George Hotz 1295cfe06c
Using lgtm.com and fixing found alerts (#1452)
* lgtm in readme, and mac nui fixes

* call super inits in radars

* unused imports, dup lines

* more radars, more unused imports

* pass CP into RadarInterfaceBase

* more fixups

* unused imports

* delete unused lines

* ugh, new unused import

Co-authored-by: George Hotz <geohot@gmail.com>
2020-05-02 12:07:34 -07:00
George Hotz c4592e8547 add simple usage example to window.py 2020-04-30 15:31:01 -07:00
George Hotz 42fb2b4737 improve printing in profiler 2020-04-27 12:12:40 -07:00
Willem Melching 9e2db91cdd run coordinate tests 2020-04-24 13:55:20 -07:00
Willem Melching f856c99279 remove geocode 2020-04-24 13:53:56 -07:00
George Hotz abad49110e delete more unused, now under 40k lines of python. framereader needs to be ported to C++ 2020-04-24 13:45:34 -07:00
George Hotz 8b448a7c16 delete unused code 2020-04-24 12:10:35 -07:00
George Hotz c5b16df772 more unused code 2020-04-24 09:24:29 -07:00
George Hotz da5cb1842a remove unused code 2020-04-24 08:58:28 -07:00
Willem Melching 8daef80bd7 fix linter 2020-04-23 10:46:39 -07:00
George Hotz aeb0a4af88 transform_img_M 2020-04-22 19:56:53 -07:00
George Hotz 144b37728f who is ready for big model? 2020-04-21 20:23:49 -07:00
Greg Hogan e23f1fcf0a ColumnStoreWriter.add_dict() support for multiple types 2020-04-20 16:56:38 -07:00
Greg Hogan cf131ee8e9 ColumnStoreReader support for intermediate keys of flat dictionaries 2020-04-20 16:25:43 -07:00
Dean Lee f2ef1f6fd5
fix UnicodeDecodeError in get_network_strength (#1385) 2020-04-17 11:38:27 -07:00
ZwX1616 133b1a20b4
RHD support for driver monitoring (#1299) 2020-04-15 16:48:44 -07:00
Greg Hogan efbb4aac2e ColumnStoreWriter/Reader support for dictionary of arrays in single file 2020-04-13 19:04:52 -07:00
Andy 41bb3ac7ca
Sidebar Connectivity Status (#1268)
* store athena connected-at time

* refactor

* deref

* dt import

* Athena status based on last ping time param

* upd test for pingtime

* lower error timeout
2020-04-05 11:06:49 -07:00
DeanLee b4641b7392
fix AttributeError: 'FakeSpinner' object has no attribute 'close' (#1317) 2020-04-05 10:54:01 -07:00