Commit Graph

366 Commits

Author SHA1 Message Date
HaraldSchafer eac9ec1570 locationd: Fix GPS sensor times with fixed offsets (#25920)
* Rewind to qcom time

* Fix test

* Typo

* init unix_time fix

* add gps sensor_time_offsets

* remove all clocks code and add todo

* :emove clocks in unit test

* update refs

* update refs

Co-authored-by: nuwandavek <vivekaithal44@gmail.com>
old-commit-hash: b3324418034fcf09123b614ee2429a4e5bc9d7a5
2022-10-12 17:47:30 -07:00
HaraldSchafer 549a65d51e rawgpsd: publish ephemerides (#25931)
* add svpoly parsing

* Publish poly

* add source check

* add safety check for invalid gpsWeek values

* address PR comments

* add qcom ephemeris source type

* bump cereal and laika

Co-authored-by: Kurt Nistelberger <kurt.nistelberger@gmail.com>
old-commit-hash: 57a82ced285518cad129ec61814aab48bf51910e
2022-10-07 17:27:09 -07:00
Adeeb Shihadeh 3e2f436d4c auto-detect pigeon or quectel (#25991)
* auto-detect pigeon or quectel

* persistent

* fix sim

* fix process replay

* fix locationd unit tests

* fix that

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 01d05f66fe5a189209538650dce319b2f7e192ee
2022-10-06 16:46:15 -07:00
Vivek Aithal a03192a8d7 Extend torqued (#25961)
* extend live torque to all hyundai and toyota cars

* update refs
old-commit-hash: ca746b0a18eebc9b0fa7a6810dba0b28a60548c2
2022-10-04 13:34:31 -07:00
Adeeb Shihadeh 1cb4cdab24 sim: fix sensor freq and timestamps (#25937)
* sim: fix sensor freq and timestamps

* 100hz

* fix that too
old-commit-hash: 5d33199905cbf9d9b45ef722a40530b08d5cecf4
2022-09-29 22:36:09 -07:00
Vivek Aithal 911f4f9ea3 Live torque fix (#25868)
* fix np empty array quirk

* reset to offline values if saved values were not valid live

* edit cloudlog text
old-commit-hash: 4bc175bb9c9dd5976d1dba40abae716bb4a207ba
2022-09-29 16:36:43 -07:00
Kurt Nistelberger fb06d2769f Sensor events splitup (#25714)
* PoC of reading sensors via interrupts instead of polling

* add Gyro and draft for magn

* add more functionality to gpio.cc

* change LSM gyro to interrupt

* resolve rebase conflict

* update BMX accel interrupt impl

* add interrupt collector thread to fetch in parallel

* change get_event interface to return true on successful read

* update BMX gyro interrupt impl

* update gpio.h/.cc according to comments

* address comments, rename Edgetype enum

* Edgetype to EdgeType

* update sensor interrupt interface

* add error handling, and read fd on trigger

* avoid sending empty messages

* fix build

* use gpiochip

* less diff

* gpiochip on both edges, but skip falling edge if rising edge is detected

* init last_ts with 0

* update sensord testcases

* update sensord testsweet

* test for pipeline

* readd with_process

* add null check

* move tests update to seperate PR

* sensord: improve test coverage (#25683)

* update sensord-interrupt testsweet

* address review comments

* inc stddev threshold

* fix format string

* add version 0 check again

* relax strictness after c3 with bmx tests

* relax strictness after tests

Co-authored-by: Kurt Nistelberger <kurt.nistelberger@gmail.com>

* address PR comments

* fix typo

* remove 4ms limit, and skip first 0.5sec of data

* revert disable_interuppt change to destructor

* fix and remove timing skip

* make gpiochip generic

* sensord port

* change from sensorEvents to separated events

* fix gyro usage

* add splitted sensor tests

* modify debug script sensor_data_to_hist.py

* refactor get_event interface to remove sensorEvent message type

* update locationd to non sensorEvent usage

* tmp commit

* fix replay

* fix accelerometer type

* fix sensor to hist debug script

* update sensord tests to split events

* remove rebase artifacts

* port test_sensord.py

* small clean up

* change cereal to sensorEvents-splitup branch

* upate sensorEvents in regen

* fix route generation for splitted sensor events

* regen cleanUp from sensorEvents change

* .

* remove light and temp from locationd

* add generic init delay per sensor

* .

* update routes

* move bmx gyro/accel to its own channel

* adopt sensor tests to bmx channel

* remove rebase artifacts

* fix sensord test

* handle bmx not present

* add bmx sockets to regen

* .

* .

* code cleanUp

* .

* address PR comments

* address PR comments

* address PR comments

* lsm clean up

* readd sensorEvents

* rever regen.py

* .

* update replay refs

* move channels

* fix artifact

* bump cereal

* update refs

* fix timing issue

Co-authored-by: Bruce Wayne <batman@workstation-eu-intern2.eu.local>
Co-authored-by: gast04 <kurt.nistelberger@gmail.com>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 29d3ed2ce63a65f793dc0ecb553180a0d0fba03e
2022-09-29 14:31:54 -07:00
Dean Lee 4b50c653d6 locationd: remove redundant break statements (#25873)
old-commit-hash: cdbb06d45d5c6819319f5b6c2ba8b6f4261e9178
2022-09-22 10:41:47 -07:00
Vivek Aithal 51d25b2011 Live torque (#25456)
* wip torqued

* add basic logic

* setup in manager

* check sanity and publish msg

* add first order filter to outputs

* wire up controlsd, and update gains

* rename intercept to offset

* add cloudlog, live values are not updated

* fix bugs, do not reset points for now

* fix crashes

* rename to main

* fix bugs, works offline

* fix float in cereal bug

* add latacc filter

* randomly choose points, approx for iid

* add variable decay

* local param to capnp instead of dict

* verify works in replay

* use torqued output in controlsd

* use in controlsd; use points from past routes

* controlsd bugfix

* filter before updating gains, needs to be replaced

* save all points to ensure smooth transition across routes, revert friction factor to 1.5

* add filters to prevent noisy low-speed data points; improve fit sanity

* add engaged buffer

* revert lat_acc thresh

* use paramsd realtime process config

* make latacc-to-torque generic, and overrideable

* move freq to 4Hz, avoid storing in np.array, don't publish points in the message

* float instead of np

* remove constant while storing pts

* rename slope, offset to lat_accet_factor, offset

* resolve issues

* use camelcase in all capnp params

* use camelcase everywhere

* reduce latacc threshold or sanity, add car_sane todo, save points properly

* add and check tag

* write param to disk at end of route

* remove args

* rebase op, cereal

* save on exit

* restore default handler

* cpu usage check

* add to process replay

* handle reset better, reduce unnecessary computation

* always publish raw values - useful for debug

* regen routes

* update refs

* checks on cache restore

* check tuning vals too

* clean that up

* reduce cpu usage

* reduce cpu usage by 75%

* cleanup

* optimize further

* handle reset condition better, don't put points in init, use only in corolla

* bump cereal after rebasing

* update refs

* Update common/params.cc

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

* remove unnecessary checks

* Update RELEASES.md

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 4fa62f146426f76c9c1c2867d9729b33ec612b59
2022-09-19 15:19:26 -07:00
Adeeb Shihadeh 35ff65121e pre-commit: add codespell (#25571)
old-commit-hash: 6590fb2b93baedb2e1c5267b4f191f8e20fcd1d2
2022-08-30 11:20:55 -07:00
Adeeb Shihadeh 49e2a4708d laikad: fix cache path
old-commit-hash: 63349809498ffdb1678cbd2aa399a67fc59c66b2
2022-08-29 14:08:21 -07:00
Robbe Derks 78881cf731 Pigeond (#25561)
* split out pigeond from boardd

* also want to turn off power

* fix manager calls

* move to sensord folder

* release files:

* add assistnow code

* no bare except

* add test script to test TTFF

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 13489d092e2c09119e880022507d7331cf54c615
2022-08-26 23:11:46 -07:00
Adeeb Shihadeh d9c279aea9 params: make python and c++ API match (#25573)
* params: make python and c++ API match

* few more
old-commit-hash: 90a4565eb29fe95fc83acf6e4f0ea0851c284d61
2022-08-26 20:46:19 -07:00
HaraldSchafer 21ccf4a6fd Quectel unix timestamp (#25329)
* Use laika

* Fix bug

* Better timestamp name

* Better name

* bump cereal
old-commit-hash: 32201bbbbda0ce4c2ff8cad81ecfe45ca15e4f81
2022-08-01 22:06:58 -07:00
HaraldSchafer e5589e572f Cleanup calibration code (#25119)
* First attempt

* worksish

* tests pass

* cleanup

* get rid of garbahe

* fix name

* Still used in xx

* add debug functions

* used

* Revert "used"

This reverts commit 276e8ebab06d2d4f0e9927ba32b7d8aca2bf88c3.

* Update ref
old-commit-hash: 772b748689cff4d6dc6aab6a8a20247b29a86056
2022-08-01 20:35:14 -07:00
Vivek Aithal e23f58937f Lateral Acceleration Error alert (Sensor Invalid) (#25291)
* sensor flag in paramsd

* increase lateral acc err alert threshold

* add invalid sensor alert from paramsd

* update ref, bool before adding to msg

* account for sign difference in locationd and paramsd

* revert ref
old-commit-hash: e77dc1ab444ce41749d287337ace74f32170cd65
2022-07-28 13:10:01 -07:00
HaraldSchafer fa226dd852 Support quectel gps (#25299)
* qcom clock gets corrected randomly it seems

* Use quectel gps

* fix small laikad bugs

* Support both

* Support ublox and qcom clock model

* fix laikad test

* fix typo

* Back to original value

* More typos

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 11da2804f6f0ffdc6d9bc0b146c8a308d6b66018
2022-07-28 10:56:59 -07:00
Gijs Koning 067ccb79c9 Laikad: improve logging + posfix every 2 sec (#25184)
* Improve logging for pos fix and caching

* Set to debug
old-commit-hash: 5ccc2b89213f37649440984b8b660504a2c7fc29
2022-07-15 13:18:52 +02:00
Gijs Koning 2686b4f8e3 Bump laika and catch Downloadfiles exception.
old-commit-hash: c7771d1783ef7d7e1efb29e81aae44ad26747c5c
2022-07-14 11:49:27 +02:00
Gijs Koning 7b058460c9 Laikad: set cache dir to comma_download_cache (#25131)
* Cache downloads for process replay

* set cache dir permanent

* Create constant
old-commit-hash: 105afee4a21ad008fa741f19c5a62a6d52fdd773
2022-07-12 09:11:47 -07:00
Gijs Koning 954559f01d Laikad: Fix getting covariances for pos and velocity (#25084)
* Fix getting covariances for pos and velocity

* ref commit
old-commit-hash: cf862b6576a8b3f66e26d38080a1c8eec00f0793
2022-07-08 10:03:42 -07:00
Willem Melching 1c8af02e54 laikad: add residual threshold for pos_fix (#25082)
* laikad: add residual threshold for pos_fix

* update ref

* update test
old-commit-hash: 7a4c33795a12eefff4c3e5c311f40eae2cf3506b
2022-07-08 09:20:16 -07:00
Gijs Koning c64a61e652 Laikad: Use clocks for faster fetching orbits (#25060)
* Use clocks msg to for first fetch of orbits. Which is sent earlier than ublox msgs

* refactor last_fetch_orbits

* Add comment.
Add test

* increase timeout

* Add clocks to process replay
old-commit-hash: eaf7eb42784732136e52cd031035e9c5ab520e6e
2022-07-07 04:06:51 -07:00
Gijs Koning 6e0a530bae laikad: Filter unwanted pseudoranges (#25051)
Filter unwanted pseudoranges
old-commit-hash: b88d7c89fae448068aeaca65706d99aa145c8a74
2022-07-06 10:01:19 -07:00
Gijs Koning 27e8adbbce Laikad: Allow fetching orbits every minute (#25016)
* Allow fetching orbits every minute

* Small cleanup
old-commit-hash: 8d6799d95a0a0ab9b2b0bc4ed6998abf6cabf266
2022-07-01 08:44:10 -07:00
Gijs Koning 518524641f Laikad: dont log when filter is not initialized
old-commit-hash: f10283072e4519ad95566dd0d54dbc7f52566f6d
2022-07-01 16:51:07 +02:00
Gijs Koning 02ee2fd12d laikad: Improve logging, fix warning and more exception handling (#25005)
* change logs and add some debugging. Add test

* Less logging and better check for exceptions when parsing orbits

* Fix debug log and fix kf initialization
old-commit-hash: 20ccfed9c1d75de2a589294a5407e15304fd3f4a
2022-07-01 07:43:36 -07:00
HaraldSchafer fa85de9f8b Full localizer: Use standard naming conventions (#25007)
Use standard naming conventions
old-commit-hash: dd43ae2856e144ec13eff462556d8e681aa57789
2022-06-30 14:49:17 -07:00
Gijs Koning 76aaef497b Add laikadOffline subtest to process replay. (#24995)
* Add subtests to process replay.
Adds laikadOffline subtest

* Update cpp.

* Update ref

* Update ref again

* Update ref again

* update ref

* Fix disabling fetching orbits

* Add proc name to event exception

* update ref

* Update setup_env

* Fix offline test and update refs
old-commit-hash: c49f997be505760a18e85a241e6d45b98952c894
2022-06-30 08:39:12 -07:00
Willem Melching a643c2f597 laikad: use cython filter (#24983)
use cython filter
old-commit-hash: 005bc44df692acb3389924d362f5b761987c7c9d
2022-06-28 14:29:41 +02:00
Willem Melching 0071d28b7b add laikad to process replay (#24889)
* merge

* Fix closing process executor after fetching orbits

* cleanup

* Add ref commit and revert test_processes hack

* Fix

* Fix ref

* Fix test

* Temp

* Temp

* Trying

* Trying

* Cleanup and change test

* add ref commit

* remove print

* fix test getting stuck

* cleanup fetch_orbits

Co-authored-by: Gijs Koning <gijs-koning@live.nl>
old-commit-hash: 3823f55476b56fd3db0afe686b1d2f3d508817bc
2022-06-28 13:43:15 +02:00
Gijs Koning 6a83611df2 Update rednose: use EKF_sym_pyx (#24978)
* Update rednose

* Update rednose

* cleanup
old-commit-hash: fdc22554b8c2a2e4b9e0df91beddf469d735b399
2022-06-28 11:32:51 +02:00
Willem Melching 88a90035cf split locationd and liblocationd tests (#24977)
* laikad: use cython version of gnss kf

* fix import error

* test liblocationd separate

* Revert "laikad: use cython version of gnss kf"

This reverts commit bdd769b9554e7e45e976dabd6595403943e864bb.
old-commit-hash: b95e68778271cccf558452686e022ae57f25a701
2022-06-27 21:31:54 +02:00
Willem Melching e7eeeea0f0 calibrationd: start faster by not waiting for carParams (#24976)
* calibrationd: start faster by not waiting for carParams

* fix process replay

* update ref
old-commit-hash: de0c12e5af0e550c194510a19253dd9100b1a9f7
2022-06-27 15:34:36 +02:00
Gijs Koning a5fa349427 Laikad: minor refactor (#24956)
extract code to get_est_pos func
old-commit-hash: b854e67e91105da7301936aab8fd55f94dd46fbb
2022-06-24 17:56:33 +02:00
Gijs Koning 5494622601 Improve laikad cpu usage. Less pos fix. Less local imports (#24887)
* Improve laikad cpu usage. Less pos fix. Not local imports

* Add laika to files_common

* Add laika to dockerfile sim

* Fix

* Fix

* undo
old-commit-hash: 1c4b145aa4d85b7107254be6618592781ff7323e
2022-06-20 14:24:11 +02:00
Gijs Koning fc062222d4 Cast gpstimeofweek to int
old-commit-hash: d4886b2c2995db88d9bc9f7d7cf3f7cb9def5b12
2022-06-16 19:41:51 +02:00
Gijs Koning 226edb4918 laikad: fixes to run on device (#24879)
* Always run laikad on device!

* Update laika

* Update laika

* Fix gps week and time of week in msg

* Reset kalman filter if pos_fix or last_known_position

* put behind file

* move pr parsing into common file

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: dc98511b7a7092e969237655b6e08e4fa857106d
2022-06-16 17:45:08 +02:00
Gijs Koning 4b338d69db Laikad: More logging and use last_pos_fix for correcting (#24868)
Use last available pos_fix for correcting measurements.
Improve logging measurements
old-commit-hash: 5958e78037e468795e0db8d42d5209e1e41aec18
2022-06-16 06:21:33 -07:00
Willem Melching c9e3c42e6c laikad: calc_pos_fix numpy implementation (#24865)
* Replace posfix with gauss newton method

* Cleanup

* Check if glonass is in the list

* Fix

* also return residual

* Add residuals

* Update selfdrive/locationd/laikad.py

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

* Cleanup

Co-authored-by: Gijs Koning <gijs-koning@live.nl>
old-commit-hash: fa4f017bbe6c117913ec2327e9129c70b3e47223
2022-06-15 18:03:15 +02:00
Gijs Koning 36c48c1683 Laikad: Remove bearingDeg from message (#24864)
* Remove bearingDeg from message.

* Push cereal

* Commit cereal
old-commit-hash: 9e3d0e3c9cea4dcf2da10801aad041b1dd65cccb
2022-06-15 05:00:27 -07:00
Gijs Koning 61dcb8729c Laikad: Cache orbit and nav data (#24831)
* Cache orbit and nav data

* Cleanup

* Cleanup

* Use ProcessPoolExecutor to fetch orbits

* update laika repo

* Minor

* Create json de/serializers
Save cache only 1 minute at max

* Update laika repo

* Speed up json by caching json in ephemeris class

* Update laika

* Fix test

* Use constant
old-commit-hash: c3fa9151f39994984b60a19cdd7425dba73ec2fc
2022-06-15 02:32:07 -07:00
Gijs Koning e03eddea87 Laikad: process executor to fetch orbits (#24843)
* Use ProcessPoolExecutor to fetch orbits

* update laika repo

* Minor
old-commit-hash: a2d2378ee147f2db59aecd3401677cb2427d1ced
2022-06-13 05:02:31 -07:00
Gijs Koning 11033eba53 Laikad: Use filter for correcting measurements (#24824)
* Update laikad.

* Update log error
old-commit-hash: 724b322909152d58f626b6e76fd34d7d03d67250
2022-06-13 02:45:35 -07:00
Adeeb Shihadeh 3c48bc47b7 Move a bunch of stuff to system/ part 3 (#24829)
* move swaglog.py

* timezoned

* logmessaged

* version.py

* fix linter
old-commit-hash: 0fce5d90459b77bf2cfa70f55f322f0e1fb8d01c
2022-06-11 23:19:27 -07:00
Gijs Koning 735a7770dc LaikaD: Fix offline handling (#24781)
* Test handling no internet correctly.

* Clean

* Comment

* remove del
old-commit-hash: a9bdc792a184d191824d2ec089658eb3a96f1e45
2022-06-08 07:33:05 -07:00
Gijs Koning 8bbdb79626 Laikad: kill process correctly. Fixes CI (#24780)
Kill process correctly
old-commit-hash: 45c43f9c8719efc300a0cb373f1dc57e0abe3ece
2022-06-08 03:32:22 -07:00
Gijs Koning 2fabc9d509 Laikad: Use process for parsing orbits (#24769)
* Use Process instead of Thread to fetch orbits

* small refactor

* Cleanup
old-commit-hash: e7234e22b4d11cc8f349d02855df9b3414096c0d
2022-06-07 20:55:39 +02:00
Gijs Koning 7bf243b61e Laikad: cleanup fetching orbits (#24759)
* Seperate prediction orbits from regular observation orbits and download them efficient

* Cleanup

* clean and update laika

* Fix test

* Fix test

* Fix checking pos fix

* space
old-commit-hash: 8d8055f00f11fcdf0a8a235de5218d9c2fd2f5ad
2022-06-07 03:25:58 -07:00
Gijs Koning 9771eebb62 Laikad: Fetch orbit data in thread (#24654)
* Add fetching orbits thread

* Use ephemeris type enum. Send list of std floats.
Speed up parsing orbit data by skipping redundant old data

* Remove Glonass from supported constellation for now

* Fix latest time msg

* Add small laika update

* Fix
old-commit-hash: 7df54792d8c04d842d44536723edb7b8370c47a1
2022-06-04 09:25:20 +02:00