Commit Graph

186 Commits (spacecruft)

Author SHA1 Message Date
HaraldSchafer 0a34900fec
clip arcsin to prevent locationd orientation NaN (#20868)
* clip arcsin

* can of course be negative
2021-05-10 20:21:20 -07:00
Adeeb Shihadeh b4447993c1
add CLEAR_ON_IGNITION param type (#20810) 2021-05-04 11:32:40 -07:00
Dean Lee 27d3f820bf
Params: move keys from cython to cc (#20814)
* move keys from cython to cc

* consistency

* passes tests

* more consistency

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-05-04 10:49:26 -07:00
Adeeb Shihadeh f9a961f6fb
delay controls start (#20761)
* delay controls start

* shouldn't need this stuff anymore

* only delay board

* bail after 2s

* fix loopback test

* fix process replay

* update refs

* bump cereal

Co-authored-by: Comma Device <device@comma.ai>
2021-04-30 13:55:17 -07:00
Joost Wooning 3420707ad5
convert locationd to c++ (#20622)
* live_kf to c++

* first locationd code

* Running in process_replay

* locationd handle cam_odo and live_calib

* log event handlers

* working message receiving

* compiling message sending

* correctly sending some messages

* correct receiving and sending

* update ref_commit with some all_alive_and_valid being false, minor fixes

* fix std abs

* linking on device fix

* fix cpu usage test

* generate kf constants and defines

* fix replay test

* replay without acks, cleanup

* operate on bytearray messages

* cleanup

* send msg fix

* small sleep, less flaky test

* remove python locationd

* review feedback

* bump rednose
2021-04-20 11:56:43 +02:00
Adeeb Shihadeh 2eac604993
lte toggle (#20683) 2021-04-14 21:19:06 -07:00
Willem Melching 74aa6e29c9
Params: new class FileLock (#20636)
* new class LockFile

* lock->try_lock

* rebase master

* close if fd_ >=0

* rename try_lock to lock

* keep tryring if flock() return EINTR

* throw exception on error

* keep trying if open() gets interrupted by a signal

* close fd_ before throw flock exception

* add macro HANDLE_EINTR

* HANDLE_EINTR for open & write

* add errno in exception

* add destructor

* don't throw exception,log err and return

* Revert "don't throw exception,log err and return"

This reverts commit 6e1ba4a1bd82de3d4d07db5238a82184fd2ec9b4.

* add lock file name in exception

* cleanup  exception text

* use lock_guard in function put

* anonymous namespace

* use do-while(0) instead of goto

* cleanup read_db_all

* cleanup FileLock

* remove fchmod 0666 for apks

* Revert "remove fchmod 0666 for apks"

This reverts commit b389c31762417c4465d73be2453efcf7bc693aee.

* log instead of runtime error

* keep libs

Co-authored-by: deanlee <deanlee3@gmail.com>
2021-04-09 16:35:44 +02:00
Willem Melching 1fc7bcca43
ecam toggle (#20597)
* use ecam in ui

* needs reboot

* use in modeld

* typo

* effective FL is longer in center

* normalize zoom by focal dist

* read param before init

* make 2x as wide

* review comments

* more explicit

* fix camera offset

Co-authored-by: ZwX1616 <zwx1616@gmail.com>
2021-04-07 19:12:35 +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
Dean Lee 98e55996f6
Params: python-like interface (#20506)
* rebase master

* delete outdated test_params.c

* putBool & more robust getBool

* putBool(SshEnabled)
2021-03-30 12:54:59 +02:00
Dean Lee 5cd676797a
Qt: show username for current SSH keys (#20508)
* Show username for current SSH keys

* Update ssh_keys.cc

* Update ssh_keys.cc

* Update selfdrive/ui/qt/widgets/ssh_keys.cc

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

* rename param

* cleanup

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-03-28 22:32:33 -07:00
Greg Hogan 1e3f8b014e
logging cleanup (#20502)
* switch some uploader messages to debug log

* use allow_sleep

* log when not request or response

* test both with params and without params
2021-03-26 17:36:01 -07:00
Willem Melching d43d625610
Cache prime/points widget (#20497)
* cache prime status on homescreen

* use stacked widget

* add caching and clear on 404
2021-03-26 14:53:12 +01:00
Dean Lee 80ae6a7e1b
Qt: cache home screen state (#20395)
* cache drive stats

* don't parse response if it's the same as previous

* remove blank line

* cleanup

* update stats in place

* validate json

* add DriveStats to params.pyx

* cleanup

* cleanup

* remove //#include

* simplify

* add cache to RequestRepeater

* rename CachedDriveStats to ApiCacheDriveStats

* rename ApiCacheDriveStats to ApiCache_DriveStats

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-03-26 13:29:30 +01:00
Adeeb Shihadeh bcb6879199
updated: log git diff on overlay init (#20476)
* updated: log git diff on overlay init

* add git diff param

* params
2021-03-25 16:16:12 -07:00
Greg Hogan 3d48bd934d
log to file and send through athena (#20250)
* log to file and send through athena

* rename logging level

* pass thru log formatter

* logMessage is TEXT

* send queue always strings

* switch to xattr and lower priority queue

* enable cloud logging for devices

* time or size based log rotation

* basename -> dirname

* remove HARDWARE.get_cloudlog_enabled

* fix errors

* fix another exception

* xattrs need to be bytes

* sending works

* cleanup files at start

* add id and adjust formatting

* do not send active log file

* better names

* separate log formatters

* fix formatter super init

* fix log file order

* ensure file always has file formatter

* i see why there was no formatter

* apply same formatting to cpp log msgs

* apply same formatting to cpp log msgs

* update queue names in tests

* strip deprecated keys in STATUS_PACKET

* strip DEPRECATED from dict recursively

* athena log queue test

* instanceof instead of type

* isinstance instead of type

* use super

* remove logentries

* last_scan param unused

* comment about special log msg attr names

* add dict_helpers.py to release files

* use monotonic time and counter for log rotation

* update for adjusted log file naming

* use monotonic clock for tracking last log file scan
2021-03-25 13:30:09 -07:00
HaraldSchafer 7ee79c9923
New KL model + laneless toggle (#20454)
* New model: 0bf38240-6b55-42b0-bcfb-da08ff5cd0b9/650

* laneless baby

* hardcode model difference for now

* kale toggle

* kale emoji

* sensible description

* make clear it is not just for ui

* emojis dont work yet

* 9671a8fe-539f-4a04-a163-54571df21139/650

* new model

* only read param on rising edge of ignition

* update toggle text

* fix that

* update refs

Co-authored-by: mitchell <mitchellgoffpc@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-03-24 01:10:31 -07:00
Adeeb Shihadeh 43ce7165c4
Remove lane change toggle and default LDW to off (#20442)
* remove lane change toggle and default LDW to off

* update refs
2021-03-22 20:55:57 -07:00
Adeeb Shihadeh b60cd8d0a0
record front lock (#20400)
* record front lock

* only if set

* add to internal installer

* move that

* change that bck

Co-authored-by: Comma Device <device@comma.ai>
2021-03-18 20:15:51 -07:00
Shane Smiskol a3556410de
Spinner: wait for UI to start (#20279)
* Impose a max rate for updating spinner progress

* fix import

* Show spinner until offroad is started

* no need for time

* Fix ROOT_DIR

* Fix fb include

* fix relative path

* don't touch these files

* Close spinner after all procs have started

* don't touch file

* Move up

* Revert changes to spinner, and only sleep on final progress update

* add this back

* revert time

* test sending 100

* test sending 100

* revert makefile changes

* rm 2nd 100% update

* pass spinner to thread function

* pass ignore list

* Default to None

Co-authored-by: Willem Melching <willem.melching@gmail.com>

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-03-09 13:37:11 -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 d169914674
agnos 0.6 (#20077)
* updates for agnos 0.6

* timezone

* bump version
2021-02-18 18:14:34 -08:00
HaraldSchafer ab0456c0eb
fixup ui (#20049)
* fixup ui

* works

* new formate

* more cleanup

* works I assume we need a library somehow

* more readable

* fix lead sign

* put on road

* transformations lib

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-02-09 17:23:46 -08:00
Willem Melching 4c04e220a1
Timezoned (#19960)
* untested code

* add to manager

* whitespace

* only save on fix

* cleanup

* fix typo

* add to ignored processes

* import tici

* fix param name

* cleanup

* only run offroad

* use itertools

* wait for thermald

* simpler

* fall back to api call

* add param to override timezone

Co-authored-by: Comma Device <device@comma.ai>
2021-02-06 11:07:37 +01:00
Shubham Dhumal 236743a4e2
Fix jwt.encode return type (#19776) (#19958)
* Fix for issue #19776

PyJWT 2.0.0 does not return `bytes` for `encode()` instead returns `str`. So converted the `str` to `bytes` and returned the resulting value

* added check for jwt.encode return type

* Update __init__.py

* Updated with suggested change

* Test to check return type of get_token() 

The `get_token()` must return a `str` but for PyJWT version < 2.0.0 the `jwt.encode()` returns `bytes`. This test is to make sure if token returned by `get_token()` is `str`.

* Update test_get_token.py

* Update test_get_token.py

* Delete test_get_token.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-02-02 15:36:04 +01:00
Greg Hogan 767ada98c7
vision-only radar toggle (#19849) 2021-01-27 14:15:59 +01:00
Greg Hogan 1dd3a1e861
params helpers (#19788)
* params helpers

* add validation
2021-01-19 14:39:00 -08:00
grekiki 10bd761cd6
Qt offroad: pairing (#19675)
* kind of works now

* QR code is now on screen

* testing is needed

* works, waiting for server update

* reduce diff

* refactoring part1

* refactor part2

* refactor part3

* works on PC

* fix build, annoying bug though...

* git is annoying

* more classes, still crashes after a while

* better style

* clearer qr code

* less code and test new ssh key

* no more AA

* rename and collect garbage

* no pairing widget without the internet connection

* No network connection

* more logs

* refactor the network calls

* no more leaking

* works

* cleanup

* spaces

* works on device

* fix merge

* don't run if screen is off

* always initialized

* stats updating, not running without scrren

* formatting

* nicer QR code

* ensure the registration

* no qr code if no IMEI or no HWSerial

* all works

* refactor

* better networking

* all functionality seems to work

* small cleanup

* get serial once

* Small cleanup

* No internet text

* Don't crash if private key not found

* no network should say so

* new qr code every 30 minutes

* 20FPS sidebar

* more responsive networking and QR

* more logs

* no log spam

* fix merge

* no running onroad

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-01-18 12:07:55 +01:00
HaraldSchafer 158210cde8
Mpc rework2 (#19660)
* start again

* need that too

* this actually works

* not needed

* do properly

* still works

* still works

* still good

* all G without ll

* still works

* all still good

* cleanup building

* cleanup sconscript

* new lane planner

* how on earth is this silent too....

* update

* add rotation radius

* update

* pathplanner first pass

* misc fixes

* fix

* need deep_interp

* local again

* fix

* fix test

* very old

* new replay

* interp properly

* correct length

* another horrible silent bug

* like master

* fix that

* do doubles

* different delay compensation

* make robust to empty msg

* make pass with hack for now

* add some extra

* update ref for increased leg

* test cpu usage on this pr

* tiny bit faster

* purge numpy

* update ref

* not needed

* ready for merge

* try again after recompile

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-01-14 18:43:50 -08:00
Dean Lee 595830135b
merge utilpp.h into util.h (#19710) 2021-01-10 14:57:32 -08:00
Adeeb Shihadeh 4096f86e21
lgtm fixes (#19610)
* pass matrices by reference

* suppress that

* destructor

* that's wrong, suppress it
2020-12-28 20:36:23 -08:00
Adeeb Shihadeh 71d317872a
fix startup spinner for non-C2 (#19536)
* limit build progress

* cleanup

* types

* comment
2020-12-18 14:47:25 -08:00
grekiki 5b26c97141
Qt Offroad stats (#19498)
* probably broke a lot, need the commit though

* finally works

* make it work...

* ...

* kind of works

* better styling

* all should work

* tiny cleanup

* temp

* looks nicer

* create JWT in C++

* kilometers -> km

* use correct free methods

* dont put code in assert statement

* Build JWT payload dynamically

* get dongle id once

* include cleanup

* Remove qDebug

* Update drive_stats.cc

Github is a nice editor :)

* swap week and all and fix sconscript

* install openssl

* openssl include dirs on mac

* is this where openssl is?

* It's here

* small cleanup

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-12-18 13:29:20 +01:00
Adeeb Shihadeh b276881fcd
agnos updater (#2600)
* agnos updater

* add manifest

* fix path

* get manifest from overlay

* update manifest

* remove merge markers

* add streaming decompressor

* dont need read all

* Unsparsify

* Fix output filename

* Optimization

* cleanup

* Small cleanup

* Read manifest from merged overlay

* Write hash at end of partition

* Sync before writing hash

* Write bytes in file

* add manifest with image sizes

* Fix manifest path

* File was closed already

* Format string

* Put raw hash

* Read hashes in launch script

* update launch script

* should be agnos version

* fix slot

* Make sure we clear the hash

* Verify partition size

* move updated

* Standalone flasher

* Don't rely on ordering

* Get path

* Debug log

* Download agnos

* Info is enough

* update manifest

* Remove f

* Check downloader return code

* Exit on wrong manifest

* Fix typos

* Set pythonpath before hardware init

* move agnos into hardware folder

* remove comments

* Fix abstractmethod

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-12-18 13:17:12 +01: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
Adeeb Shihadeh a2c6fdd14c Revert "Handle python-dbus not installed"
This reverts commit 25054cdc05.
2020-12-15 20:29:24 -08:00
Adeeb Shihadeh c57ee16e86
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>
2020-12-15 19:22:03 -08:00
Willem Melching 25054cdc05 Handle python-dbus not installed 2020-12-14 15:04:17 +01:00
Willem Melching c3b5ef8d4b
hardware.py: get network info over dbus (#2727)
* Get network stuff using dbus

* most people would call EDGE 2G

* Small cleanup
2020-12-14 14:19:14 +01: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
George Hotz bdb1b766d0
Make the DSP work everywhere (#2621)
* Use DSP again

* 20 Hz

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-11-30 11:21:06 +01:00
Jon Ander Oribe 887d67eb8d
Simple improvements for quality gate (#2517)
* Improvements for quality gate

* Update test_xattr.py

* Update test_mpc_wobble.py

* python

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-11-12 14:48:45 -08:00
grekiki 9529764549
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>
2020-11-11 21:14:51 +01:00
Dean Lee c88ab9bfd6
params_pyx_setup.py: -std=c++17 (#2503) 2020-11-07 21:59:37 -08:00
Adeeb Shihadeh 6c86afee16
Qt spinner (#2494)
* move android spinner

* qt spinner

* rotation

* nothing by default

* spin spin

* fix rotate

* style

* spinner for all

* -2

* unused
2020-11-06 18:44:04 -08:00
Adeeb Shihadeh 68ba1649b9
Qt text window (#2489)
* qt text window

* auto size

* real text

* this is cleaner

* fix android build

* exit on pc

* tici fixes
2020-11-06 12:05:24 -08:00
ZwX1616 c0946c8bdb
generalize camera assumptions (#2423)
* clean up 1

* complain

* cleanup

* make models api generic

* clean up 2

* cleanup

* remove unused
2020-11-05 13:22:28 -08:00
Adeeb Shihadeh 47c21f10f5
grey panda is unsupported (#2458) 2020-11-03 19:56:25 -08:00
George Hotz 85dab89e1c sbigmodel, a bigmodel with the size of a smallmodel 2020-10-27 10:46:02 -07:00
George Hotz bb2e69faf3 support for halve in Window 2020-10-20 16:07:05 -07:00