Commit Graph

376 Commits

Author SHA1 Message Date
Vivek Aithal 71696403fb [torqued] Make torqued work on Hyundai Tucson (#26511)
* changes to get offline values

* set tucon values

* move to params.yaml
old-commit-hash: d4fd0c3c8798317e4af87642af30ddbcd39fc4d6
2022-11-15 18:41:43 -08:00
Kurt Nistelberger bc00819b3f add laikad comment
old-commit-hash: 4eda53cef2adb949709166c2e5d204565376ce2e
2022-11-15 16:41:27 -08:00
Vivek Aithal dd16344a1b [locationd] Add input checks (#26460)
* add input checks with same decay as reset_tracker

* add observation timings check

* typo

* bugfix

* improve offline locationd visibility

* sbugfix offline lld

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: fbf2f3816b18321ed921cf03042327134be68edb
2022-11-14 15:02:26 -08:00
Vivek Aithal 8f6f406237 [paramsd] Prevent low speed drifting (#26360)
* lower active speed for paramsd observations

* update refs
old-commit-hash: 81f6ebebaaeda467fd7a4552711cc1109b33ddd5
2022-11-04 01:32:29 -07:00
Kurt Nistelberger 890f7ffd80 locationd: add gps sanity check for quectel gps (#26352)
* update check

* .

* .

* remove gps kf time check for gps ok

* upsi

* dont use gps_mode

* update refs

* Update selfdrive/locationd/locationd.cc

Co-authored-by: Shane Smiskol <shane@smiskol.com>

Co-authored-by: Kurt Nistelberger <kurt.nistelberger@gmail.com>
Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: aebb08e10542758c458c3abb219f8b57485e0b61
2022-11-03 23:43:30 -07:00
HaraldSchafer ed91648949 UI: fade into wide camera (#26203)
* UI: fade into wide camera

* handle routes with no wide calib

* more cleanup

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: dbc30c053caacc689e1fafb5e92ff0fcac57db1d
2022-10-27 17:27:31 -07:00
Vivek Aithal d843347126 [torqued] Update offline values (#26261)
* add qlog mode to torqued

* update offline valujes from qlogs

* resollve comments

* update refs

* resolve comments
old-commit-hash: b158c016cbd58a84e57124f49c657dbba8beb19e
2022-10-27 16:34:11 -07:00
HaraldSchafer 89e6b69f05 Calibrationd: Calibrate wide from device (#26204)
* Use calibrator to stabilize wide transform

* Need array

* Needs init

* Needs to be arr

* publish mshg

* Check size

* Update ref

* fix calibration param read when no wide calib

* need self!
old-commit-hash: 15595fc8599f0ddf1e72ed02422e9f6d266db1f6
2022-10-24 20:17:05 -07:00
Bruce Wayne 21bcfad5a7 Revert "Use calibrator to stabilize wide transform (#26201)"
This reverts commit 1827b3c9e2942240f65d03ec0f790c91aa9c00ee.

old-commit-hash: 75b7fd0a7d9728dbf84e4cff209cbc44799dbdeb
2022-10-21 21:44:47 -07:00
HaraldSchafer dfbb291ef2 Use calibrator to stabilize wide transform (#26201)
* Use calibrator to stabilize wide transform

* Need array

* Needs init

* Bump to master

* Needs to be arr

* publish mshg

* Check size

* Update ref
old-commit-hash: 42ef62e39102ca5ad03982232ebadc37928a6ca2
2022-10-21 20:30:48 -07:00
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